From 045aeac1dd01df12dec7b1ef8191b3193cf4273c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Wed, 4 Jan 2023 10:01:08 +0200 Subject: [PATCH] Switch building of the unittest from Ant to Gradle (#3612) This was missed in b16f0c23213237c7957f47d605df4e2f4c4357a1 where the other targets were switched from Ant to Gradle. This fixes building after switching to a newer version of the Android SDK (suppporting Gradle) where Ant no longer is supported. --- Makefile | 6 ++++-- settings.gradle | 5 +++-- test/build/android/.gitignore | 1 + test/build/android/build.gradle | 12 ++++++++++++ 4 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 test/build/android/build.gradle diff --git a/Makefile b/Makefile index 3cb520465b..b9146c06f1 100644 --- a/Makefile +++ b/Makefile @@ -364,11 +364,13 @@ endif ifeq (android,$(OS)) ifeq (./,$(SRC_PATH)) codec_unittest$(EXEEXT): - cd ./test/build/android && $(NDKROOT)/ndk-build -B APP_ABI=$(APP_ABI) && android update project -t $(TARGET) -p . && ant debug + $(NDK_BUILD) -C test/build/android -B + ./gradlew unittest:assembleDebug clean_Android: clean_Android_ut clean_Android_ut: - -cd ./test/build/android && $(NDKROOT)/ndk-build APP_ABI=$(APP_ABI) clean && ant clean + -$(NDK_BUILD) -C test/build/android -B clean + -./gradlew unittest:clean endif endif diff --git a/settings.gradle b/settings.gradle index 4d1a5b8a8f..39e2726831 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,4 @@ -include ':test-dec', ':test-enc' +include ':test-dec', ':test-enc', ':unittest' project(':test-dec').projectDir = new File('codec/build/android/dec') -project(':test-enc').projectDir = new File('codec/build/android/enc') \ No newline at end of file +project(':test-enc').projectDir = new File('codec/build/android/enc') +project(':unittest').projectDir = new File('test/build/android') diff --git a/test/build/android/.gitignore b/test/build/android/.gitignore index 2c1dd5fcbc..f57f442770 100644 --- a/test/build/android/.gitignore +++ b/test/build/android/.gitignore @@ -4,3 +4,4 @@ proguard-project.txt gen bin project.properties +build diff --git a/test/build/android/build.gradle b/test/build/android/build.gradle new file mode 100644 index 0000000000..341bd1df42 --- /dev/null +++ b/test/build/android/build.gradle @@ -0,0 +1,12 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 29 + + sourceSets.main { + manifest.srcFile "AndroidManifest.xml" + res.srcDir "res" + java.srcDir "src" + jniLibs.srcDir "libs" + } +}