androidx-studio-integration-host-tests setting ANDROID_HOME
It turns out that the tests need it
Bug: 229159763
Test: STUDIO_DIR=../studio-main ./busytown/androidx-studio-integration-host-tests.sh # then unzip activity-activity-compose-lint_test.zip and open activity-activity-compose-lint_test.zip_unzipped/classes/androidx.activity.compose.lint.ActivityResultLaunchDetectorTest.html and see that it didn't fail
Change-Id: If78d6d774174b9c6ab108bc1b3bf0bcf054e9bb0
diff --git a/busytown/impl/build-studio-and-androidx.sh b/busytown/impl/build-studio-and-androidx.sh
index a5d6a12..4417da6 100755
--- a/busytown/impl/build-studio-and-androidx.sh
+++ b/busytown/impl/build-studio-and-androidx.sh
@@ -5,10 +5,10 @@
androidxArguments="$*"
-WORKING_DIR="$(pwd)"
SCRIPTS_DIR="$(cd $(dirname $0)/.. && pwd)"
cd "$SCRIPTS_DIR/../../.."
echo "Script running from $(pwd)"
+ANDROIDX_DIR="$(pwd)"
# Resolve JDK folders for host OS
STUDIO_JDK="linux"
@@ -33,7 +33,7 @@
mkdir -p "$GRADLE_USER_HOME"
if [ "$STUDIO_DIR" == "" ]; then
- STUDIO_DIR="$WORKING_DIR"
+ STUDIO_DIR="$ANDROIDX_DIR"
else
STUDIO_DIR="$(cd $STUDIO_DIR && pwd)"
fi
@@ -41,6 +41,15 @@
TOOLS_DIR=$STUDIO_DIR/tools
gw="$TOOLS_DIR/gradlew -Dorg.gradle.jvmargs=-Xmx24g"
+plat="linux"
+case "`uname`" in
+ Darwin* )
+ plat="darwin"
+ ;;
+esac
+
+export ANDROID_HOME="$ANDROIDX_DIR/prebuilts/fullsdk-$plat"
+
function buildStudio() {
STUDIO_BUILD_LOG="$OUT_DIR/studio.log"
if JAVA_HOME="$STUDIO_DIR/prebuilts/studio/jdk/jdk11/$STUDIO_JDK" $gw -p $TOOLS_DIR publishLocal --stacktrace --no-daemon > "$STUDIO_BUILD_LOG" 2>&1; then