Ying Wang | 82b836f | 2012-03-30 18:08:07 -0700 | [diff] [blame] | 1 | # This file defines the rule to fuse the platform.zip into the current PDK build. |
Colin Cross | c451a37 | 2013-12-18 19:36:44 -0800 | [diff] [blame] | 2 | PDK_PLATFORM_JAVA_ZIP_JAVA_TARGET_LIB_DIR := |
| 3 | PDK_PLATFORM_JAVA_ZIP_JAVA_HOST_LIB_DIR := \ |
Guang Zhu | 73c10be | 2017-08-24 16:10:44 -0700 | [diff] [blame] | 4 | host/common/obj/JAVA_LIBRARIES/bouncycastle-host_intermediates \ |
| 5 | host/common/obj/JAVA_LIBRARIES/compatibility-host-util_intermediates \ |
| 6 | host/common/obj/JAVA_LIBRARIES/cts-tradefed-harness_intermediates \ |
| 7 | host/common/obj/JAVA_LIBRARIES/hosttestlib_intermediates |
Colin Cross | c451a37 | 2013-12-18 19:36:44 -0800 | [diff] [blame] | 8 | PDK_PLATFORM_JAVA_ZIP_CONTENTS := |
| 9 | |
Keun young Park | f4d1438 | 2012-06-18 12:46:46 -0700 | [diff] [blame] | 10 | ifneq (,$(filter platform-java, $(MAKECMDGOALS))$(PDK_FUSION_PLATFORM_ZIP)) |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 11 | # additional items to add to platform.zip for platform-java build |
| 12 | # For these dirs, add classes.jar and javalib.jar from the dir to platform.zip |
| 13 | # all paths under out dir |
Colin Cross | c451a37 | 2013-12-18 19:36:44 -0800 | [diff] [blame] | 14 | PDK_PLATFORM_JAVA_ZIP_JAVA_TARGET_LIB_DIR += \ |
Nicholas Sauer | 1b2637e | 2015-03-27 09:26:27 -0700 | [diff] [blame] | 15 | target/common/obj/JAVA_LIBRARIES/android.test.runner_intermediates \ |
Steven Moreland | 58dbc79 | 2017-11-01 16:27:01 -0700 | [diff] [blame] | 16 | target/common/obj/JAVA_LIBRARIES/android.hidl.base-V1.0-java_intermediates \ |
| 17 | target/common/obj/JAVA_LIBRARIES/android.hidl.base-V1.0-java-static_intermediates \ |
| 18 | target/common/obj/JAVA_LIBRARIES/android.hidl.manager-V1.0-java_intermediates \ |
Nicholas Sauer | 1b2637e | 2015-03-27 09:26:27 -0700 | [diff] [blame] | 19 | target/common/obj/JAVA_LIBRARIES/android-common_intermediates \ |
| 20 | target/common/obj/JAVA_LIBRARIES/android-ex-camera2_intermediates \ |
| 21 | target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates \ |
| 22 | target/common/obj/JAVA_LIBRARIES/bouncycastle_intermediates \ |
| 23 | target/common/obj/JAVA_LIBRARIES/conscrypt_intermediates \ |
Piotr Jastrzebski | 89b94c8 | 2015-02-17 16:55:52 +0000 | [diff] [blame] | 24 | target/common/obj/JAVA_LIBRARIES/core-oj_intermediates \ |
Nicholas Sauer | 1b2637e | 2015-03-27 09:26:27 -0700 | [diff] [blame] | 25 | target/common/obj/JAVA_LIBRARIES/core-libart_intermediates \ |
Paul Duffin | 6470f4f | 2016-11-29 12:15:13 +0000 | [diff] [blame] | 26 | target/common/obj/JAVA_LIBRARIES/legacy-test_intermediates \ |
Keun-young Park | 37ae422 | 2017-07-27 14:11:49 -0700 | [diff] [blame] | 27 | target/common/obj/JAVA_LIBRARIES/legacy-android-test_intermediates \ |
Nicholas Sauer | 1b2637e | 2015-03-27 09:26:27 -0700 | [diff] [blame] | 28 | target/common/obj/JAVA_LIBRARIES/ext_intermediates \ |
| 29 | target/common/obj/JAVA_LIBRARIES/framework_intermediates \ |
Steven Moreland | 266632f | 2017-10-30 15:43:58 -0700 | [diff] [blame] | 30 | target/common/obj/JAVA_LIBRARIES/hwbinder_intermediates \ |
Nicholas Sauer | 1b2637e | 2015-03-27 09:26:27 -0700 | [diff] [blame] | 31 | target/common/obj/JAVA_LIBRARIES/ims-common_intermediates \ |
| 32 | target/common/obj/JAVA_LIBRARIES/okhttp_intermediates \ |
| 33 | target/common/obj/JAVA_LIBRARIES/telephony-common_intermediates \ |
| 34 | target/common/obj/JAVA_LIBRARIES/voip-common_intermediates \ |
Colin Cross | 4b76499 | 2014-01-29 10:01:37 -0800 | [diff] [blame] | 35 | |
Colin Cross | c451a37 | 2013-12-18 19:36:44 -0800 | [diff] [blame] | 36 | # not java libraries |
| 37 | PDK_PLATFORM_JAVA_ZIP_CONTENTS += \ |
| 38 | target/common/obj/APPS/framework-res_intermediates/package-export.apk \ |
| 39 | target/common/obj/APPS/framework-res_intermediates/src/R.stamp |
| 40 | endif # platform-java or FUSION build |
| 41 | |
Colin Cross | 074d838 | 2013-12-17 12:06:59 -0800 | [diff] [blame] | 42 | PDK_PLATFORM_JAVA_ZIP_JAVA_LIB_DIR := \ |
| 43 | $(PDK_PLATFORM_JAVA_ZIP_JAVA_TARGET_LIB_DIR) \ |
| 44 | $(PDK_PLATFORM_JAVA_ZIP_JAVA_HOST_LIB_DIR) |
Colin Cross | c451a37 | 2013-12-18 19:36:44 -0800 | [diff] [blame] | 45 | |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 46 | PDK_PLATFORM_JAVA_ZIP_CONTENTS += $(foreach lib_dir,$(PDK_PLATFORM_JAVA_ZIP_JAVA_LIB_DIR),\ |
Colin Cross | e673deb | 2017-09-27 14:28:41 -0700 | [diff] [blame] | 47 | $(lib_dir)/classes.jar $(lib_dir)/classes.jar.toc \ |
Keun-young Park | c8d7349 | 2016-01-26 19:22:37 -0800 | [diff] [blame] | 48 | $(lib_dir)/javalib.jar $(lib_dir)/classes*.dex \ |
| 49 | $(lib_dir)/classes.dex.toc ) |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 50 | |
Keun young Park | efe02ce | 2012-06-06 17:19:29 -0700 | [diff] [blame] | 51 | # check and override java support level |
Keun young Park | f4d1438 | 2012-06-18 12:46:46 -0700 | [diff] [blame] | 52 | ifneq ($(TARGET_BUILD_PDK)$(PDK_FUSION_PLATFORM_ZIP),) |
Keun young Park | efe02ce | 2012-06-06 17:19:29 -0700 | [diff] [blame] | 53 | ifneq ($(wildcard external/proguard),) |
| 54 | TARGET_BUILD_JAVA_SUPPORT_LEVEL := sdk |
| 55 | else # no proguard |
| 56 | TARGET_BUILD_JAVA_SUPPORT_LEVEL := |
| 57 | endif |
| 58 | # platform supprot is set after checking platform.zip |
| 59 | endif # PDK |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 60 | |
Ying Wang | 82b836f | 2012-03-30 18:08:07 -0700 | [diff] [blame] | 61 | ifdef PDK_FUSION_PLATFORM_ZIP |
Ying Wang | 82b836f | 2012-03-30 18:08:07 -0700 | [diff] [blame] | 62 | _pdk_fusion_intermediates := $(call intermediates-dir-for, PACKAGING, pdk_fusion) |
| 63 | _pdk_fusion_stamp := $(_pdk_fusion_intermediates)/pdk_fusion.stamp |
| 64 | |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 65 | _pdk_fusion_file_list := $(shell unzip -Z -1 $(PDK_FUSION_PLATFORM_ZIP) \ |
| 66 | '*[^/]' -x 'target/common/*' 2>/dev/null) |
| 67 | _pdk_fusion_java_file_list := \ |
| 68 | $(shell unzip -Z -1 $(PDK_FUSION_PLATFORM_ZIP) 'target/common/*' 2>/dev/null) |
| 69 | _pdk_fusion_files := $(addprefix $(_pdk_fusion_intermediates)/,\ |
| 70 | $(_pdk_fusion_file_list) $(_pdk_fusion_java_file_list)) |
Keun young Park | efe02ce | 2012-06-06 17:19:29 -0700 | [diff] [blame] | 71 | |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 72 | ifneq ($(_pdk_fusion_java_file_list),) |
Keun young Park | efe02ce | 2012-06-06 17:19:29 -0700 | [diff] [blame] | 73 | # This represents whether java build can use platform API or not |
| 74 | # This should not be used in Android.mk |
| 75 | TARGET_BUILD_PDK_JAVA_PLATFORM := true |
| 76 | ifneq ($(TARGET_BUILD_JAVA_SUPPORT_LEVEL),) |
| 77 | TARGET_BUILD_JAVA_SUPPORT_LEVEL := platform |
| 78 | endif |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 79 | endif |
| 80 | |
Ying Wang | 82b836f | 2012-03-30 18:08:07 -0700 | [diff] [blame] | 81 | $(_pdk_fusion_stamp) : $(PDK_FUSION_PLATFORM_ZIP) |
| 82 | @echo "Unzip $(dir $@) <- $<" |
| 83 | $(hide) rm -rf $(dir $@) && mkdir -p $(dir $@) |
| 84 | $(hide) unzip -qo $< -d $(dir $@) |
Keun young Park | d8de82f | 2012-05-25 10:52:44 -0700 | [diff] [blame] | 85 | $(call split-long-arguments,-touch,$(_pdk_fusion_files)) |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 86 | $(hide) touch $@ |
Ying Wang | 82b836f | 2012-03-30 18:08:07 -0700 | [diff] [blame] | 87 | |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 88 | |
Ying Wang | 82b836f | 2012-03-30 18:08:07 -0700 | [diff] [blame] | 89 | $(_pdk_fusion_files) : $(_pdk_fusion_stamp) |
| 90 | |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 91 | |
Ying Wang | 82b836f | 2012-03-30 18:08:07 -0700 | [diff] [blame] | 92 | # Implicit pattern rules to copy the fusion files to the system image directory. |
| 93 | # Note that if there is already explicit rule in the build system to generate a file, |
| 94 | # the pattern rule will be just ignored by make. |
| 95 | # That's desired by us: we want only absent files from the platform zip package. |
| 96 | # Copy with the last-modified time preserved, never follow symbolic links. |
Colin Cross | 2bea2e6 | 2012-04-23 18:49:04 -0700 | [diff] [blame] | 97 | $(PRODUCT_OUT)/% : $(_pdk_fusion_intermediates)/% $(_pdk_fusion_stamp) |
Ying Wang | 82b836f | 2012-03-30 18:08:07 -0700 | [diff] [blame] | 98 | @mkdir -p $(dir $@) |
Sungmin Choi | 79d5109 | 2013-02-04 00:54:03 +0900 | [diff] [blame] | 99 | $(hide) rm -rf $@ |
Ying Wang | 82b836f | 2012-03-30 18:08:07 -0700 | [diff] [blame] | 100 | $(hide) cp -fpPR $< $@ |
| 101 | |
Colin Cross | c451a37 | 2013-12-18 19:36:44 -0800 | [diff] [blame] | 102 | # implicit rules for host java files |
| 103 | $(HOST_COMMON_OUT_ROOT)/% : $(_pdk_fusion_intermediates)/host/common/% $(_pdk_fusion_stamp) |
| 104 | @mkdir -p $(dir $@) |
| 105 | $(hide) cp -fpPR $< $@ |
| 106 | |
Keun young Park | efe02ce | 2012-06-06 17:19:29 -0700 | [diff] [blame] | 107 | ifeq (true,$(TARGET_BUILD_PDK_JAVA_PLATFORM)) |
Ying Wang | 82b836f | 2012-03-30 18:08:07 -0700 | [diff] [blame] | 108 | |
keunyoung | a219bdc | 2013-07-25 18:20:09 -0700 | [diff] [blame] | 109 | PDK_FUSION_OUT_DIR := $(OUT_DIR) |
keunyoung | a219bdc | 2013-07-25 18:20:09 -0700 | [diff] [blame] | 110 | |
| 111 | define JAVA_dependency_template |
Yohann Roussel | 00221d4 | 2016-01-29 13:06:11 +0100 | [diff] [blame] | 112 | $(call add-dependency,$(PDK_FUSION_OUT_DIR)/$(strip $(1)),\ |
| 113 | $(foreach d,$(filter $(2),$(_pdk_fusion_java_file_list)),$(PDK_FUSION_OUT_DIR)/$(d))) |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 114 | endef |
| 115 | |
| 116 | # needs explicit dependency as package-export.apk is not explicitly pulled |
| 117 | $(eval $(call JAVA_dependency_template,\ |
| 118 | target/common/obj/APPS/framework-res_intermediates/src/R.stamp,\ |
| 119 | target/common/obj/APPS/framework-res_intermediates/package-export.apk)) |
| 120 | |
| 121 | # javalib.jar should pull classes.jar as classes.jar is not explicitly pulled. |
Colin Cross | 074d838 | 2013-12-17 12:06:59 -0800 | [diff] [blame] | 122 | $(foreach lib_dir,$(PDK_PLATFORM_JAVA_ZIP_JAVA_TARGET_LIB_DIR),\ |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 123 | $(eval $(call JAVA_dependency_template,$(lib_dir)/javalib.jar,\ |
| 124 | $(lib_dir)/classes.jar))) |
| 125 | |
Colin Cross | 074d838 | 2013-12-17 12:06:59 -0800 | [diff] [blame] | 126 | # implicit rules for all other target files |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 127 | $(TARGET_COMMON_OUT_ROOT)/% : $(_pdk_fusion_intermediates)/target/common/% $(_pdk_fusion_stamp) |
| 128 | @mkdir -p $(dir $@) |
| 129 | $(hide) cp -fpPR $< $@ |
Ying Wang | 82b836f | 2012-03-30 18:08:07 -0700 | [diff] [blame] | 130 | endif |
Keun young Park | ebb351e | 2012-04-19 15:36:18 -0700 | [diff] [blame] | 131 | |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 132 | ALL_PDK_FUSION_FILES := $(addprefix $(PRODUCT_OUT)/, $(_pdk_fusion_file_list)) |
| 133 | |
| 134 | endif # PDK_FUSION_PLATFORM_ZIP |
| 135 | |
Keun young Park | ebb351e | 2012-04-19 15:36:18 -0700 | [diff] [blame] | 136 | ifeq ($(TARGET_BUILD_PDK),true) |
Keun young Park | f4d1438 | 2012-06-18 12:46:46 -0700 | [diff] [blame] | 137 | $(info PDK TARGET_BUILD_JAVA_SUPPORT_LEVEL $(TARGET_BUILD_JAVA_SUPPORT_LEVEL)) |
Keun young Park | efe02ce | 2012-06-06 17:19:29 -0700 | [diff] [blame] | 138 | ifeq ($(TARGET_BUILD_PDK_JAVA_PLATFORM),) |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 139 | |
Keun young Park | ebb351e | 2012-04-19 15:36:18 -0700 | [diff] [blame] | 140 | # SDK used for Java build under PDK |
| 141 | PDK_BUILD_SDK_VERSION := $(lastword $(TARGET_AVAILABLE_SDK_VERSIONS)) |
| 142 | $(info PDK Build uses SDK $(PDK_BUILD_SDK_VERSION)) |
| 143 | |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 144 | else # PDK_JAVA |
| 145 | |
| 146 | $(info PDK Build uses the current platform API) |
| 147 | |
| 148 | endif # PDK_JAVA |
| 149 | |
Keun young Park | ebb351e | 2012-04-19 15:36:18 -0700 | [diff] [blame] | 150 | endif # BUILD_PDK |
Keun young Park | 7222669 | 2012-07-31 17:13:20 -0700 | [diff] [blame] | 151 | |
| 152 | ifneq (,$(filter platform platform-java, $(MAKECMDGOALS))$(filter true,$(TARGET_BUILD_PDK))) |
| 153 | # files under $(PRODUCT_OUT)/symbols to help debugging. |
| 154 | # Source not included to PDK due to dependency issue, so provide symbols instead. |
Ying Wang | 788c778 | 2014-05-15 10:54:32 -0700 | [diff] [blame] | 155 | |
Ying Wang | 00b8341 | 2014-05-15 16:13:15 -0700 | [diff] [blame] | 156 | # We may not be building all of them. |
| 157 | # The platform.zip just silently ignores the nonexistent ones. |
Keun young Park | 7222669 | 2012-07-31 17:13:20 -0700 | [diff] [blame] | 158 | PDK_SYMBOL_FILES_LIST := \ |
Ying Wang | 00b8341 | 2014-05-15 16:13:15 -0700 | [diff] [blame] | 159 | system/bin/app_process32 \ |
| 160 | system/bin/app_process64 |
Keun young Park | 7222669 | 2012-07-31 17:13:20 -0700 | [diff] [blame] | 161 | |
| 162 | ifdef PDK_FUSION_PLATFORM_ZIP |
| 163 | # symbols should be explicitly pulled for fusion build |
Ying Wang | 00b8341 | 2014-05-15 16:13:15 -0700 | [diff] [blame] | 164 | $(foreach f,$(filter $(PDK_SYMBOL_FILES_LIST), $(_pdk_fusion_file_list)),\ |
Keun young Park | 7222669 | 2012-07-31 17:13:20 -0700 | [diff] [blame] | 165 | $(eval $(call add-dependency,$(PRODUCT_OUT)/$(f),$(PRODUCT_OUT)/symbols/$(f)))) |
| 166 | endif # PLATFORM_ZIP |
| 167 | endif # platform.zip build or PDK |