Merge commit 'b93e03cbc9d47a9d9a385c780ed64639e2a23ae5' into kraken * commit 'b93e03cbc9d47a9d9a385c780ed64639e2a23ae5': Cherry-pick unbundled build changes from master
This commit is contained in:
commit
f33c3ef933
6 changed files with 83 additions and 13 deletions
|
@ -235,7 +235,8 @@ endif
|
|||
###########################################################
|
||||
#TODO: pull this into java.make once host and target are combined
|
||||
|
||||
java_sources := $(addprefix $(TOP_DIR)$(LOCAL_PATH)/, $(filter %.java,$(LOCAL_SRC_FILES))) $(aidl_java_sources) $(logtags_java_sources)
|
||||
java_sources := $(addprefix $(TOP_DIR)$(LOCAL_PATH)/, $(filter %.java,$(LOCAL_SRC_FILES))) $(aidl_java_sources) $(logtags_java_sources) \
|
||||
$(filter %.java,$(LOCAL_GENERATED_SOURCES))
|
||||
all_java_sources := $(java_sources) $(addprefix $($(my_prefix)OUT_COMMON_INTERMEDIATES)/, $(filter %.java,$(LOCAL_INTERMEDIATE_SOURCES)))
|
||||
|
||||
## Java resources #########################################
|
||||
|
|
24
core/main.mk
24
core/main.mk
|
@ -691,8 +691,21 @@ droidcore: files \
|
|||
# The actual files built by the droidcore target changes depending
|
||||
# on the build variant.
|
||||
.PHONY: droid tests
|
||||
droid tests: droidcore
|
||||
ifeq ($(strip $(is_unbundled_app_build)),true)
|
||||
unbundled_build_modules :=
|
||||
ifdef UNBUNDLED_APPS
|
||||
unbundled_build_modules := $(UNBUNDLED_APPS)
|
||||
else # UNBUNDLED_APPS
|
||||
# Otherwise we build all modules in the source tree.
|
||||
unbundled_build_modules := $(sort $(call get-tagged-modules,$(ALL_MODULE_TAGS)))
|
||||
endif # UNBUNDLED_APPS
|
||||
droid: $(unbundled_build_modules)
|
||||
else # is_unbundled_app_build
|
||||
droid: droidcore
|
||||
endif # is_unbundled_app_build
|
||||
tests: droidcore
|
||||
|
||||
ifneq ($(strip $(is_unbundled_app_build)),true)
|
||||
$(call dist-for-goals, droid, \
|
||||
$(INTERNAL_UPDATE_PACKAGE_TARGET) \
|
||||
$(INTERNAL_OTA_PACKAGE_TARGET) \
|
||||
|
@ -724,6 +737,15 @@ $(call dist-for-goals, droid, \
|
|||
)
|
||||
endif
|
||||
|
||||
else # is_unbundled_app_build
|
||||
# dist the unbundled app.
|
||||
ifdef UNBUNDLED_APPS
|
||||
$(call dist-for-goals,droid, \
|
||||
$(foreach m,$(UNBUNDLED_APPS),$(ALL_MODULES.$(m).INSTALLED)) \
|
||||
)
|
||||
endif # UNBUNDLED_APPS
|
||||
endif # is_unbundled_app_build
|
||||
|
||||
.PHONY: docs
|
||||
docs: $(ALL_DOCS)
|
||||
|
||||
|
|
|
@ -304,6 +304,10 @@ PACKAGES.$(LOCAL_PACKAGE_NAME).CERTIFICATE := $(certificate)
|
|||
# Define the rule to build the actual package.
|
||||
$(LOCAL_BUILT_MODULE): $(AAPT) | $(ZIPALIGN)
|
||||
$(LOCAL_BUILT_MODULE): PRIVATE_JNI_SHARED_LIBRARIES := $(jni_shared_libraries)
|
||||
ifeq ($(strip $(is_unbundled_app_build)),true)
|
||||
# Include all resources for unbundled apps.
|
||||
$(LOCAL_BUILT_MODULE): PRODUCT_AAPT_CONFIG :=
|
||||
endif
|
||||
$(LOCAL_BUILT_MODULE): $(all_res_assets) $(jni_shared_libraries) $(full_android_manifest)
|
||||
@echo "target Package: $(PRIVATE_MODULE) ($@)"
|
||||
$(create-empty-package)
|
||||
|
|
|
@ -29,13 +29,13 @@ $(shell test -d device && find device -maxdepth 6 -name AndroidProducts.mk) \
|
|||
endef
|
||||
|
||||
#
|
||||
# Returns the sorted concatenation of all PRODUCT_MAKEFILES
|
||||
# variables set in all AndroidProducts.mk files.
|
||||
# $(call ) isn't necessary.
|
||||
# Returns the sorted concatenation of PRODUCT_MAKEFILES
|
||||
# variables set in the given AndroidProducts.mk files.
|
||||
# $(1): the list of AndroidProducts.mk files.
|
||||
#
|
||||
define get-all-product-makefiles
|
||||
define get-product-makefiles
|
||||
$(sort \
|
||||
$(foreach f,$(_find-android-products-files), \
|
||||
$(foreach f,$(1), \
|
||||
$(eval PRODUCT_MAKEFILES :=) \
|
||||
$(eval LOCAL_DIR := $(patsubst %/,%,$(dir $(f)))) \
|
||||
$(eval include $(f)) \
|
||||
|
@ -46,6 +46,15 @@ $(sort \
|
|||
)
|
||||
endef
|
||||
|
||||
#
|
||||
# Returns the sorted concatenation of all PRODUCT_MAKEFILES
|
||||
# variables set in all AndroidProducts.mk files.
|
||||
# $(call ) isn't necessary.
|
||||
#
|
||||
define get-all-product-makefiles
|
||||
$(call get-product-makefiles,$(_find-android-products-files))
|
||||
endef
|
||||
|
||||
#
|
||||
# Functions for including product makefiles
|
||||
#
|
||||
|
|
|
@ -148,6 +148,27 @@ $(goal_name): $(MAKECMDGOALS)
|
|||
endif
|
||||
# else: Use the value set in the environment or buildspec.mk.
|
||||
|
||||
# ---------------------------------------------------------------
|
||||
# Provide "APP-<appname>" targets, which lets you build
|
||||
# an unbundled app.
|
||||
#
|
||||
unbundled_goals := $(strip $(filter APP-%,$(MAKECMDGOALS)))
|
||||
ifdef unbundled_goals
|
||||
ifneq ($(words $(unbundled_goals)),1)
|
||||
$(error Only one APP-* goal may be specified; saw "$(unbundled_goals)"))
|
||||
endif
|
||||
UNBUNDLED_APPS := $(strip $(subst -, ,$(patsubst APP-%,%,$(unbundled_goals))))
|
||||
ifneq ($(filter $(DEFAULT_GOAL),$(MAKECMDGOALS)),)
|
||||
MAKECMDGOALS := $(patsubst $(unbundled_goals),,$(MAKECMDGOALS))
|
||||
else
|
||||
MAKECMDGOALS := $(patsubst $(unbundled_goals),$(DEFAULT_GOAL),$(MAKECMDGOALS))
|
||||
endif
|
||||
is_unbundled_app_build := true
|
||||
|
||||
.PHONY: $(unbundled_goals)
|
||||
$(unbundled_goals): $(MAKECMDGOALS)
|
||||
endif # unbundled_goals
|
||||
|
||||
# ---------------------------------------------------------------
|
||||
# Include the product definitions.
|
||||
# We need to do this to translate TARGET_PRODUCT into its
|
||||
|
@ -157,12 +178,18 @@ include $(BUILD_SYSTEM)/node_fns.mk
|
|||
include $(BUILD_SYSTEM)/product.mk
|
||||
include $(BUILD_SYSTEM)/device.mk
|
||||
|
||||
ifeq ($(strip $(is_unbundled_app_build)),true)
|
||||
# An unbundled app build needs only the core product makefiles.
|
||||
$(call import-products,$(call get-product-makefiles,\
|
||||
$(SRC_TARGET_DIR)/product/AndroidProducts.mk))
|
||||
else
|
||||
# Read in all of the product definitions specified by the AndroidProducts.mk
|
||||
# files in the tree.
|
||||
#
|
||||
#TODO: when we start allowing direct pointers to product files,
|
||||
# guarantee that they're in this list.
|
||||
$(call import-products, $(get-all-product-makefiles))
|
||||
endif # is_unbundled_app_build
|
||||
$(check-all-products)
|
||||
#$(dump-products)
|
||||
#$(error done)
|
||||
|
|
|
@ -25,6 +25,12 @@
|
|||
# it includes.
|
||||
#
|
||||
|
||||
ifeq ($(strip $(is_unbundled_app_build)),true)
|
||||
# An unbundled app build needs only generic.mk.
|
||||
PRODUCT_MAKEFILES := \
|
||||
$(LOCAL_DIR)/core.mk \
|
||||
$(LOCAL_DIR)/generic.mk
|
||||
else
|
||||
PRODUCT_MAKEFILES := \
|
||||
$(LOCAL_DIR)/core.mk \
|
||||
$(LOCAL_DIR)/generic.mk \
|
||||
|
@ -32,3 +38,4 @@ PRODUCT_MAKEFILES := \
|
|||
$(LOCAL_DIR)/full.mk \
|
||||
$(LOCAL_DIR)/sdk.mk \
|
||||
$(LOCAL_DIR)/sim.mk
|
||||
endif
|
||||
|
|
Loading…
Reference in a new issue