From df9178df7643efc8569bb18fd0816b373e53e67c Mon Sep 17 00:00:00 2001 From: friedman Date: Wed, 27 Apr 2016 17:32:26 -0700 Subject: [PATCH] install-build-deps-android.sh support for Ubuntu Xenial R=dpranke@chromium.org,pgervais@google.com BUG=601197 Review-Url: https://codereview.chromium.org/1924093002 Cr-Original-Commit-Position: refs/heads/master@{#390255} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 3f67f4af2bb655ce6de7dea2b05210145b682f45 --- install-build-deps-android.sh | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/install-build-deps-android.sh b/install-build-deps-android.sh index 9f1317ef3..172279b2e 100755 --- a/install-build-deps-android.sh +++ b/install-build-deps-android.sh @@ -19,12 +19,23 @@ if ! uname -m | egrep -q "i686|x86_64"; then exit fi +lsb_release=$(lsb_release --codename --short) + +case $lsb_release in + xenial) + java_alternative="java-1.8.0-openjdk-amd64" + java_pkgs="openjdk-8-jre openjdk-8-jdk" + ;; + *) + java_alternative="java-1.7.0-openjdk-amd64" + java_pkgs="openjdk-7-jre openjdk-7-jdk" + ;; +esac + # Install first the default Linux build deps. "$(dirname "${BASH_SOURCE[0]}")/install-build-deps.sh" \ --no-syms --lib32 --no-arm --no-chromeos-fonts --no-nacl --no-prompt "${args}" -lsb_release=$(lsb_release --codename --short) - # The temporary directory used to store output of update-java-alternatives TEMPDIR=$(mktemp -d) cleanup() { @@ -56,15 +67,15 @@ fi sudo apt-get -y install ant -# Install openjdk and openjre 7 stuff -sudo apt-get -y install openjdk-7-jre openjdk-7-jdk +# Install openjdk and openjre stuff +sudo apt-get -y install $java_pkgs # Switch version of Java to openjdk 7. # Some Java plugins (e.g. for firefox, mozilla) are not required to build, and # thus are treated only as warnings. Any errors in updating java alternatives # which are not '*-javaplugin.so' will cause errors and stop the script from # completing successfully. -if ! sudo update-java-alternatives -s java-1.7.0-openjdk-amd64 \ +if ! sudo update-java-alternatives -s $java_alternative \ >& "${TEMPDIR}"/update-java-alternatives.out then # Check that there are the expected javaplugin.so errors for the update