2017-09-07 22:21:51 +02:00
|
|
|
# Java prebuilt coming from Soong.
|
|
|
|
# Extra inputs:
|
|
|
|
# LOCAL_SOONG_HEADER_JAR
|
2017-09-12 22:41:20 +02:00
|
|
|
# LOCAL_SOONG_DEX_JAR
|
2017-11-23 01:04:55 +01:00
|
|
|
# LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR
|
2017-09-07 22:21:51 +02:00
|
|
|
|
|
|
|
ifneq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK))
|
|
|
|
$(call pretty-error,soong_java_prebuilt.mk may only be used from Soong)
|
|
|
|
endif
|
|
|
|
|
|
|
|
LOCAL_MODULE_SUFFIX := .jar
|
|
|
|
LOCAL_BUILT_MODULE_STEM := javalib.jar
|
|
|
|
|
|
|
|
#######################################
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
#######################################
|
|
|
|
|
|
|
|
full_classes_jar := $(intermediates.COMMON)/classes.jar
|
2017-11-30 05:44:11 +01:00
|
|
|
full_classes_pre_proguard_jar := $(intermediates.COMMON)/classes-pre-proguard.jar
|
2017-09-07 22:21:51 +02:00
|
|
|
full_classes_header_jar := $(intermediates.COMMON)/classes-header.jar
|
2017-09-12 22:41:20 +02:00
|
|
|
common_javalib.jar := $(intermediates.COMMON)/javalib.jar
|
2017-09-07 22:21:51 +02:00
|
|
|
|
2017-11-23 01:04:55 +01:00
|
|
|
$(eval $(call copy-one-file,$(LOCAL_PREBUILT_MODULE_FILE),$(full_classes_jar)))
|
2017-11-30 05:44:11 +01:00
|
|
|
$(eval $(call copy-one-file,$(LOCAL_PREBUILT_MODULE_FILE),$(full_classes_pre_proguard_jar)))
|
2017-09-07 22:21:51 +02:00
|
|
|
|
2018-01-10 20:40:14 +01:00
|
|
|
ifdef LOCAL_DROIDDOC_STUBS_JAR
|
2018-02-28 19:12:32 +01:00
|
|
|
$(eval $(call copy-one-file,$(LOCAL_DROIDDOC_STUBS_JAR),$(OUT_DOCS)/$(LOCAL_MODULE)-stubs.srcjar))
|
|
|
|
ALL_DOCS += $(OUT_DOCS)/$(LOCAL_MODULE)-stubs.srcjar
|
2018-01-10 20:40:14 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef LOCAL_DROIDDOC_DOC_ZIP
|
|
|
|
$(eval $(call copy-one-file,$(LOCAL_DROIDDOC_DOC_ZIP),$(OUT_DOCS)/$(LOCAL_MODULE)-docs.zip))
|
|
|
|
endif
|
|
|
|
|
2017-11-23 01:04:55 +01:00
|
|
|
ifdef LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR
|
|
|
|
$(eval $(call copy-one-file,$(LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR),\
|
|
|
|
$(intermediates.COMMON)/jacoco-report-classes.jar))
|
2017-12-07 01:09:49 +01:00
|
|
|
$(call add-dependency,$(common_javalib.jar),\
|
|
|
|
$(intermediates.COMMON)/jacoco-report-classes.jar)
|
2017-11-23 01:04:55 +01:00
|
|
|
endif
|
2017-09-07 22:21:51 +02:00
|
|
|
|
2017-09-27 01:17:24 +02:00
|
|
|
ifneq ($(TURBINE_DISABLED),false)
|
2017-09-07 22:21:51 +02:00
|
|
|
ifdef LOCAL_SOONG_HEADER_JAR
|
|
|
|
$(eval $(call copy-one-file,$(LOCAL_SOONG_HEADER_JAR),$(full_classes_header_jar)))
|
|
|
|
else
|
|
|
|
$(eval $(call copy-one-file,$(full_classes_jar),$(full_classes_header_jar)))
|
|
|
|
endif
|
2017-09-27 01:17:24 +02:00
|
|
|
endif # TURBINE_DISABLED != false
|
2017-09-07 22:21:51 +02:00
|
|
|
|
2017-09-12 22:41:20 +02:00
|
|
|
ifdef LOCAL_SOONG_DEX_JAR
|
2017-10-10 00:46:15 +02:00
|
|
|
ifndef LOCAL_IS_HOST_MODULE
|
2018-01-29 15:43:14 +01:00
|
|
|
ifneq ($(filter $(LOCAL_MODULE),$(PRODUCT_BOOT_JARS)),) # is_boot_jar
|
|
|
|
$(eval $(call hiddenapi-copy-soong-jar,$(LOCAL_SOONG_DEX_JAR),$(common_javalib.jar)))
|
|
|
|
else # !is_boot_jar
|
|
|
|
$(eval $(call copy-one-file,$(LOCAL_SOONG_DEX_JAR),$(common_javalib.jar)))
|
|
|
|
endif # is_boot_jar
|
2017-10-20 20:36:13 +02:00
|
|
|
$(eval $(call add-dependency,$(common_javalib.jar),$(full_classes_jar) $(full_classes_header_jar)))
|
2017-10-10 00:46:15 +02:00
|
|
|
|
2017-12-07 01:04:35 +01:00
|
|
|
dex_preopt_profile_src_file := $(common_javalib.jar)
|
|
|
|
|
2017-10-10 00:46:15 +02:00
|
|
|
# defines built_odex along with rule to install odex
|
|
|
|
include $(BUILD_SYSTEM)/dex_preopt_odex_install.mk
|
|
|
|
|
2017-12-07 01:04:35 +01:00
|
|
|
dex_preopt_profile_src_file :=
|
|
|
|
|
2017-10-10 00:46:15 +02:00
|
|
|
ifdef LOCAL_DEX_PREOPT
|
|
|
|
ifneq ($(dexpreopt_boot_jar_module),) # boot jar
|
|
|
|
# boot jar's rules are defined in dex_preopt.mk
|
|
|
|
dexpreopted_boot_jar := $(DEXPREOPT_BOOT_JAR_DIR_FULL_PATH)/$(dexpreopt_boot_jar_module)_nodex.jar
|
|
|
|
$(eval $(call copy-one-file,$(dexpreopted_boot_jar),$(LOCAL_BUILT_MODULE)))
|
|
|
|
|
|
|
|
# For libart boot jars, we don't have .odex files.
|
|
|
|
else # ! boot jar
|
|
|
|
$(built_odex): PRIVATE_MODULE := $(LOCAL_MODULE)
|
|
|
|
# Use pattern rule - we may have multiple built odex files.
|
2017-10-06 01:01:00 +02:00
|
|
|
$(built_odex) : $(dir $(LOCAL_BUILT_MODULE))% : $(common_javalib.jar)
|
|
|
|
@echo "Dexpreopt Jar: $(PRIVATE_MODULE) ($@)"
|
|
|
|
$(call dexpreopt-one-file,$<,$@)
|
|
|
|
|
2017-10-10 00:46:15 +02:00
|
|
|
$(eval $(call dexpreopt-copy-jar,$(common_javalib.jar),$(LOCAL_BUILT_MODULE),$(LOCAL_DEX_PREOPT)))
|
|
|
|
endif # ! boot jar
|
|
|
|
else # LOCAL_DEX_PREOPT
|
|
|
|
$(eval $(call copy-one-file,$(common_javalib.jar),$(LOCAL_BUILT_MODULE)))
|
|
|
|
endif # LOCAL_DEX_PREOPT
|
|
|
|
else # LOCAL_IS_HOST_MODULE
|
|
|
|
$(eval $(call copy-one-file,$(LOCAL_SOONG_DEX_JAR),$(LOCAL_BUILT_MODULE)))
|
2017-10-20 20:36:13 +02:00
|
|
|
$(eval $(call add-dependency,$(LOCAL_BUILT_MODULE),$(full_classes_jar) $(full_classes_header_jar)))
|
2017-10-10 00:46:15 +02:00
|
|
|
endif
|
2017-10-06 01:01:00 +02:00
|
|
|
|
|
|
|
java-dex : $(LOCAL_BUILT_MODULE)
|
2017-09-12 22:41:20 +02:00
|
|
|
else
|
2017-10-06 01:01:00 +02:00
|
|
|
$(eval $(call copy-one-file,$(full_classes_jar),$(LOCAL_BUILT_MODULE)))
|
2017-09-12 22:41:20 +02:00
|
|
|
endif
|
|
|
|
|
2017-09-07 22:21:51 +02:00
|
|
|
javac-check : $(full_classes_jar)
|
|
|
|
javac-check-$(LOCAL_MODULE) : $(full_classes_jar)
|
|
|
|
|
2017-09-12 22:41:20 +02:00
|
|
|
ifndef LOCAL_IS_HOST_MODULE
|
|
|
|
ifeq ($(LOCAL_SDK_VERSION),system_current)
|
|
|
|
my_link_type := java:system
|
|
|
|
my_warn_types := java:platform
|
2018-01-30 16:14:55 +01:00
|
|
|
my_allowed_types := java:sdk java:system java:core
|
2017-10-16 12:20:34 +02:00
|
|
|
else ifneq (,$(call has-system-sdk-version,$(LOCAL_SDK_VERSION)))
|
|
|
|
my_link_type := java:system
|
|
|
|
my_warn_types := java:platform
|
2018-01-30 16:14:55 +01:00
|
|
|
my_allowed_types := java:sdk java:system java:core
|
|
|
|
else ifeq ($(LOCAL_SDK_VERSION),core_current)
|
|
|
|
my_link_type := java:core
|
|
|
|
my_warn_types :=
|
|
|
|
my_allowed_types := java:core
|
2017-09-12 22:41:20 +02:00
|
|
|
else ifneq ($(LOCAL_SDK_VERSION),)
|
|
|
|
my_link_type := java:sdk
|
|
|
|
my_warn_types := java:system java:platform
|
2018-01-30 16:14:55 +01:00
|
|
|
my_allowed_types := java:sdk java:core
|
2017-09-12 22:41:20 +02:00
|
|
|
else
|
|
|
|
my_link_type := java:platform
|
|
|
|
my_warn_types :=
|
2018-01-30 16:14:55 +01:00
|
|
|
my_allowed_types := java:sdk java:system java:platform java:core
|
2017-09-12 22:41:20 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
my_link_deps :=
|
|
|
|
my_2nd_arch_prefix := $(LOCAL_2ND_ARCH_VAR_PREFIX)
|
|
|
|
my_common := COMMON
|
|
|
|
include $(BUILD_SYSTEM)/link_type.mk
|
|
|
|
endif # !LOCAL_IS_HOST_MODULE
|