summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2021-12-03 17:12:55 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-12-03 17:12:55 +0000
commitb85479279881eabd8440b932fa5112b1cb77b7fc (patch)
tree6a6a48bc79fdedb6fc2c7505a7a45e4aa8bb970a
parent1a266c5b10fdca9364e61187a82a0d4574bb6ba4 (diff)
parent31325ef87722bbb8f894aeb0f8e08132129ee4f9 (diff)
downloadcmdline-tools-b85479279881eabd8440b932fa5112b1cb77b7fc.tar.gz
Add script for downloading lint updates am: 0e53b9dab8 am: a66a2838f1 am: 31325ef877
Original change: https://android-review.googlesource.com/c/platform/prebuilts/cmdline-tools/+/1822273 Change-Id: I529343d10fd0280c6aaff59f8e0d09e9cf2f9ed4
-rw-r--r--patches/bin-lint.patch22
-rwxr-xr-xupdate-prebuilts.sh68
2 files changed, 90 insertions, 0 deletions
diff --git a/patches/bin-lint.patch b/patches/bin-lint.patch
new file mode 100644
index 0000000..668d53f
--- /dev/null
+++ b/patches/bin-lint.patch
@@ -0,0 +1,22 @@
+diff --git b/tools/bin/lint a/tools/bin/lint
+index ccd3ca3..7186007 100755
+--- b/tools/bin/lint
++++ a/tools/bin/lint
+@@ -64,7 +64,16 @@ case "`uname`" in
+ ;;
+ esac
+
+-CLASSPATH=$APP_HOME/lib/lint-classpath.jar
++# CLASSPATH=$APP_HOME/lib/lint-classpath.jar
++
++# BEGIN ANDROID PLATFORM
++# Check ../framework/lint.jar first before falling back to ../lib/lint-classpath.jar.
++CLASSPATH=$APP_HOME/framework/lint.jar
++if [ ! -e $CLASSPATH ]; then
++ CLASSPATH=$APP_HOME/lib//lint-classpath.jar
++fi
++# END ANDROID PLATFORM
++
+
+ # Determine the Java command to use to start the JVM.
+ if [ -n "$JAVA_HOME" ] ; then
diff --git a/update-prebuilts.sh b/update-prebuilts.sh
new file mode 100755
index 0000000..4fc0fa2
--- /dev/null
+++ b/update-prebuilts.sh
@@ -0,0 +1,68 @@
+#!/bin/bash -e
+
+# Copyright 2020 Google Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+if [ -z $1 ]; then
+ echo "usage: $0 <build number>"
+ exit 1
+fi
+
+readonly BUILD_NUMBER=$1
+
+cd "$(dirname $0)"
+
+if ! git diff HEAD --quiet; then
+ echo "must be run with a clean prebuilts/build-tools project"
+ exit 1
+fi
+
+readonly tmpdir=$(mktemp -d)
+
+function finish {
+ if [ ! -z "${tmpdir}" ]; then
+ rm -rf "${tmpdir}"
+ fi
+}
+trap finish EXIT
+
+function fetch_artifact() {
+ /google/data/ro/projects/android/fetch_artifact --bid ${BUILD_NUMBER} --target $1 "$2" "$3"
+}
+
+fetch_artifact studio-linux artifacts/commandlinetools_linux.zip "${tmpdir}/commandlinetools_linux.zip"
+fetch_artifact studio-linux artifacts/lint-tests.jar "${tmpdir}/lint-tests.jar"
+fetch_artifact studio-linux manifest_${BUILD_NUMBER}.xml "${tmpdir}/manifest.xml"
+
+function unzip_to() {
+ rm -rf "$1"
+ mkdir "$1"
+ unzip -qDD -d "$1" "$2"
+}
+
+rm -rf tools
+unzip -q "${tmpdir}/commandlinetools_linux.zip"
+mv cmdline-tools tools
+
+cp -f "${tmpdir}/lint-tests.jar" lint-tests.jar
+cp -f "${tmpdir}/manifest.xml" manifest.xml
+
+patch -p1 < patches/bin-lint.patch
+
+git add tools lint-tests.jar manifest.xml
+git commit -m "Update cmdline-tools to ab/${BUILD_NUMBER}
+
+https://ci.android.com/builds/submitted/${BUILD_NUMBER}/studio-linux/latest
+
+Test: treehugger"