Permalink
Browse files

add release target

Change-Id: I281180b82248f9a7aed1dbe07d26a7f63412bded
  • Loading branch information...
1 parent 8dea95d commit 92c85c6a5dbdd9538db20d0355aaced38e995131 @fanoge fanoge committed Jan 18, 2012
Showing with 60 additions and 5 deletions.
  1. +13 −0 envsetup.sh
  2. +4 −3 localvar.mk
  3. +37 −1 porting.mk
  4. +6 −1 util.mk
View
@@ -8,6 +8,9 @@
# android_build_top and android_product_out specified here would not be used.
# If android_build_top or android_product_out is empty, then ?
+
+USE_ANDROID_OUT=${RELEASE_PORTING:=false}
+
TOPFILE=build/porting.mk
if [ -f $TOPFILE ] ; then
PORT_ROOT=$PWD
@@ -22,6 +25,7 @@ else
fi
fi
+
if [ -n "$PORT_ROOT" ]; then
PORT_BUILD=$PORT_ROOT/build
ANDROID_TOP=${ANDROID_BUILD_TOP:=$1}
@@ -31,3 +35,12 @@ if [ -n "$PORT_ROOT" ]; then
echo "ANDROID_TOP = $ANDROID_TOP"
echo "ANDROID_OUT = $ANDROID_OUT"
fi
+
+
+if [ "$USE_ANDROID_OUT" = "true" ]; then
+ if [ -z "$ANDROID_TOP" ]; then
+ echo "Need to lunch first if USE_ANDROID_OUT=true or RELEASE_PORT is exported"
+ else
+ export USE_ANDROID_OUT
+ fi
+fi
View
@@ -1,7 +1,6 @@
#
# Currenly the following local variables are used for
# each product to define the behavior for porting
-# local-use-android-out
# local-zip-file MUST be defined
# local-out-zip-file
# local-modified-apps
@@ -37,8 +36,10 @@ endif
ACT_AFTER_ZIP := $(strip $(local-after-zip))
-USE_ANDROID_OUT := $(strip $(local-use-android-out))
-ifeq ($(USE_ANDROID_OUT),true)
+#
+#USE_ANDROID_OUT := $(strip $(local-use-android-out))
+
+ifeq ($(strip $(USE_ANDROID_OUT)),true)
ifeq ($(ANDROID_OUT),)
ERR_REPORT += error-android-env
else
View
@@ -23,6 +23,8 @@ SIGNAPKS :=
TOZIP_APKS :=
CLEANJAR :=
CLEANMIUIAPP:=
+RELEASE_MIUI:=
+RELEASE_PATH:=$(PORT_ROOT)/miui
MAKE_ATTOP := make -C $(ANDROID_TOP)
#
@@ -54,6 +56,11 @@ $(OUT_JAR_PATH)/$(1).jar: $(ERR_REPORT)
CLEANJAR += clean-$(1)
clean-$(1):
$(MAKE_ATTOP) clean-$(1)
+
+RELEASE_MIUI += $(RELEASE_PATH)/system/framework/$(1).jar
+$(RELEASE_PATH)/system/framework/$(1).jar: $(OUT_JAR_PATH)/$(1).jar
+ mkdir -p $(RELEASE_PATH)/system/framework
+ cp $$< $$@
endif
endef
@@ -98,6 +105,7 @@ endef
#
# Used to build and clean the miui apk, e.g: make clean-Launcher2
# $1: the apk name
+# $2: the dir name
define BUILD_CLEAN_APP_template
ifeq ($(USE_ANDROID_OUT),true)
$(OUT_APK_PATH)/$(1).apk:
@@ -106,6 +114,11 @@ $(OUT_APK_PATH)/$(1).apk:
CLEANMIUIAPP += clean-$(1)
clean-$(1):
$(MAKE_ATTOP) $$@
+
+RELEASE_MIUI += $(RELEASE_PATH)/system/app/$(1).apk
+$(RELEASE_PATH)/system/app/$(1).apk: $(OUT_APK_PATH)/$(1).apk
+ mkdir -p $(RELEASE_PATH)/system/app
+ cp $$< $$@
endif
endef
@@ -129,6 +142,14 @@ $(eval $(call SIGN_template,$(TMP_DIR)/MIUISystemUI.apk,/system/app/SystemUI.apk
$(foreach app, $(MIUIAPPS) MIUISystemUI, $(eval $(call BUILD_CLEAN_APP_template,$(app))))
+
+# for release
+ifeq ($(USE_ANDROID_OUT),true)
+RELEASE_MIUI += $(RELEASE_PATH)/system/framework/framework-miui-res.apk
+$(RELEASE_PATH)/system/framework/framework-miui-res.apk:
+ cp $(OUT_JAR_PATH)/framework-miui-res.apk $@
+endif
+
#< TARGET EXPANSION END
#> TARGET FOR ZIPFILE START
@@ -145,7 +166,7 @@ remove-rund-apks:
pre-zip-misc:
@echo Add other tools: invoke-as, busybox
cp $(SYSOUT_DIR)/xbin/invoke-as $(ZIP_DIR)/system/xbin/
- cp other/busybox $(ZIP_DIR)/system/xbin/
+ cp $(SYSOUT_DIR)/xbin/busybox $(ZIP_DIR)/system/xbin/
@echo Add Launcher gadget files
cp -r $(SYSOUT_DIR)/media/gadget $(ZIP_DIR)/system/media/
@echo Add default theme
@@ -154,6 +175,21 @@ pre-zip-misc:
cp -r $(SYSOUT_DIR)/media/wallpaper $(ZIP_DIR)/system/media/
@echo Add lockscreen wallpapers
cp -r $(SYSOUT_DIR)/media/lockscreen $(ZIP_DIR)/system/media/
+
+ifeq ($(USE_ANDROID_OUT),true)
+RELEASE_MIUI += $(RELEASE_PATH)/system/xbin $(RELEASE_PATH)/system/media
+$(RELEASE_PATH)/system/xbin:
+ mkdir -p $(RELEASE_PATH)/system/xbin
+ cp $(SYSOUT_DIR)/xbin/invoke-as $(RELEASE_PATH)/system/xbin/
+ cp $(SYSOUT_DIR)/xbin/busybox $(RELEASE_PATH)/system/xbin/
+
+$(RELEASE_PATH)/system/media:
+ mkdir -p $(RELEASE_PATH)/system/media
+ cp -r $(SYSOUT_DIR)/media/gadget $(RELEASE_PATH)/system/media/
+ cp -r $(SYSOUT_DIR)/media/theme $(RELEASE_PATH)/system/media/
+ cp -r $(SYSOUT_DIR)/media/wallpaper $(RELEASE_PATH)/system/media/
+ cp -r $(SYSOUT_DIR)/media/lockscreen $(RELEASE_PATH)/system/media/
+endif
zipfile: $(ZIP_DIR) $(ZIP_BLDJARS) $(TOZIP_APKS) $(ACT_PRE_ZIP)
$(SIGN) sign.zip $(ZIP_DIR)
View
@@ -3,24 +3,28 @@ usage:
@echo " make zipfile - to create the full ZIP file"
@echo " make zipone - zipfile, plus the customized actions, such as zip2sd"
@echo " make zip2sd - to push the ZIP file to phone in recovery mode"
- @echo " make apktool-if - install the framework for apktool"
@echo " make clean - clear everything for output of this makefile"
@echo " make reallyclean- clear everything of related."
@echo "Other helper targets:"
+ @echo " make apktool-if - install the framework for apktool"
@echo " make verify - to check if any error in the makefile"
@echo " make .build/xxxx.jar-phone - to make out a single jar file and push to phone"
@echo " make xxxx.apk.sign - to generate a xxxx.apk and sign/push to phone"
@echo " make clean-xxxx/make xxxx - just as make under android-build-top"
@echo " make sign - Sign all generated apks by this makefile and push to phone"
# Target to install apktool framework
+# todo two files for
apktool-if: $(SYSOUT_DIR)/framework/framework.jar $(TMP_DIR)/framework-res.apk
@echo install framework resources...
$(APKTOOL) if $(TMP_DIR)/framework-res.apk
$(APKTOOL) if $(SYSOUT_DIR)/framework/framework-miui-res.apk
unzip $(ZIP_FILE) system/framework/twframework-res.apk -d $(TMP_DIR)
$(APKTOOL) if $(TMP_DIR)/system/framework/twframework-res.apk
+# Target to release MIUI jar and apks
+release: $(RELEASE_MIUI)
+
# Target to sign apks in the connected phone
sign: $(SIGNAPKS)
@echo Sign competed!
@@ -68,6 +72,7 @@ verify: $(ERR_REPORT)
@echo "ACT_PRE_ZIP = $(ACT_PRE_ZIP)"
@echo "ACT_PRE_ZIP = $(ACT_AFTER_ZIP)"
@echo "USE_ANDROID_OUT = $(USE_ANDROID_OUT)"
+ @echo "RELEASE_MIUI = $(RELEASE_MIUI)"
@echo "----------------------"
@echo ">>>>> MORE VARIABLE:"
@echo "SIGNAPKS = $(SIGNAPKS)"

0 comments on commit 92c85c6

Please sign in to comment.