forked from openkylin/platform_build
Add a tapas command.
(Actually there was a tapas command that just called choosecombo). The new better tapas command is for building unbundled apps. Run it with one or more modules to build and optionally a build variant. tapas [variant] App1 App2 ... If you don't supply a build variant, it defaults to eng. Change-Id: I02214abd0b5ad02e364fcb024e10cf6ad17a9e68
This commit is contained in:
parent
16fa4b290e
commit
da12daf15f
33
core/main.mk
33
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):
|
||||||
|
|
||||||
|
@ -686,9 +687,9 @@ droidcore: files \
|
||||||
$(INSTALLED_USERDATAIMAGE_TARGET) \
|
$(INSTALLED_USERDATAIMAGE_TARGET) \
|
||||||
$(INSTALLED_FILES_FILE)
|
$(INSTALLED_FILES_FILE)
|
||||||
|
|
||||||
# The actual files built by the droidcore target changes depending
|
|
||||||
# on the build variant.
|
|
||||||
ifneq ($(TARGET_BUILD_APPS),)
|
ifneq ($(TARGET_BUILD_APPS),)
|
||||||
|
# If this build is just for apps, only build apps and not the full system by default.
|
||||||
|
|
||||||
unbundled_build_modules :=
|
unbundled_build_modules :=
|
||||||
ifneq ($(filter all,$(TARGET_BUILD_APPS)),)
|
ifneq ($(filter all,$(TARGET_BUILD_APPS)),)
|
||||||
# If they used the magic goal "all" then build everything
|
# If they used the magic goal "all" then build everything
|
||||||
|
@ -696,24 +697,19 @@ ifneq ($(TARGET_BUILD_APPS),)
|
||||||
else
|
else
|
||||||
unbundled_build_modules := $(TARGET_BUILD_APPS)
|
unbundled_build_modules := $(TARGET_BUILD_APPS)
|
||||||
endif
|
endif
|
||||||
default_goal_deps := $(unbundled_build_modules)
|
|
||||||
else # TARGET_BUILD_APPS
|
|
||||||
default_goal_deps := droidcore
|
|
||||||
endif # TARGET_BUILD_APPS
|
|
||||||
|
|
||||||
.PHONY: droid tests
|
|
||||||
droid: $(default_goal_deps)
|
|
||||||
tests: droidcore
|
|
||||||
|
|
||||||
ifneq ($(TARGET_BUILD_APPS),)
|
|
||||||
# dist the unbundled app.
|
# dist the unbundled app.
|
||||||
$(call dist-for-goals,droid, \
|
$(call dist-for-goals,apps_only, \
|
||||||
$(foreach m,$(unbundled_build_modules),$(ALL_MODULES.$(m).INSTALLED)) \
|
$(foreach m,$(unbundled_build_modules),$(ALL_MODULES.$(m).INSTALLED)) \
|
||||||
)
|
)
|
||||||
|
|
||||||
else # TARGET_BUILD_APPS
|
.PHONY: apps_only
|
||||||
|
apps_only: $(unbundled_build_modules)
|
||||||
|
|
||||||
$(call dist-for-goals, droid, \
|
droid: apps_only
|
||||||
|
|
||||||
|
else # TARGET_BUILD_APPS
|
||||||
|
$(call dist-for-goals, droidcore, \
|
||||||
$(INTERNAL_UPDATE_PACKAGE_TARGET) \
|
$(INTERNAL_UPDATE_PACKAGE_TARGET) \
|
||||||
$(INTERNAL_OTA_PACKAGE_TARGET) \
|
$(INTERNAL_OTA_PACKAGE_TARGET) \
|
||||||
$(SYMBOLS_ZIP) \
|
$(SYMBOLS_ZIP) \
|
||||||
|
@ -736,8 +732,16 @@ else # TARGET_BUILD_APPS
|
||||||
$(BUILT_TESTS_ZIP_PACKAGE) \
|
$(BUILT_TESTS_ZIP_PACKAGE) \
|
||||||
)
|
)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Building a full system-- the default is to build droidcore
|
||||||
|
droid: droidcore
|
||||||
|
|
||||||
endif # TARGET_BUILD_APPS
|
endif # TARGET_BUILD_APPS
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: droid tests
|
||||||
|
tests: droidcore
|
||||||
|
|
||||||
.PHONY: docs
|
.PHONY: docs
|
||||||
docs: $(ALL_DOCS)
|
docs: $(ALL_DOCS)
|
||||||
|
|
||||||
|
@ -782,3 +786,4 @@ modules:
|
||||||
.PHONY: showcommands
|
.PHONY: showcommands
|
||||||
showcommands:
|
showcommands:
|
||||||
@echo >/dev/null
|
@echo >/dev/null
|
||||||
|
|
||||||
|
|
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
|
||||||
|
|
|
@ -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