Add an integration script for testing ToT Android Lint
Bug: 155516635
Test: ./tools/metalava/androidx-studio-integration.sh
Change-Id: Ia284c85e907e2087f2db73996de2bbbd01287c84
diff --git a/androidx-studio-integration.sh b/androidx-studio-integration.sh
new file mode 100755
index 0000000..35ad2d7
--- /dev/null
+++ b/androidx-studio-integration.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+set -e
+
+cd "$(dirname $0)/../../"
+SCRIPT_DIR="$(pwd)"
+echo "Script running from $(pwd)"
+
+# resolve DIST_DIR
+if [ -z "$DIST_DIR" ]; then
+ DIST_DIR="$SCRIPT_DIR/out/dist"
+fi
+mkdir -p "$DIST_DIR"
+
+export OUT_DIR=out
+export DIST_DIR="$DIST_DIR"
+
+JAVA_HOME="$(pwd)/prebuilts/studio/jdk/linux" tools/gradlew -p tools/ publishLocal --stacktrace
+
+export LINT_VERSION=`grep -oP "(?<=baseVersion = ).*" tools/buildSrc/base/version.properties`
+export LINT_REPO="$(pwd)/out/repo"
+
+tools/gradlew -p tools/metalava --no-daemon --stacktrace -PlintRepo=$LINT_REPO -PlintVersion=$LINT_VERSION