From 8712d10bbb9c9afbf67eed14cabbd080d7fb4769 Mon Sep 17 00:00:00 2001 From: mikooomich Date: Wed, 5 Jun 2024 13:18:37 -0400 Subject: [PATCH] gradle: Build variants --- .github/workflows/build.yml | 2 +- .gitignore | 9 +++++++- app/build.gradle.kts | 46 +++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 308c6ec36..4b7c9f67e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: cache: 'gradle' - name: Build debug APK and run jvm tests - run: ./gradlew assembleDebug lintDebug testDebugUnitTest --stacktrace -DskipFormatKtlint + run: ./gradlew assembleUniversalDebug lintUniversalDebug testUniversalDebugUnitTest --stacktrace -DskipFormatKtlint - name: Upload APK uses: actions/upload-artifact@v3 diff --git a/.gitignore b/.gitignore index 5e468a90c..7e85fead6 100755 --- a/.gitignore +++ b/.gitignore @@ -88,7 +88,14 @@ lint/outputs/ lint/tmp/ # lint/reports/ -.DS_Store +# build outputs /app/release/ +/app/universal +/app/arm64 +/app/uncommon_abi +/app/x86_64 + +# misc +.DS_Store app/src/main/java/com/dd3boh/outertune/utils/scanners/jni/ffmpeg-android-maker app/src/main/java/com/dd3boh/outertune/utils/scanners/jni/src/ diff --git a/app/build.gradle.kts b/app/build.gradle.kts index bbbcc2a6e..6272bf9d4 100755 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -39,6 +39,52 @@ android { buildConfig = true } +// build variants and stuff + splits { + abi { + isEnable = true + reset() + + // all common abis + // include("x86_64", "x86", "armeabi-v7a", "arm64-v8a") // universal + isUniversalApk = false + } + } + + flavorDimensions.add("abi") + + productFlavors { + // universal + create("universal") { + isDefault = true + dimension = "abi" + ndk { + abiFilters.addAll(listOf("x86", "x86_64", "armeabi-v7a", "arm64-v8a")) + } + } + // arm64 only + create("arm64") { + dimension = "abi" + ndk { + abiFilters.add("arm64-v8a") + } + } + // x86_64 only + create("x86_64") { + dimension = "abi" + ndk { + abiFilters.add("x86_64") + } + } + // for uncommon, but non-obscure architectures + create("uncommon_abi") { + dimension = "abi" + ndk { + abiFilters.addAll(listOf("x86", "x86_64", "armeabi-v7a")) + } + } + } + compileOptions { isCoreLibraryDesugaringEnabled = true sourceCompatibility = JavaVersion.VERSION_17