Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2010 The Android Open Source Project |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | |
Anton Hansson | 65558ee | 2018-04-09 17:40:57 +0100 | [diff] [blame] | 17 | LOCAL_PATH := $(call my-dir) |
Ying Wang | c703682 | 2015-04-16 11:54:37 -0700 | [diff] [blame] | 18 | |
Anton Hansson | 65558ee | 2018-04-09 17:40:57 +0100 | [diff] [blame] | 19 | # Declares a single sdk module. These targets are referenced by the core build system. |
Anton Hansson | a0d2fa8 | 2018-04-26 11:37:11 +0100 | [diff] [blame] | 20 | # $(1): sdk version (e.g. 23, current) |
| 21 | # $(2): api level (e.g. public, system) |
| 22 | # $(3): stub jar file path |
Anton Hansson | 65558ee | 2018-04-09 17:40:57 +0100 | [diff] [blame] | 23 | define declare-sdk-prebuilt |
| 24 | include $$(CLEAR_VARS) |
Anton Hansson | a0d2fa8 | 2018-04-26 11:37:11 +0100 | [diff] [blame] | 25 | # Format: sdk_<api>_<sdk_version>_<stub_name> |
| 26 | LOCAL_MODULE := sdk_$(2)_$(1)_$(notdir $(basename $(3))) |
Anton Hansson | 65558ee | 2018-04-09 17:40:57 +0100 | [diff] [blame] | 27 | LOCAL_PREBUILT_MODULE_FILE := $(3) |
Yohann Roussel | 855a950 | 2016-08-19 18:58:57 +0200 | [diff] [blame] | 28 | LOCAL_MODULE_CLASS := JAVA_LIBRARIES |
Anton Hansson | 65558ee | 2018-04-09 17:40:57 +0100 | [diff] [blame] | 29 | LOCAL_MODULE_SUFFIX := $$(COMMON_JAVA_PACKAGE_SUFFIX) |
Anton Hansson | a0d2fa8 | 2018-04-26 11:37:11 +0100 | [diff] [blame] | 30 | LOCAL_BUILT_MODULE_STEM := $$(LOCAL_MODULE)$$(COMMON_JAVA_PACKAGE_SUFFIX) |
| 31 | LOCAL_MIN_SDK_VERSION := $(if $(call math_is_number,$(strip $(1))),$(1),$$(PLATFORM_JACK_MIN_SDK_VERSION)) |
Yohann Roussel | 855a950 | 2016-08-19 18:58:57 +0200 | [diff] [blame] | 32 | LOCAL_UNINSTALLABLE_MODULE := true |
Anton Hansson | a0d2fa8 | 2018-04-26 11:37:11 +0100 | [diff] [blame] | 33 | # TODO(hansson): change to $(1) after migration is done. |
Jiyong Park | 5c3b0bb | 2018-03-07 23:36:18 +0900 | [diff] [blame] | 34 | LOCAL_SDK_VERSION := current |
Anton Hansson | 65558ee | 2018-04-09 17:40:57 +0100 | [diff] [blame] | 35 | include $$(BUILD_PREBUILT) |
Yohann Roussel | 855a950 | 2016-08-19 18:58:57 +0200 | [diff] [blame] | 36 | endef |
| 37 | |
Anton Hansson | 65558ee | 2018-04-09 17:40:57 +0100 | [diff] [blame] | 38 | $(foreach version,$(patsubst $(LOCAL_PATH)/%/public/android.jar,%,$(wildcard $(LOCAL_PATH)/*/public/android.jar)),\ |
| 39 | $(foreach api_level,core public system,\ |
| 40 | $(foreach jar_file, $(wildcard $(LOCAL_PATH)/$(version)/$(api_level)/*.jar),\ |
| 41 | $(eval \ |
Anton Hansson | a0d2fa8 | 2018-04-26 11:37:11 +0100 | [diff] [blame] | 42 | $(call declare-sdk-prebuilt,$(version),$(api_level),$(jar_file)))))) |
Ying Wang | 2a38d24 | 2014-04-25 14:49:31 -0700 | [diff] [blame] | 43 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 44 | include $(call all-makefiles-under,$(LOCAL_PATH)) |