diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2022-04-20 08:31:33 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2022-04-20 10:46:22 +0200 |
commit | c6fada2bfe38dc8b10908ad95b999b2092c841c5 (patch) | |
tree | 0ad37f7251798a3ace3fb5c49090640d77d98ae6 /android | |
parent | 19363c84e0f9a19e3114cdac2393c81d58865daf (diff) |
android: Use android.ndkPath property to set path to NDK
Quoting from
commit 128de1949ff120ac925dbb06e398fa992fb295ba
Date: Tue Apr 19 15:18:49 2022 +0200
android: Use property instead of ANDROID_NDK_HOME env var
which ported from an obsolete (no longer supported by
current Gradle versions) way of setting the NDK path to a
deprecated but still supported one as an intermediate step
to allow upgrading Gradle:
> Note however, that with this approach of using the `ndk.dir`
> property instead of the suggested `android.ndkVersion`
> (with the latter having the stricter requirement that
> the `ndk` dir would have to be a subdir of the SDK dir),
> doing the actual upgrade to a newer Gradle (plugin) version
> in follow-up commit
> Change-Id Ia982d72d877e229c3006c6d528b830d16c88481f
> "android: Update Android Gradle Plugin to 7.1.3"
> revealed that the use of the `ndk.dir` property
> is deprecated in newer Gradle (plugin) versions as well,
> resulting in this warning.
>
> > > Task :stripStrippedUIDebugDebugSymbols
> > [CXX5106] NDK was located by using ndk.dir property. This method is
> > deprecated and will be removed in a future release. Please delete
> > ndk.dir from local.properties and set android.ndkVersion to
> > [20.0.5594570] in all native modules in the project.
> > https://developer.android.com/r/studio-ui/ndk-dir
>
> It might make sense to address that in a follow-up step,
> but for now, it's an improvement and keeps it working
> after the upgrade without potentially causing any incompatibility
> problems with existing autogen configurations,
> while support for the `ANDROID_NDK_HOME` env var that was
> used so far seems to have been dropped, [...].
The release notes for Android Gradle Plugin version 4.1.0
mention yet another way of setting an explicit NDK path
instead of just a version and that one is still supported
and not deprecated [1]:
> # Set the NDK path
> You can set the path to your local NDK installation using the
> android.ndkPath property in your module's build.gradle file.
>
> android {
> ndkPath "your-custom-ndk-path"
> }
>
> If you use this property together with the android.ndkVersion property,
> then this path must contain an NDK version that matches
> android.ndkVersion.
Therefore, switch to setting the NDK path using the `android.ndkPath`
property in liboSettings.gradle instead of the deprecated `ndk.dir`
in local.properties.
[1] https://developer.android.com/studio/releases/gradle-plugin?buildsystem=ndk-build#ndk-path
Change-Id: I34690ca8e15ff4742bab9a716a58b9ad85fa86e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133197
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'android')
-rw-r--r-- | android/Bootstrap/Makefile.shared | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/android/Bootstrap/Makefile.shared b/android/Bootstrap/Makefile.shared index 74121e6f03b4..f9825b583c05 100644 --- a/android/Bootstrap/Makefile.shared +++ b/android/Bootstrap/Makefile.shared @@ -23,8 +23,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_DIR) >>local.properties + echo sdk.dir=$(ANDROID_SDK_DIR) >local.properties # # Build / link the single .so for this app @@ -106,6 +105,9 @@ liboSettings.gradle: $(BUILDDIR)/config_build.mk $(BUILDDIR)/config_host.mk && echo " liboVersionMinor = '$(LIBO_VERSION_MINOR)'" \ && echo " liboGitFullCommit = '$(shell cd $(SRCDIR) && git log -1 --format=%H)'" \ && echo "}" \ + && echo "android {" \ + && echo " ndkPath '$(ANDROID_NDK_DIR)'" \ + && echo "}" \ && echo "android.defaultConfig {" \ && echo " applicationId '$(ANDROID_PACKAGE_NAME)'" \ && echo " archivesBaseName = 'LibreOfficeViewer'" \ |