forked from openkylin/platform_build
am 2b8d2383: Merge changes I02214abd,I79e6f60e into froyo
Merge commit '2b8d2383043a2b16e53538f9ebf123bfffd27ba1' into froyo-plus-aosp * commit '2b8d2383043a2b16e53538f9ebf123bfffd27ba1': Add a tapas command. Rename is_unbundled_app_build and UNBUNDLED_APP_BUILD to TARGET_BUILD_APPS.
This commit is contained in:
commit
8aeb7cc461
|
@ -342,6 +342,7 @@ $(info TARGET_PRODUCT=$(TARGET_PRODUCT))
|
||||||
$(info TARGET_BUILD_VARIANT=$(TARGET_BUILD_VARIANT))
|
$(info TARGET_BUILD_VARIANT=$(TARGET_BUILD_VARIANT))
|
||||||
$(info TARGET_SIMULATOR=$(TARGET_SIMULATOR))
|
$(info TARGET_SIMULATOR=$(TARGET_SIMULATOR))
|
||||||
$(info TARGET_BUILD_TYPE=$(TARGET_BUILD_TYPE))
|
$(info TARGET_BUILD_TYPE=$(TARGET_BUILD_TYPE))
|
||||||
|
$(info TARGET_BUILD_APPS=$(TARGET_BUILD_APPS))
|
||||||
$(info TARGET_ARCH=$(TARGET_ARCH))
|
$(info TARGET_ARCH=$(TARGET_ARCH))
|
||||||
$(info HOST_ARCH=$(HOST_ARCH))
|
$(info HOST_ARCH=$(HOST_ARCH))
|
||||||
$(info HOST_OS=$(HOST_OS))
|
$(info HOST_OS=$(HOST_OS))
|
||||||
|
|
100
core/main.mk
100
core/main.mk
|
@ -46,6 +46,7 @@ TOPDIR :=
|
||||||
BUILD_SYSTEM := $(TOPDIR)build/core
|
BUILD_SYSTEM := $(TOPDIR)build/core
|
||||||
|
|
||||||
# This is the default target. It must be the first declared target.
|
# This is the default target. It must be the first declared target.
|
||||||
|
.PHONY: droid
|
||||||
DEFAULT_GOAL := droid
|
DEFAULT_GOAL := droid
|
||||||
$(DEFAULT_GOAL):
|
$(DEFAULT_GOAL):
|
||||||
|
|
||||||
|
@ -684,56 +685,60 @@ droidcore: files \
|
||||||
$(INSTALLED_USERDATAIMAGE_TARGET) \
|
$(INSTALLED_USERDATAIMAGE_TARGET) \
|
||||||
$(INSTALLED_FILES_FILE)
|
$(INSTALLED_FILES_FILE)
|
||||||
|
|
||||||
# The actual files built by the droidcore target changes depending
|
ifneq ($(TARGET_BUILD_APPS),)
|
||||||
# on the build variant.
|
# If this build is just for apps, only build apps and not the full system by default.
|
||||||
.PHONY: droid tests
|
|
||||||
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)
|
unbundled_build_modules :=
|
||||||
$(call dist-for-goals, droid, \
|
ifneq ($(filter all,$(TARGET_BUILD_APPS)),)
|
||||||
$(INTERNAL_UPDATE_PACKAGE_TARGET) \
|
# If they used the magic goal "all" then build everything
|
||||||
$(INTERNAL_OTA_PACKAGE_TARGET) \
|
unbundled_build_modules := $(sort $(call get-tagged-modules,$(ALL_MODULE_TAGS)))
|
||||||
$(SYMBOLS_ZIP) \
|
else
|
||||||
$(APPS_ZIP) \
|
unbundled_build_modules := $(TARGET_BUILD_APPS)
|
||||||
$(INTERNAL_EMULATOR_PACKAGE_TARGET) \
|
endif
|
||||||
$(PACKAGE_STATS_FILE) \
|
|
||||||
$(INSTALLED_FILES_FILE) \
|
|
||||||
$(INSTALLED_BUILD_PROP_TARGET) \
|
|
||||||
$(BUILT_TARGET_FILES_PACKAGE) \
|
|
||||||
$(INSTALLED_ANDROID_INFO_TXT_TARGET) \
|
|
||||||
)
|
|
||||||
|
|
||||||
# Tests are installed in userdata.img. If we're building the tests
|
# dist the unbundled app.
|
||||||
# variant, copy it for "make tests dist". Also copy a zip of the
|
$(call dist-for-goals,apps_only, \
|
||||||
# contents of userdata.img, so that people can easily extract a
|
$(foreach m,$(unbundled_build_modules),$(ALL_MODULES.$(m).INSTALLED)) \
|
||||||
# single .apk.
|
|
||||||
ifeq ($(TARGET_BUILD_VARIANT),tests)
|
|
||||||
$(call dist-for-goals, droid, \
|
|
||||||
$(INSTALLED_USERDATAIMAGE_TARGET) \
|
|
||||||
$(BUILT_TESTS_ZIP_PACKAGE) \
|
|
||||||
)
|
|
||||||
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: apps_only
|
||||||
|
apps_only: $(unbundled_build_modules)
|
||||||
|
|
||||||
|
droid: apps_only
|
||||||
|
|
||||||
|
else # TARGET_BUILD_APPS
|
||||||
|
$(call dist-for-goals, droidcore, \
|
||||||
|
$(INTERNAL_UPDATE_PACKAGE_TARGET) \
|
||||||
|
$(INTERNAL_OTA_PACKAGE_TARGET) \
|
||||||
|
$(SYMBOLS_ZIP) \
|
||||||
|
$(APPS_ZIP) \
|
||||||
|
$(INTERNAL_EMULATOR_PACKAGE_TARGET) \
|
||||||
|
$(PACKAGE_STATS_FILE) \
|
||||||
|
$(INSTALLED_FILES_FILE) \
|
||||||
|
$(INSTALLED_BUILD_PROP_TARGET) \
|
||||||
|
$(BUILT_TARGET_FILES_PACKAGE) \
|
||||||
|
$(INSTALLED_ANDROID_INFO_TXT_TARGET) \
|
||||||
|
)
|
||||||
|
|
||||||
|
# Tests are installed in userdata.img. If we're building the tests
|
||||||
|
# variant, copy it for "make tests dist". Also copy a zip of the
|
||||||
|
# contents of userdata.img, so that people can easily extract a
|
||||||
|
# single .apk.
|
||||||
|
ifeq ($(TARGET_BUILD_VARIANT),tests)
|
||||||
|
$(call dist-for-goals, droid, \
|
||||||
|
$(INSTALLED_USERDATAIMAGE_TARGET) \
|
||||||
|
$(BUILT_TESTS_ZIP_PACKAGE) \
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Building a full system-- the default is to build droidcore
|
||||||
|
droid: droidcore
|
||||||
|
|
||||||
|
endif # TARGET_BUILD_APPS
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: droid tests
|
||||||
|
tests: droidcore
|
||||||
|
|
||||||
.PHONY: docs
|
.PHONY: docs
|
||||||
docs: $(ALL_DOCS)
|
docs: $(ALL_DOCS)
|
||||||
|
@ -779,3 +784,4 @@ modules:
|
||||||
.PHONY: showcommands
|
.PHONY: showcommands
|
||||||
showcommands:
|
showcommands:
|
||||||
@echo >/dev/null
|
@echo >/dev/null
|
||||||
|
|
||||||
|
|
|
@ -311,7 +311,7 @@ PACKAGES.$(LOCAL_PACKAGE_NAME).CERTIFICATE := $(certificate)
|
||||||
# Define the rule to build the actual package.
|
# Define the rule to build the actual package.
|
||||||
$(LOCAL_BUILT_MODULE): $(AAPT) | $(ZIPALIGN)
|
$(LOCAL_BUILT_MODULE): $(AAPT) | $(ZIPALIGN)
|
||||||
$(LOCAL_BUILT_MODULE): PRIVATE_JNI_SHARED_LIBRARIES := $(jni_shared_libraries)
|
$(LOCAL_BUILT_MODULE): PRIVATE_JNI_SHARED_LIBRARIES := $(jni_shared_libraries)
|
||||||
ifeq ($(strip $(is_unbundled_app_build)),true)
|
ifneq ($(TARGET_BUILD_APPS),)
|
||||||
# Include all resources for unbundled apps.
|
# Include all resources for unbundled apps.
|
||||||
$(LOCAL_BUILT_MODULE): PRODUCT_AAPT_CONFIG :=
|
$(LOCAL_BUILT_MODULE): PRODUCT_AAPT_CONFIG :=
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -157,13 +157,12 @@ ifdef unbundled_goals
|
||||||
ifneq ($(words $(unbundled_goals)),1)
|
ifneq ($(words $(unbundled_goals)),1)
|
||||||
$(error Only one APP-* goal may be specified; saw "$(unbundled_goals)"))
|
$(error Only one APP-* goal may be specified; saw "$(unbundled_goals)"))
|
||||||
endif
|
endif
|
||||||
UNBUNDLED_APPS := $(strip $(subst -, ,$(patsubst APP-%,%,$(unbundled_goals))))
|
TARGET_BUILD_APPS := $(strip $(subst -, ,$(patsubst APP-%,%,$(unbundled_goals))))
|
||||||
ifneq ($(filter $(DEFAULT_GOAL),$(MAKECMDGOALS)),)
|
ifneq ($(filter $(DEFAULT_GOAL),$(MAKECMDGOALS)),)
|
||||||
MAKECMDGOALS := $(patsubst $(unbundled_goals),,$(MAKECMDGOALS))
|
MAKECMDGOALS := $(patsubst $(unbundled_goals),,$(MAKECMDGOALS))
|
||||||
else
|
else
|
||||||
MAKECMDGOALS := $(patsubst $(unbundled_goals),$(DEFAULT_GOAL),$(MAKECMDGOALS))
|
MAKECMDGOALS := $(patsubst $(unbundled_goals),$(DEFAULT_GOAL),$(MAKECMDGOALS))
|
||||||
endif
|
endif
|
||||||
is_unbundled_app_build := true
|
|
||||||
|
|
||||||
.PHONY: $(unbundled_goals)
|
.PHONY: $(unbundled_goals)
|
||||||
$(unbundled_goals): $(MAKECMDGOALS)
|
$(unbundled_goals): $(MAKECMDGOALS)
|
||||||
|
@ -178,7 +177,7 @@ include $(BUILD_SYSTEM)/node_fns.mk
|
||||||
include $(BUILD_SYSTEM)/product.mk
|
include $(BUILD_SYSTEM)/product.mk
|
||||||
include $(BUILD_SYSTEM)/device.mk
|
include $(BUILD_SYSTEM)/device.mk
|
||||||
|
|
||||||
ifeq ($(strip $(is_unbundled_app_build)),true)
|
ifneq ($(strip $(TARGET_BUILD_APPS)),)
|
||||||
# An unbundled app build needs only the core product makefiles.
|
# An unbundled app build needs only the core product makefiles.
|
||||||
$(call import-products,$(call get-product-makefiles,\
|
$(call import-products,$(call get-product-makefiles,\
|
||||||
$(SRC_TARGET_DIR)/product/AndroidProducts.mk))
|
$(SRC_TARGET_DIR)/product/AndroidProducts.mk))
|
||||||
|
@ -189,7 +188,7 @@ else
|
||||||
#TODO: when we start allowing direct pointers to product files,
|
#TODO: when we start allowing direct pointers to product files,
|
||||||
# guarantee that they're in this list.
|
# guarantee that they're in this list.
|
||||||
$(call import-products, $(get-all-product-makefiles))
|
$(call import-products, $(get-all-product-makefiles))
|
||||||
endif # is_unbundled_app_build
|
endif # TARGET_BUILD_APPS
|
||||||
$(check-all-products)
|
$(check-all-products)
|
||||||
#$(dump-products)
|
#$(dump-products)
|
||||||
#$(error done)
|
#$(error done)
|
||||||
|
|
45
envsetup.sh
45
envsetup.sh
|
@ -56,6 +56,7 @@ function check_product()
|
||||||
CALLED_FROM_SETUP=true BUILD_SYSTEM=build/core \
|
CALLED_FROM_SETUP=true BUILD_SYSTEM=build/core \
|
||||||
TARGET_PRODUCT=$1 TARGET_BUILD_VARIANT= \
|
TARGET_PRODUCT=$1 TARGET_BUILD_VARIANT= \
|
||||||
TARGET_SIMULATOR= TARGET_BUILD_TYPE= \
|
TARGET_SIMULATOR= TARGET_BUILD_TYPE= \
|
||||||
|
TARGET_BUILD_APPS= \
|
||||||
get_build_var TARGET_DEVICE > /dev/null
|
get_build_var TARGET_DEVICE > /dev/null
|
||||||
# hide successful answers, but allow the errors to show
|
# hide successful answers, but allow the errors to show
|
||||||
}
|
}
|
||||||
|
@ -150,9 +151,14 @@ function set_sequence_number()
|
||||||
function settitle()
|
function settitle()
|
||||||
{
|
{
|
||||||
if [ "$STAY_OFF_MY_LAWN" = "" ]; then
|
if [ "$STAY_OFF_MY_LAWN" = "" ]; then
|
||||||
local product=$(get_build_var TARGET_PRODUCT)
|
local product=$TARGET_PRODUCT
|
||||||
local variant=$(get_build_var TARGET_BUILD_VARIANT)
|
local variant=$TARGET_BUILD_VARIANT
|
||||||
export PROMPT_COMMAND="echo -ne \"\033]0;[${product}-${variant}] ${USER}@${HOSTNAME}: ${PWD}\007\""
|
local apps=$TARGET_BUILD_APPS
|
||||||
|
if [ -z "$apps" ]; then
|
||||||
|
export PROMPT_COMMAND="echo -ne \"\033]0;[${product}-${variant}] ${USER}@${HOSTNAME}: ${PWD}\007\""
|
||||||
|
else
|
||||||
|
export PROMPT_COMMAND="echo -ne \"\033]0;[$apps $variant] ${USER}@${HOSTNAME}: ${PWD}\007\""
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -376,11 +382,6 @@ function choosevariant()
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
function tapas()
|
|
||||||
{
|
|
||||||
choosecombo
|
|
||||||
}
|
|
||||||
|
|
||||||
function choosecombo()
|
function choosecombo()
|
||||||
{
|
{
|
||||||
choosesim $1
|
choosesim $1
|
||||||
|
@ -432,7 +433,6 @@ function print_lunch_menu()
|
||||||
echo
|
echo
|
||||||
echo "You're building on" $uname
|
echo "You're building on" $uname
|
||||||
echo
|
echo
|
||||||
echo ${LUNCH_MENU_CHOICES[@]}
|
|
||||||
echo "Lunch menu... pick a combo:"
|
echo "Lunch menu... pick a combo:"
|
||||||
|
|
||||||
local i=1
|
local i=1
|
||||||
|
@ -484,6 +484,8 @@ function lunch()
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
export TARGET_BUILD_APPS=
|
||||||
|
|
||||||
# special case the simulator
|
# special case the simulator
|
||||||
if [ "$selection" = "simulator" ]
|
if [ "$selection" = "simulator" ]
|
||||||
then
|
then
|
||||||
|
@ -530,6 +532,31 @@ function lunch()
|
||||||
printconfig
|
printconfig
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Configures the build to build unbundled apps.
|
||||||
|
# Run tapas with one ore more app names (from LOCAL_PACKAGE_NAME)
|
||||||
|
function tapas()
|
||||||
|
{
|
||||||
|
local variant=$(echo -n $(echo $* | xargs -n 1 echo | grep -E '^(user|userdebug|eng)$'))
|
||||||
|
local apps=$(echo -n $(echo $* | xargs -n 1 echo | grep -E -v '^(user|userdebug|eng)$'))
|
||||||
|
|
||||||
|
if [ $(echo $variant | wc -w) -gt 1 ]; then
|
||||||
|
echo "tapas: Error: Multiple build variants supplied: $variant"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
if [ -z "$variant" ]; then
|
||||||
|
variant=eng
|
||||||
|
fi
|
||||||
|
|
||||||
|
export TARGET_PRODUCT=generic
|
||||||
|
export TARGET_BUILD_VARIANT=$variant
|
||||||
|
export TARGET_SIMULATOR=false
|
||||||
|
export TARGET_BUILD_TYPE=release
|
||||||
|
export TARGET_BUILD_APPS=$apps
|
||||||
|
|
||||||
|
set_stuff_for_environment
|
||||||
|
printconfig
|
||||||
|
}
|
||||||
|
|
||||||
function gettop
|
function gettop
|
||||||
{
|
{
|
||||||
local TOPFILE=build/core/envsetup.mk
|
local TOPFILE=build/core/envsetup.mk
|
||||||
|
|
|
@ -25,8 +25,8 @@
|
||||||
# it includes.
|
# it includes.
|
||||||
#
|
#
|
||||||
|
|
||||||
ifeq ($(strip $(is_unbundled_app_build)),true)
|
|
||||||
# An unbundled app build needs only generic.mk.
|
# An unbundled app build needs only generic.mk.
|
||||||
|
ifneq ($(TARGET_BUILD_APPS),)
|
||||||
PRODUCT_MAKEFILES := \
|
PRODUCT_MAKEFILES := \
|
||||||
$(LOCAL_DIR)/core.mk \
|
$(LOCAL_DIR)/core.mk \
|
||||||
$(LOCAL_DIR)/generic.mk
|
$(LOCAL_DIR)/generic.mk
|
||||||
|
|
|
@ -16,7 +16,8 @@
|
||||||
|
|
||||||
LOCAL_PATH := $(my-dir)
|
LOCAL_PATH := $(my-dir)
|
||||||
|
|
||||||
ifeq ($(strip $(is_unbundled_app_build)),true)
|
# If we're building only unbundled apps, this is the only tool we need.
|
||||||
|
ifneq ($(TARGET_BUILD_APPS),)
|
||||||
include $(LOCAL_PATH)/signapk/Android.mk
|
include $(LOCAL_PATH)/signapk/Android.mk
|
||||||
else
|
else
|
||||||
include $(call first-makefiles-under,$(LOCAL_PATH))
|
include $(call first-makefiles-under,$(LOCAL_PATH))
|
||||||
|
|
|
@ -23,5 +23,8 @@ LOCAL_SRC_FILES := SignApk.java
|
||||||
LOCAL_JAR_MANIFEST := SignApk.mf
|
LOCAL_JAR_MANIFEST := SignApk.mf
|
||||||
include $(BUILD_HOST_JAVA_LIBRARY)
|
include $(BUILD_HOST_JAVA_LIBRARY)
|
||||||
|
|
||||||
# The post-build signing tools need signapk.jar.
|
ifeq ($(TARGET_BUILD_APPS),)
|
||||||
$(call dist-for-goals,droid,$(LOCAL_INSTALLED_MODULE))
|
# The post-build signing tools need signapk.jar, but we don't
|
||||||
|
# need this if we're just doing unbundled apps.
|
||||||
|
$(call dist-for-goals,droidcore,$(LOCAL_INSTALLED_MODULE))
|
||||||
|
endif
|
||||||
|
|
Loading…
Reference in New Issue