am ac440901
: Merge "enable PDK to use platform JAVA API" into jb-dev
* commit 'ac44090133e4e3a674be831d28d6d8cc661d2472': enable PDK to use platform JAVA API
This commit is contained in:
@@ -815,19 +815,31 @@ systemtarball-nodeps: $(FS_GET_STATS) \
|
|||||||
.PHONY: stnod
|
.PHONY: stnod
|
||||||
stnod: systemtarball-nodeps
|
stnod: systemtarball-nodeps
|
||||||
|
|
||||||
|
# For platform-java goal, add platform as well
|
||||||
|
ifneq (,$(filter platform-java, $(MAKECMDGOALS)))
|
||||||
|
PLATFORM_ZIP_ADD_JAVA := true
|
||||||
|
endif
|
||||||
|
|
||||||
#######
|
#######
|
||||||
## platform.zip: system, plus other files to be used in PDK fusion build,
|
## platform.zip: system, plus other files to be used in PDK fusion build,
|
||||||
## in a zip file
|
## in a zip file
|
||||||
INSTALLED_PLATFROM_ZIP := $(PRODUCT_OUT)/platform.zip
|
INSTALLED_PLATFORM_ZIP := $(PRODUCT_OUT)/platform.zip
|
||||||
$(INSTALLED_PLATFROM_ZIP) : $(INTERNAL_SYSTEMIMAGE_FILES)
|
$(INSTALLED_PLATFORM_ZIP) : $(INTERNAL_SYSTEMIMAGE_FILES)
|
||||||
$(call pretty,"Platform zip package: $(INSTALLED_PLATFROM_ZIP)")
|
$(call pretty,"Platform zip package: $(INSTALLED_PLATFORM_ZIP)")
|
||||||
$(hide) rm -f $@
|
$(hide) rm -f $@
|
||||||
$(hide) cd $(dir $@) && zip -qry $(notdir $@) \
|
$(hide) cd $(dir $@) && zip -qry $(notdir $@) \
|
||||||
$(TARGET_COPY_OUT_SYSTEM) \
|
$(TARGET_COPY_OUT_SYSTEM) \
|
||||||
$(patsubst $(PRODUCT_OUT)/%, %, $(TARGET_OUT_NOTICE_FILES))
|
$(patsubst $(PRODUCT_OUT)/%, %, $(TARGET_OUT_NOTICE_FILES))
|
||||||
|
ifeq (true,$(PLATFORM_ZIP_ADD_JAVA))
|
||||||
|
$(hide) cd $(OUT_DIR) && zip -qry ../$(INSTALLED_PLATFORM_ZIP) $(PDK_PLATFORM_JAVA_ZIP_CONTENTS)
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
.PHONY: platform
|
.PHONY: platform
|
||||||
platform: $(INSTALLED_PLATFROM_ZIP)
|
platform: $(INSTALLED_PLATFORM_ZIP)
|
||||||
|
|
||||||
|
.PHONY: platform-java
|
||||||
|
platform-java: platform
|
||||||
|
|
||||||
# Dist the platform.zip
|
# Dist the platform.zip
|
||||||
ifneq (,$(filter platform, $(MAKECMDGOALS)))
|
ifneq (,$(filter platform, $(MAKECMDGOALS)))
|
||||||
|
@@ -4,10 +4,12 @@
|
|||||||
# all_res_assets
|
# all_res_assets
|
||||||
|
|
||||||
ifeq ($(TARGET_BUILD_PDK),true)
|
ifeq ($(TARGET_BUILD_PDK),true)
|
||||||
|
ifeq ($(TARGET_BUILD_PDK_JAVA),)
|
||||||
# LOCAL_SDK not defined or set to current
|
# LOCAL_SDK not defined or set to current
|
||||||
ifeq ($(filter-out current,$(LOCAL_SDK_VERSION)),)
|
ifeq ($(filter-out current,$(LOCAL_SDK_VERSION)),)
|
||||||
LOCAL_SDK_VERSION := $(PDK_BUILD_SDK_VERSION)
|
LOCAL_SDK_VERSION := $(PDK_BUILD_SDK_VERSION)
|
||||||
endif
|
endif
|
||||||
|
endif # !PDK_JAVA
|
||||||
endif #PDK
|
endif #PDK
|
||||||
|
|
||||||
|
|
||||||
|
@@ -33,6 +33,25 @@ endif
|
|||||||
endif # fusion
|
endif # fusion
|
||||||
endif # pdk or fusion
|
endif # pdk or fusion
|
||||||
|
|
||||||
|
|
||||||
|
# additional items to add to platform.zip for platform-java build
|
||||||
|
# For these dirs, add classes.jar and javalib.jar from the dir to platform.zip
|
||||||
|
# all paths under out dir
|
||||||
|
PDK_PLATFORM_JAVA_ZIP_JAVA_LIB_DIR := \
|
||||||
|
target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates \
|
||||||
|
target/common/obj/JAVA_LIBRARIES/core_intermediates \
|
||||||
|
target/common/obj/JAVA_LIBRARIES/core-junit_intermediates \
|
||||||
|
target/common/obj/JAVA_LIBRARIES/ext_intermediates \
|
||||||
|
target/common/obj/JAVA_LIBRARIES/framework_intermediates \
|
||||||
|
target/common/obj/JAVA_LIBRARIES/android.test.runner_intermediates
|
||||||
|
# not java libraries
|
||||||
|
PDK_PLATFORM_JAVA_ZIP_CONTENTS := \
|
||||||
|
target/common/obj/APPS/framework-res_intermediates/package-export.apk \
|
||||||
|
target/common/obj/APPS/framework-res_intermediates/src/R.stamp
|
||||||
|
PDK_PLATFORM_JAVA_ZIP_CONTENTS += $(foreach lib_dir,$(PDK_PLATFORM_JAVA_ZIP_JAVA_LIB_DIR),\
|
||||||
|
$(lib_dir)/classes.jar $(lib_dir)/javalib.jar)
|
||||||
|
|
||||||
|
|
||||||
ifdef PDK_FUSION_PLATFORM_ZIP
|
ifdef PDK_FUSION_PLATFORM_ZIP
|
||||||
TARGET_BUILD_PDK := true
|
TARGET_BUILD_PDK := true
|
||||||
ifeq (,$(wildcard $(PDK_FUSION_PLATFORM_ZIP)))
|
ifeq (,$(wildcard $(PDK_FUSION_PLATFORM_ZIP)))
|
||||||
@@ -42,17 +61,27 @@ endif
|
|||||||
_pdk_fusion_intermediates := $(call intermediates-dir-for, PACKAGING, pdk_fusion)
|
_pdk_fusion_intermediates := $(call intermediates-dir-for, PACKAGING, pdk_fusion)
|
||||||
_pdk_fusion_stamp := $(_pdk_fusion_intermediates)/pdk_fusion.stamp
|
_pdk_fusion_stamp := $(_pdk_fusion_intermediates)/pdk_fusion.stamp
|
||||||
|
|
||||||
|
_pdk_fusion_file_list := $(shell unzip -Z -1 $(PDK_FUSION_PLATFORM_ZIP) \
|
||||||
|
'*[^/]' -x 'target/common/*' 2>/dev/null)
|
||||||
|
_pdk_fusion_java_file_list := \
|
||||||
|
$(shell unzip -Z -1 $(PDK_FUSION_PLATFORM_ZIP) 'target/common/*' 2>/dev/null)
|
||||||
|
_pdk_fusion_files := $(addprefix $(_pdk_fusion_intermediates)/,\
|
||||||
|
$(_pdk_fusion_file_list) $(_pdk_fusion_java_file_list))
|
||||||
|
ifneq ($(_pdk_fusion_java_file_list),)
|
||||||
|
TARGET_BUILD_PDK_JAVA := true
|
||||||
|
endif
|
||||||
|
|
||||||
$(_pdk_fusion_stamp) : $(PDK_FUSION_PLATFORM_ZIP)
|
$(_pdk_fusion_stamp) : $(PDK_FUSION_PLATFORM_ZIP)
|
||||||
@echo "Unzip $(dir $@) <- $<"
|
@echo "Unzip $(dir $@) <- $<"
|
||||||
$(hide) rm -rf $(dir $@) && mkdir -p $(dir $@)
|
$(hide) rm -rf $(dir $@) && mkdir -p $(dir $@)
|
||||||
$(hide) unzip -qo $< -d $(dir $@)
|
$(hide) unzip -qo $< -d $(dir $@)
|
||||||
$(hide) touch $@
|
|
||||||
$(call split-long-arguments,touch,$(_pdk_fusion_files))
|
$(call split-long-arguments,touch,$(_pdk_fusion_files))
|
||||||
|
$(hide) touch $@
|
||||||
|
|
||||||
|
|
||||||
_pdk_fusion_file_list := $(shell unzip -Z -1 $(PDK_FUSION_PLATFORM_ZIP) '*[^/]' 2>/dev/null)
|
|
||||||
_pdk_fusion_files := $(addprefix $(_pdk_fusion_intermediates)/, $(_pdk_fusion_file_list))
|
|
||||||
$(_pdk_fusion_files) : $(_pdk_fusion_stamp)
|
$(_pdk_fusion_files) : $(_pdk_fusion_stamp)
|
||||||
|
|
||||||
|
|
||||||
# Implicit pattern rules to copy the fusion files to the system image directory.
|
# Implicit pattern rules to copy the fusion files to the system image directory.
|
||||||
# Note that if there is already explicit rule in the build system to generate a file,
|
# Note that if there is already explicit rule in the build system to generate a file,
|
||||||
# the pattern rule will be just ignored by make.
|
# the pattern rule will be just ignored by make.
|
||||||
@@ -62,14 +91,47 @@ $(PRODUCT_OUT)/% : $(_pdk_fusion_intermediates)/% $(_pdk_fusion_stamp)
|
|||||||
@mkdir -p $(dir $@)
|
@mkdir -p $(dir $@)
|
||||||
$(hide) cp -fpPR $< $@
|
$(hide) cp -fpPR $< $@
|
||||||
|
|
||||||
ALL_PDK_FUSION_FILES := $(addprefix $(PRODUCT_OUT)/, $(_pdk_fusion_file_list))
|
ifeq (true,$(TARGET_BUILD_PDK_JAVA))
|
||||||
|
|
||||||
|
define JAVA_dependency_template
|
||||||
|
$(OUT_DIR)/$(strip $(1)): $(_pdk_fusion_intermediates)/$(strip $(1)) $(OUT_DIR)/$(strip $(2)) \
|
||||||
|
$(_pdk_fusion_stamp)
|
||||||
|
@mkdir -p $$(dir $$@)
|
||||||
|
$(hide) cp -fpPR $$< $$@
|
||||||
|
endef
|
||||||
|
|
||||||
|
# needs explicit dependency as package-export.apk is not explicitly pulled
|
||||||
|
$(eval $(call JAVA_dependency_template,\
|
||||||
|
target/common/obj/APPS/framework-res_intermediates/src/R.stamp,\
|
||||||
|
target/common/obj/APPS/framework-res_intermediates/package-export.apk))
|
||||||
|
|
||||||
|
# javalib.jar should pull classes.jar as classes.jar is not explicitly pulled.
|
||||||
|
$(foreach lib_dir,$(PDK_PLATFORM_JAVA_ZIP_JAVA_LIB_DIR),\
|
||||||
|
$(eval $(call JAVA_dependency_template,$(lib_dir)/javalib.jar,\
|
||||||
|
$(lib_dir)/classes.jar)))
|
||||||
|
|
||||||
|
# implicit rules for all others
|
||||||
|
$(TARGET_COMMON_OUT_ROOT)/% : $(_pdk_fusion_intermediates)/target/common/% $(_pdk_fusion_stamp)
|
||||||
|
@mkdir -p $(dir $@)
|
||||||
|
$(hide) cp -fpPR $< $@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ALL_PDK_FUSION_FILES := $(addprefix $(PRODUCT_OUT)/, $(_pdk_fusion_file_list))
|
||||||
|
|
||||||
|
endif # PDK_FUSION_PLATFORM_ZIP
|
||||||
|
|
||||||
ifeq ($(TARGET_BUILD_PDK),true)
|
ifeq ($(TARGET_BUILD_PDK),true)
|
||||||
|
|
||||||
|
ifeq ($(TARGET_BUILD_PDK_JAVA),)
|
||||||
|
|
||||||
# SDK used for Java build under PDK
|
# SDK used for Java build under PDK
|
||||||
PDK_BUILD_SDK_VERSION := $(lastword $(TARGET_AVAILABLE_SDK_VERSIONS))
|
PDK_BUILD_SDK_VERSION := $(lastword $(TARGET_AVAILABLE_SDK_VERSIONS))
|
||||||
$(info PDK Build uses SDK $(PDK_BUILD_SDK_VERSION))
|
$(info PDK Build uses SDK $(PDK_BUILD_SDK_VERSION))
|
||||||
|
|
||||||
|
else # PDK_JAVA
|
||||||
|
|
||||||
|
$(info PDK Build uses the current platform API)
|
||||||
|
|
||||||
|
endif # PDK_JAVA
|
||||||
|
|
||||||
endif # BUILD_PDK
|
endif # BUILD_PDK
|
||||||
|
Reference in New Issue
Block a user