summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChirayu Desai <cdesai@cyanogenmod.org>2013-06-30 04:34:25 (GMT)
committerGerrit Code Review <gerrit@cyanogenmod.org>2013-07-23 18:14:58 (GMT)
commit7d1516114aac1c158d7f2d4e5db16b7c60008553 (patch)
tree5e05e3498a8ee80591c0888ca01f380e02f8f81f
parent42342f327888427b0a9ddf1754c8f54a21ef46a5 (diff)
downloadbuild-7d1516114aac1c158d7f2d4e5db16b7c60008553.zip
build-7d1516114aac1c158d7f2d4e5db16b7c60008553.tar.gz
build-7d1516114aac1c158d7f2d4e5db16b7c60008553.tar.bz2
envsetup: add a helper to fix "out/target/common" not being really common
* out/target/common isn't really common, and if you do back to back builds for multiple devices, that is noticable. * Use out/target/common-$device instead, and link the appropriate dir to out/target/common every time lunch() is run, if CM_FIXUP_COMMON_OUT is set. * Refer https://groups.google.com/forum/#!topic/android-building/ispbOgzoyg8 for more info. Change-Id: I11e7df0e68e2a60ce32576f06397d60fc9465b60
-rw-r--r--envsetup.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/envsetup.sh b/envsetup.sh
index 7f9bb4c..a1eb875 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -615,6 +615,8 @@ function lunch()
echo
+ fixup_common_out_dir
+
set_stuff_for_environment
printconfig
}
@@ -1846,6 +1848,24 @@ function repopick() {
$T/build/tools/repopick.py $@
}
+function fixup_common_out_dir() {
+ common_out_dir=$(get_build_var OUT_DIR)/target/common
+ target_device=$(get_build_var TARGET_DEVICE)
+ if [ ! -z $CM_FIXUP_COMMON_OUT ]; then
+ if [ -d ${common_out_dir} ] && [ ! -L ${common_out_dir} ]; then
+ mv ${common_out_dir} ${common_out_dir}-${target_device}
+ ln -s ${common_out_dir}-${target_device} ${common_out_dir}
+ else
+ [ -L ${common_out_dir} ] && rm ${common_out_dir}
+ mkdir -p ${common_out_dir}-${target_device}
+ ln -s ${common_out_dir}-${target_device} ${common_out_dir}
+ fi
+ else
+ [ -L ${common_out_dir} ] && rm ${common_out_dir}
+ mkdir -p ${common_out_dir}
+ fi
+}
+
# Force JAVA_HOME to point to java 1.6 if it isn't already set
function set_java_home() {