Skip to content

Commit

Permalink
gradle: Build variants
Browse files Browse the repository at this point in the history
  • Loading branch information
mikooomich committed Jun 5, 2024
1 parent fb286b5 commit 8712d10
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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/
46 changes: 46 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8712d10

Please sign in to comment.