From bc9ae3d5c21915c165b2b2cb41d07e1573814254 Mon Sep 17 00:00:00 2001 From: Dark Eyes Date: Tue, 8 Mar 2016 22:05:10 -0500 Subject: envsetup: Always look up JAVA_HOME path Change-Id: I8b0641eb107cd095079bb17f92e99730f532fda7 --- envsetup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'envsetup.sh') diff --git a/envsetup.sh b/envsetup.sh index 446947f..00dfbf1 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -2404,7 +2404,7 @@ function set_java_home() { export JAVA_HOME=$(/usr/libexec/java_home -v 1.7) ;; *) - export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 + export JAVA_HOME=$(dirname $(dirname $(dirname $(readlink -f $(which java))))) ;; esac -- cgit v1.1 From 0407535c99cfd534461568438eecfefd977b27f3 Mon Sep 17 00:00:00 2001 From: luca020400 Date: Thu, 5 May 2016 21:53:40 +0200 Subject: envsetup: Fix aosp & caf remote Fixes: sed: -e expression #1, char 9: unknown option to `s' * Return if .git directory is missing and move it on the top * Update cmremote strings ( match caf/aosp remote ) Change-Id: Ifb606a20f308e7317e9ce519d682a3fdb8bfe9bf --- envsetup.sh | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'envsetup.sh') diff --git a/envsetup.sh b/envsetup.sh index 00dfbf1..23012ce 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -1685,13 +1685,13 @@ function godir () { function cmremote() { - git remote rm cmremote 2> /dev/null - GERRIT_REMOTE=$(git config --get remote.github.projectname) - if [ -z "$GERRIT_REMOTE" ] + if ! git rev-parse --git-dir &> /dev/null then - echo Unable to set up the git remote, are you under a git repo? - return 0 + echo ".git directory not found. Please run this from the root directory of the Android repository you wish to set up." + return 1 fi + git remote rm cmremote 2> /dev/null + GERRIT_REMOTE=$(git config --get remote.github.projectname) CMUSER=$(git config --get review.review.cyanogenmod.org.username) if [ -z "$CMUSER" ] then @@ -1699,17 +1699,18 @@ function cmremote() else git remote add cmremote ssh://$CMUSER@review.cyanogenmod.org:29418/$GERRIT_REMOTE fi - echo You can now push to "cmremote". + echo "Remote 'cmremote' created" } function aospremote() { - git remote rm aosp 2> /dev/null - if [ ! -d .git ] + if ! git rev-parse --git-dir &> /dev/null then - echo .git directory not found. Please run this from the root directory of the Android repository you wish to set up. + echo ".git directory not found. Please run this from the root directory of the Android repository you wish to set up." + return 1 fi - PROJECT=`pwd -P | sed s#$ANDROID_BUILD_TOP/##g` + git remote rm aosp 2> /dev/null + PROJECT=${$(pwd -P)#$ANDROID_BUILD_TOP/} if (echo $PROJECT | grep -qv "^device") then PFX="platform/" @@ -1720,12 +1721,13 @@ function aospremote() function cafremote() { - git remote rm caf 2> /dev/null - if [ ! -d .git ] + if ! git rev-parse --git-dir &> /dev/null then - echo .git directory not found. Please run this from the root directory of the Android repository you wish to set up. + echo ".git directory not found. Please run this from the root directory of the Android repository you wish to set up." + return 1 fi - PROJECT=`pwd -P | sed s#$ANDROID_BUILD_TOP/##g` + git remote rm caf 2> /dev/null + PROJECT=${$(pwd -P)#$ANDROID_BUILD_TOP/} if (echo $PROJECT | grep -qv "^device") then PFX="platform/" -- cgit v1.1 From 68301b2b87e5f485093089a56a0025c2b5d0e8b2 Mon Sep 17 00:00:00 2001 From: luca020400 Date: Thu, 19 May 2016 21:02:51 +0200 Subject: build: Fix caf and aospremote Change-Id: I8ad28d71254941c0aacb91b1c6c702f9f13caf5f --- envsetup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'envsetup.sh') diff --git a/envsetup.sh b/envsetup.sh index 23012ce..03a6424 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -1710,7 +1710,7 @@ function aospremote() return 1 fi git remote rm aosp 2> /dev/null - PROJECT=${$(pwd -P)#$ANDROID_BUILD_TOP/} + PROJECT=$(pwd -P | sed "s#$ANDROID_BUILD_TOP\/##") if (echo $PROJECT | grep -qv "^device") then PFX="platform/" @@ -1727,7 +1727,7 @@ function cafremote() return 1 fi git remote rm caf 2> /dev/null - PROJECT=${$(pwd -P)#$ANDROID_BUILD_TOP/} + PROJECT=$(pwd -P | sed "s#$ANDROID_BUILD_TOP\/##") if (echo $PROJECT | grep -qv "^device") then PFX="platform/" -- cgit v1.1 From 9f360cd1250cf36633efd4fc88ddf4b5fdbdc4a6 Mon Sep 17 00:00:00 2001 From: Keith Mok Date: Fri, 16 Sep 2016 14:30:19 -0700 Subject: Revert "envsetup: Always look up JAVA_HOME path" This breaks, if we have both jdk7 and jdk8 installed on same machine. This reverts commit bc9ae3d5c21915c165b2b2cb41d07e1573814254. Change-Id: Id0482d130d5306e797adfeeaeb2efbd1e25aa3ee --- envsetup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'envsetup.sh') diff --git a/envsetup.sh b/envsetup.sh index 03a6424..c93db03 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -2406,7 +2406,7 @@ function set_java_home() { export JAVA_HOME=$(/usr/libexec/java_home -v 1.7) ;; *) - export JAVA_HOME=$(dirname $(dirname $(dirname $(readlink -f $(which java))))) + export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 ;; esac -- cgit v1.1 From ba31c2695aa7c81a930059976f2dacffb84f1cb0 Mon Sep 17 00:00:00 2001 From: Neil Fuller Date: Thu, 19 Nov 2015 15:51:47 +0000 Subject: Use sensible default locations for Java Use sensible default locations for Java based on the EXPERIMENTAL_USE_JAVA8 flag. Bug: 25786468 Change-Id: I7ec035b5329785efc41b3f971d5e3ae202293576 --- envsetup.sh | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) (limited to 'envsetup.sh') diff --git a/envsetup.sh b/envsetup.sh index c93db03..3efd683 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -2384,11 +2384,7 @@ function fixup_common_out_dir() { fi } -# Force JAVA_HOME to point to java 1.7 if it isn't already set. -# -# Note that the MacOS path for java 1.7 includes a minor revision number (sigh). -# For some reason, installing the JDK doesn't make it show up in the -# JavaVM.framework/Versions/1.7/ folder. +# Force JAVA_HOME to point to java 1.7/1.8 if it isn't already set. function set_java_home() { # Clear the existing JAVA_HOME value if we set it ourselves, so that # we can reset it later, depending on the version of java the build @@ -2401,14 +2397,25 @@ function set_java_home() { fi if [ ! "$JAVA_HOME" ]; then - case `uname -s` in - Darwin) - export JAVA_HOME=$(/usr/libexec/java_home -v 1.7) - ;; - *) - export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 - ;; - esac + if [ ! "$EXPERIMENTAL_USE_JAVA8" ]; then + case `uname -s` in + Darwin) + export JAVA_HOME=$(/usr/libexec/java_home -v 1.7) + ;; + *) + export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 + ;; + esac + else + case `uname -s` in + Darwin) + export JAVA_HOME=$(/usr/libexec/java_home -v 1.8) + ;; + *) + export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 + ;; + esac + fi # Keep track of the fact that we set JAVA_HOME ourselves, so that # we can change it on the next envsetup.sh, if required. -- cgit v1.1 From 5bf9b09f6420bd494702ce1b7eb8d502e2d33963 Mon Sep 17 00:00:00 2001 From: Adrian DC Date: Thu, 6 Oct 2016 13:42:43 +0200 Subject: build: Support a fallback to java 8 if java 7 is not found * In the case of a host installed only with java 8, the build starts correctly but on use of JAVA_HOME binaries, the java references are missing * Allow the java 7 to be tested and try to use java 8 Change-Id: Ie50892edb54feb8608a0ef80a1c2a8667703e8ee --- envsetup.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'envsetup.sh') diff --git a/envsetup.sh b/envsetup.sh index 3efd683..3c11a22 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -2406,7 +2406,8 @@ function set_java_home() { export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 ;; esac - else + fi + if [ ! "$JAVA_HOME" ] || [ ! -d "$JAVA_HOME" ]; then case `uname -s` in Darwin) export JAVA_HOME=$(/usr/libexec/java_home -v 1.8) -- cgit v1.1 From 6fd080e10615f641ad3b60f38d5753aec4a6b5be Mon Sep 17 00:00:00 2001 From: Michael Bestas Date: Thu, 20 Oct 2016 23:25:40 +0300 Subject: envsetup: Fix cafremote/aospremote for projects with non-standard paths * Fix -caf and -caf- projects * Fix AOSP HALs that are synced in "/default" subfolder Change-Id: I33cc344a3234de6698676c32035622acbec03dd1 --- envsetup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'envsetup.sh') diff --git a/envsetup.sh b/envsetup.sh index 3c11a22..6715419 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -1710,7 +1710,7 @@ function aospremote() return 1 fi git remote rm aosp 2> /dev/null - PROJECT=$(pwd -P | sed "s#$ANDROID_BUILD_TOP\/##") + PROJECT=$(pwd -P | sed -e "s#$ANDROID_BUILD_TOP\/##; s#-caf.*##; s#\/default##") if (echo $PROJECT | grep -qv "^device") then PFX="platform/" @@ -1727,7 +1727,7 @@ function cafremote() return 1 fi git remote rm caf 2> /dev/null - PROJECT=$(pwd -P | sed "s#$ANDROID_BUILD_TOP\/##") + PROJECT=$(pwd -P | sed -e "s#$ANDROID_BUILD_TOP\/##; s#-caf.*##; s#\/default##") if (echo $PROJECT | grep -qv "^device") then PFX="platform/" -- cgit v1.1