diff options
author | Chirayu Desai <cdesai@cyanogenmod.org> | 2013-06-30 10:04:25 +0530 |
---|---|---|
committer | Adnan Begovic <adnan@cyngn.com> | 2015-10-06 16:12:22 -0700 |
commit | b89b324fb27a2ca977064ddf0c71f66b2773311b (patch) | |
tree | 7f874e3c0be0cf2d2746a1e7f9de75b4b5cafa76 /envsetup.sh | |
parent | 4996718cd4c37e0075faf4565d524aaf924b5865 (diff) | |
download | build-b89b324fb27a2ca977064ddf0c71f66b2773311b.zip build-b89b324fb27a2ca977064ddf0c71f66b2773311b.tar.gz build-b89b324fb27a2ca977064ddf0c71f66b2773311b.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
Diffstat (limited to 'envsetup.sh')
-rw-r--r-- | envsetup.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/envsetup.sh b/envsetup.sh index 13ea336..29f4360 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -657,6 +657,8 @@ function lunch() echo + fixup_common_out_dir + set_stuff_for_environment printconfig } @@ -2070,6 +2072,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.7 or java 1.6 if it isn't already set. # # Note that the MacOS path for java 1.7 includes a minor revision number (sigh). |