android/Bootstrap/Makefile.shared                       |    4 +--
 android/Makefile                                        |    2 -
 android/source/Makefile                                 |    4 +--
 android/source/build.gradle                             |    4 +--
 android/source/gradle/wrapper/gradle-wrapper.properties |    2 -
 config_host.mk.in                                       |    2 -
 configure.ac                                            |   18 ++++++++--------
 7 files changed, 18 insertions(+), 18 deletions(-)

New commits:
commit 39326bc7d439170dd24c9d4b837c2cdb720b5d6f
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Tue Apr 19 15:49:53 2022 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Wed Apr 20 05:19:36 2022 +0200

    android: Update Android Gradle Plugin to 7.1.3
    
    ... and gradle to 7.2, which is what Android Studio suggested
    and did automatically when confirming.
    
    Also apply the following optional, but recommended change
    while doing so:
    
    > Migrate from lintOptions to lint
    > Configuration related to lint is now performed using the lint block.
    
    Change-Id: Ia982d72d877e229c3006c6d528b830d16c88481f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133179
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/android/source/build.gradle b/android/source/build.gradle
index 6b7391d5e389..47661f79c4cc 100644
--- a/android/source/build.gradle
+++ b/android/source/build.gradle
@@ -16,7 +16,7 @@ buildscript {
         google()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:3.6.1'
+        classpath 'com.android.tools.build:gradle:7.1.3'
     }
 }
 
@@ -81,7 +81,7 @@ android {
         }
         fullUI.dimension "default"
     }
-    lintOptions {
+    lint {
         // don't error-out on missing translations
         warning 'MissingTranslation'
     }
diff --git a/android/source/gradle/wrapper/gradle-wrapper.properties 
b/android/source/gradle/wrapper/gradle-wrapper.properties
index 7d1cfd365805..2d5e5400a6ed 100644
--- a/android/source/gradle/wrapper/gradle-wrapper.properties
+++ b/android/source/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
commit 76d50f83274549002cedc7dc6ded0e3eac7c277c
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Tue Apr 19 15:44:08 2022 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Wed Apr 20 05:19:20 2022 +0200

    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.wegh...@posteo.de>

diff --git a/android/Bootstrap/Makefile.shared 
b/android/Bootstrap/Makefile.shared
index 18082ea30ea3..83a2383581e4 100644
--- a/android/Bootstrap/Makefile.shared
+++ b/android/Bootstrap/Makefile.shared
@@ -24,7 +24,7 @@ OBJLOCAL=$(BUILDDIR)/android/obj/local/$(ANDROID_APP_ABI)
 
 local.properties: $(BUILDDIR)/config_host.mk
        echo ndk.dir=$(ANDROID_NDK_DIR) >local.properties
-       echo sdk.dir=$(ANDROID_SDK_HOME) >>local.properties
+       echo sdk.dir=$(ANDROID_SDK_DIR) >>local.properties
 
 #
 # Build / link the single .so for this app
@@ -84,7 +84,7 @@ link-so: $(SODEST)/liblo-native-code.so 
$(SODEST)/nss-libraries $(SODEST)/libc++
 # can't "stop" a device anyway.)
 
 stop-start-cycle:
-       $(ANDROID_SDK_HOME)/platform-tools/adb shell stop && 
$(ANDROID_SDK_HOME)/platform-tools/adb shell start && sleep 10
+       $(ANDROID_SDK_DIR)/platform-tools/adb shell stop && 
$(ANDROID_SDK_DIR)/platform-tools/adb shell start && sleep 10
 
 # build-host specific stuff (build paths and the like) to keep build.gradle 
static
 liboSettings.gradle: $(BUILDDIR)/config_build.mk $(BUILDDIR)/config_host.mk
diff --git a/android/Makefile b/android/Makefile
index 288932bbe1b6..796f8092959b 100644
--- a/android/Makefile
+++ b/android/Makefile
@@ -24,7 +24,7 @@ release-apk: build
 
        # the actual signing
        jarsigner --verbose -verbose -sigalg SHA1withRSA -digestalg SHA1 
-keystore ~/.keystore 
$(BUILDDIR)/android/source/build/outputs/apk/LibreOfficeViewer-strippedUI-release-unsigned.apk
 $(key)
-       $(ANDROID_SDK_HOME)/build-tools/*/zipalign -v 4 
$(BUILDDIR)/android/source/build/outputs/apk/LibreOfficeViewer-strippedUI-release-unsigned.apk
 $(SIGNED_APK)
+       $(ANDROID_SDK_DIR)/build-tools/*/zipalign -v 4 
$(BUILDDIR)/android/source/build/outputs/apk/LibreOfficeViewer-strippedUI-release-unsigned.apk
 $(SIGNED_APK)
 
        @echo
        @echo "Resulting signed apk: $(SIGNED_APK)"
diff --git a/android/source/Makefile b/android/source/Makefile
index 5d6603f94738..1dc1b42d187b 100644
--- a/android/source/Makefile
+++ b/android/source/Makefile
@@ -20,7 +20,7 @@ install:
        @if test "$$ENABLE_ANDROID_LOK" != "TRUE" ; then echo ; echo 'Run it 
with "make run"' ; echo ; fi
 
 uninstall:
-       $(ANDROID_SDK_HOME)/platform-tools/adb uninstall $(ANDROID_PACKAGE_NAME)
+       $(ANDROID_SDK_DIR)/platform-tools/adb uninstall $(ANDROID_PACKAGE_NAME)
 
 clean:
        rm -rf assets assets_fullUI assets_strippedUI jniLibs jniLibs_debug 
$(OBJLOCAL)
@@ -33,7 +33,7 @@ ifeq ($(ENABLE_JAVA),TRUE)
 endif
 
 run:
-       if test "$$ENABLE_ANDROID_LOK" != "TRUE" ; then 
$(ANDROID_SDK_HOME)/platform-tools/adb shell am start -n 
$(ANDROID_PACKAGE_NAME)/org.libreoffice.ui.LibreOfficeUIActivity ; fi
+       if test "$$ENABLE_ANDROID_LOK" != "TRUE" ; then 
$(ANDROID_SDK_DIR)/platform-tools/adb shell am start -n 
$(ANDROID_PACKAGE_NAME)/org.libreoffice.ui.LibreOfficeUIActivity ; fi
 
 debugrun:
        @echo "please debug with lldb from within Android Studio, or setup 
ndk-gdb manually (see android/README for details)"
diff --git a/config_host.mk.in b/config_host.mk.in
index 7552991e366b..8d7fe3c12865 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -17,7 +17,7 @@ export ABW_CFLAGS=$(gb_SPACE)@ABW_CFLAGS@
 export ABW_LIBS=$(gb_SPACE)@ABW_LIBS@
 export ANDROID_NDK_DIR=@ANDROID_NDK_DIR@
 export ANDROID_APP_ABI=@ANDROID_APP_ABI@
-export ANDROID_SDK_HOME=@ANDROID_SDK_HOME@
+export ANDROID_SDK_DIR=@ANDROID_SDK_DIR@
 export ANDROID_PACKAGE_NAME=@ANDROID_PACKAGE_NAME@
 export ANDROID_BINUTILS_PREBUILT_ROOT=@ANDROID_BINUTILS_PREBUILT_ROOT@
 export ANDROID_GCC_TOOLCHAIN_VERSION=@ANDROID_GCC_TOOLCHAIN_VERSION@
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

Reply via email to