summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattgilbride <mattgilbride@google.com>2022-11-29 16:25:34 +0000
committermattgilbride <mattgilbride@google.com>2022-11-29 22:01:54 +0000
commit94470dc35966140744e68f1c77df7ce6c916d857 (patch)
treeb414d3e827737588bdf86d5a3f1f2b648bf8ad66
parent88d2634589594bd59613e760e008fcf0d7f0d306 (diff)
downloadcmdline-tools-94470dc35966140744e68f1c77df7ce6c916d857.tar.gz
Add update-android-global-lint-checker.sh script
AndroidGlobalLintChecker.jar is published from frameworks/base, and exposes lint checks that should be run across the tree. Add an update script to retrieve this file from the given build number, commit the changes, and provide a link to the build URL in the commit message. Bug: 236558918 Test: tested manually, treehugger Change-Id: Ic895dff3f67576a6c709a5530b1fa860c94f04a4
-rwxr-xr-xupdate-android-global-lint-checker.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/update-android-global-lint-checker.sh b/update-android-global-lint-checker.sh
new file mode 100755
index 0000000..1882dce
--- /dev/null
+++ b/update-android-global-lint-checker.sh
@@ -0,0 +1,41 @@
+#!/bin/bash -e
+
+# Copyright 2022 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
+
+/google/data/ro/projects/android/fetch_artifact \
+ --bid ${BUILD_NUMBER} \
+ --target aosp_arm64-userdebug \
+ AndroidGlobalLintChecker.jar
+
+git add AndroidGlobalLintChecker.jar
+git commit -m "Update AndroidGlobalLintChecker to ab/${BUILD_NUMBER}
+
+https://ci.android.com/builds/submitted/${BUILD_NUMBER}/aosp_arm64-userdebug/latest
+
+Test: treehugger"