blob: d5a92406ec4f1be55f02bb8f5ebece8cb0e9ae4b [file] [log] [blame]
Ying Wangb335bb02011-11-29 10:23:55 -08001#
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 Hansson65558ee2018-04-09 17:40:57 +010017LOCAL_PATH := $(call my-dir)
Ying Wangc7036822015-04-16 11:54:37 -070018
Anton Hansson65558ee2018-04-09 17:40:57 +010019# Declares a single sdk module. These targets are referenced by the core build system.
Anton Hanssona0d2fa82018-04-26 11:37:11 +010020# $(1): sdk version (e.g. 23, current)
21# $(2): api level (e.g. public, system)
22# $(3): stub jar file path
Anton Hansson65558ee2018-04-09 17:40:57 +010023define declare-sdk-prebuilt
24include $$(CLEAR_VARS)
Anton Hanssona0d2fa82018-04-26 11:37:11 +010025# Format: sdk_<api>_<sdk_version>_<stub_name>
26LOCAL_MODULE := sdk_$(2)_$(1)_$(notdir $(basename $(3)))
Anton Hansson65558ee2018-04-09 17:40:57 +010027LOCAL_PREBUILT_MODULE_FILE := $(3)
Yohann Roussel855a9502016-08-19 18:58:57 +020028LOCAL_MODULE_CLASS := JAVA_LIBRARIES
Anton Hansson65558ee2018-04-09 17:40:57 +010029LOCAL_MODULE_SUFFIX := $$(COMMON_JAVA_PACKAGE_SUFFIX)
Anton Hanssona0d2fa82018-04-26 11:37:11 +010030LOCAL_BUILT_MODULE_STEM := $$(LOCAL_MODULE)$$(COMMON_JAVA_PACKAGE_SUFFIX)
31LOCAL_MIN_SDK_VERSION := $(if $(call math_is_number,$(strip $(1))),$(1),$$(PLATFORM_JACK_MIN_SDK_VERSION))
Yohann Roussel855a9502016-08-19 18:58:57 +020032LOCAL_UNINSTALLABLE_MODULE := true
Anton Hanssona0d2fa82018-04-26 11:37:11 +010033# TODO(hansson): change to $(1) after migration is done.
Jiyong Park5c3b0bb2018-03-07 23:36:18 +090034LOCAL_SDK_VERSION := current
Anton Hansson65558ee2018-04-09 17:40:57 +010035include $$(BUILD_PREBUILT)
Yohann Roussel855a9502016-08-19 18:58:57 +020036endef
37
Anton Hansson65558ee2018-04-09 17:40:57 +010038$(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 Hanssona0d2fa82018-04-26 11:37:11 +010042 $(call declare-sdk-prebuilt,$(version),$(api_level),$(jar_file))))))
Ying Wang2a38d242014-04-25 14:49:31 -070043
Ying Wangb335bb02011-11-29 10:23:55 -080044include $(call all-makefiles-under,$(LOCAL_PATH))