Misc build system and CI changes

This commit is contained in:
snake-4
2024-05-03 18:10:02 +02:00
parent 3a72258df4
commit 8c7f376f16
3 changed files with 24 additions and 21 deletions

View File

@@ -13,7 +13,8 @@ val abiList: List<String> by rootProject.extra
android {
namespace = "com.example.library"
compileSdkVersion = "android-31"
compileSdkVersion = "android-34"
ndkVersion = "26.3.11579264"
defaultConfig {
minSdk = 21
externalNativeBuild {
@@ -35,11 +36,11 @@ androidComponents.onVariants { variant ->
val buildTypeLowered = variant.buildType?.lowercase()
val libOutDir = layout.buildDirectory.dir("intermediates/stripped_native_libs/$variantLowered/strip${variantCapped}DebugSymbols/out/lib").get()
val moduleDir = layout.buildDirectory.dir("outputs/module/$variantLowered").get()
val zipOutDir = layout.buildDirectory.dir("outputs/release").get()
val moduleDir = layout.buildDirectory.dir("out/$variantLowered").get()
val zipOutDir = layout.buildDirectory.dir("out/").get()
val zipFileName = "$moduleName-$verName-$commitHash-$buildTypeLowered.zip".replace(' ', '-')
val prepareModuleFilesTask = task<Sync>("prepareModuleFiles$variantCapped") {
val moduleFilesTask = task<Sync>("moduleFiles$variantCapped") {
group = "module"
dependsOn("assemble$variantCapped")
into(moduleDir)
@@ -68,9 +69,9 @@ androidComponents.onVariants { variant ->
}
}
task<Zip>("zip$variantCapped") {
task<Zip>("moduleZip$variantCapped") {
group = "module"
dependsOn(prepareModuleFilesTask)
dependsOn(moduleFilesTask)
archiveFileName.set(zipFileName)
destinationDirectory.set(zipOutDir)
from(moduleDir)