From 95678616f7970428e93eae68da5478af74263e4f Mon Sep 17 00:00:00 2001 From: Alexander Epaneshnikov Date: Wed, 2 Jun 2021 18:52:08 +0300 Subject: [PATCH] android: integrate ndk-build step into main gradle pipeline this greatly simplifies the assembly of the android application. moreover, ndk will be downloaded automatically via sdk-manager. --- Makefile.am | 9 +++------ android/build.gradle | 8 ++++++-- android/jni/Application.mk | 3 --- configure.ac | 3 --- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/Makefile.am b/Makefile.am index 96c6500b..5dca80f4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -379,16 +379,13 @@ phsource/phonemes.stamp: \ ##### android targets: -jni: - cd android && ndk-build - -apk-release: jni espeakdata +apk-release: espeakdata cd android && $(GRADLE) assembleRelease -apk-debug: jni espeakdata +apk-debug: espeakdata cd android && $(GRADLE) assembleDebug -apk-check: jni espeakdata +apk-check: espeakdata cd android && $(GRADLE) connectedCheck android/res/raw/espeakdata.zip: espeak-ng-data/phontab dictionaries diff --git a/android/build.gradle b/android/build.gradle index 40f68856..ccfa0bdb 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -21,7 +21,6 @@ dependencies { } android { - buildToolsVersion '28.0.3' compileSdkVersion 26 defaultConfig { @@ -31,12 +30,17 @@ android { versionName "1.52-dev" } + externalNativeBuild { + ndkBuild { + path "jni/Android.mk" + } + } + sourceSets { main { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = ['src'] res.srcDirs = ['res'] - jniLibs.srcDir 'libs' } androidTest.setRoot('eSpeakTests') androidTest { diff --git a/android/jni/Application.mk b/android/jni/Application.mk index 091c8c07..477f9faf 100644 --- a/android/jni/Application.mk +++ b/android/jni/Application.mk @@ -1,4 +1 @@ APP_OPTIM := release -APP_PLATFORM := android-26 -APP_TOOLCHAIN_VERSION := 4.6.3 -APP_ABI := armeabi-v7a x86 diff --git a/configure.ac b/configure.ac index 84caec35..7af4dc97 100644 --- a/configure.ac +++ b/configure.ac @@ -74,8 +74,6 @@ AC_PROG_MAKE_SET AC_PROG_LIBTOOL AC_PROG_LN_S -AC_CHECK_PROG(NDKBUILD_CHECK,[ndk-build],yes) - dnl ================================================================ dnl gradle checks. dnl ================================================================ @@ -362,7 +360,6 @@ AC_MSG_NOTICE([ PCAudioLib: ${have_pcaudiolib} gradle (Android): ${GRADLE} - ndk-build (Android): ${NDKBUILD_CHECK} Klatt: ${have_klatt} speechPlayer: ${have_speechplayer}