summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2022-04-19 15:44:08 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2022-04-20 05:19:20 +0200
commit76d50f83274549002cedc7dc6ded0e3eac7c277c (patch)
treedc53cdffaba2a9fb8a3f4ae11e73d4894c6c2a42 /configure.ac
parent128de1949ff120ac925dbb06e398fa992fb295ba (diff)
android: Stop using ANDROID_SDK_HOME env variable
Otherwise, upgrading to Android Gradle Plugin 7.1.3 and gradle 7.2 (which will be done in a follow-up commit) would make the build fail like this: > FAILURE: Build failed with an exception. > > * Where: > Build file '/home/michi/development/git/libreoffice-WORKTREE-for-android-x86/android/source/build.gradle' line: 1 > > * What went wrong: > A problem occurred evaluating root project 'source'. > > Failed to apply plugin 'com.android.internal.application'. > > ANDROID_SDK_HOME is set to the root of your SDK: /home/michi/Android/Sdk > ANDROID_SDK_HOME was meant to be the parent path of the preference folder expected by the Android tools. > It is now deprecated. > > To set a custom preference folder location, use ANDROID_USER_HOME. > > It should NOT be set to the same directory as the root of your SDK. > To set a custom SDK location, use ANDROID_HOME. We don't actually rely on `ANDROID_SDK_HOME` being evaluated by the Android toolchain, but it used to be set in configure.ac, and the value was then assigned to the `sdk.dir` property written to `android/source/local.properties`. Just use a new variable name `ANDROID_SDK_DIR` and keep the mechanism otherwise unchanged for now. Change-Id: I44826621a1342119d40036fb704d8ff1eeed7c77 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133178 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac18
1 files changed, 9 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index 151a894537ee..a5ca807b9036 100644
--- a/configure.ac
+++ b/configure.ac
@@ -789,15 +789,15 @@ AC_SUBST(ANDROID_GCC_TOOLCHAIN_VERSION)
dnl ===================================================================
dnl --with-android-sdk
dnl ===================================================================
-ANDROID_SDK_HOME=
+ANDROID_SDK_DIR=
if test -z "$with_android_sdk" -a -e "$SRC_ROOT/external/android-sdk-linux" -a "$build" != "$host"; then
with_android_sdk="$SRC_ROOT/external/android-sdk-linux"
fi
if test -n "$with_android_sdk"; then
- eval ANDROID_SDK_HOME=$with_android_sdk
- PATH="$ANDROID_SDK_HOME/platform-tools:$ANDROID_SDK_HOME/tools:$PATH"
+ eval ANDROID_SDK_DIR=$with_android_sdk
+ PATH="$ANDROID_SDK_DIR/platform-tools:$ANDROID_SDK_DIR/tools:$PATH"
fi
-AC_SUBST(ANDROID_SDK_HOME)
+AC_SUBST(ANDROID_SDK_DIR)
AC_ARG_ENABLE([android-lok],
AS_HELP_STRING([--enable-android-lok],
@@ -1238,19 +1238,19 @@ if test "$_os" = "Android" ; then
AC_MSG_ERROR([the --with-android-ndk option does not point to an Android NDK])
fi
- if test -z "$ANDROID_SDK_HOME"; then
+ if test -z "$ANDROID_SDK_DIR"; then
AC_MSG_ERROR([the --with-android-sdk option is mandatory, unless it is available at external/android-sdk-linux/.])
- elif test ! -d "$ANDROID_SDK_HOME/platforms"; then
+ elif test ! -d "$ANDROID_SDK_DIR/platforms"; then
AC_MSG_ERROR([the --with-android-sdk option does not point to an Android SDK])
fi
BUILD_TOOLS_VERSION=`$SED -n -e 's/.*buildToolsVersion "\(.*\)"/\1/p' $SRC_ROOT/android/source/build.gradle`
- if test ! -d "$ANDROID_SDK_HOME/build-tools/$BUILD_TOOLS_VERSION"; then
+ if test ! -d "$ANDROID_SDK_DIR/build-tools/$BUILD_TOOLS_VERSION"; then
AC_MSG_WARN([android build-tools $BUILD_TOOLS_VERSION not found - install with
- $ANDROID_SDK_HOME/tools/android update sdk -u --all --filter build-tools-$BUILD_TOOLS_VERSION
+ $ANDROID_SDK_DIR/tools/android update sdk -u --all --filter build-tools-$BUILD_TOOLS_VERSION
or adjust change $SRC_ROOT/android/source/build.gradle accordingly])
add_warning "android build-tools $BUILD_TOOLS_VERSION not found - install with"
- add_warning " $ANDROID_SDK_HOME/tools/android update sdk -u --all --filter build-tools-$BUILD_TOOLS_VERSION"
+ add_warning " $ANDROID_SDK_DIR/tools/android update sdk -u --all --filter build-tools-$BUILD_TOOLS_VERSION"
add_warning "or adjust $SRC_ROOT/android/source/build.gradle accordingly"
fi
fi