11import com.android.build.gradle.internal.api.BaseVariantOutputImpl
2+ import com.android.build.gradle.internal.tasks.FinalizeBundleTask
23import io.gitlab.arturbosch.detekt.Detekt
34import org.gradle.api.tasks.testing.logging.TestExceptionFormat
45import org.gradle.api.tasks.testing.logging.TestLogEvent
@@ -54,8 +55,8 @@ android {
5455 applicationId = " to.bitkit"
5556 minSdk = 28
5657 targetSdk = 36
57- versionCode = 172
58- versionName = " 2.0.0-rc.6 "
58+ versionCode = 174
59+ versionName = " 2.0.0"
5960 testInstrumentationRunner = " to.bitkit.test.HiltTestRunner"
6061 vectorDrawables {
6162 useSupportLibrary = true
@@ -163,6 +164,16 @@ android {
163164 excludes + = " META-INF/versions/9/OSGI-INF/MANIFEST.MF"
164165 }
165166 }
167+ splits {
168+ abi {
169+ isEnable = true
170+ reset()
171+ // Only architectures supported by native libs (ldk-node, bitkit-core)
172+ // x86 not supported; x86_64 only for debug/emulator
173+ include(" armeabi-v7a" , " arm64-v8a" )
174+ isUniversalApk = true
175+ }
176+ }
166177 testOptions {
167178 unitTests {
168179 isReturnDefaultValues = true // mockito
@@ -174,12 +185,27 @@ android {
174185 }
175186 applicationVariants.all {
176187 val variant = this
188+ val bitkit = " bitkit"
189+ val flavorName = variant.flavorName
190+ val variantName = variant.buildType.name
191+ val versionCode = defaultConfig.versionCode
177192 outputs
178193 .map { it as BaseVariantOutputImpl }
179194 .forEach { output ->
180- val apkName = " bitkit-android-${defaultConfig.versionCode} -${variant.name} .apk"
195+ val abi = output.getFilter(" ABI" ) ? : " universal"
196+ val apkName = " $bitkit -$flavorName -$variantName -$versionCode -$abi .apk"
181197 output.outputFileName = apkName
182198 }
199+
200+ // Rename AAB bundle
201+ tasks.named(
202+ " sign${variant.name.replaceFirstChar { it.uppercase() }} Bundle" ,
203+ FinalizeBundleTask ::class .java,
204+ ) {
205+ val aabName = " $bitkit -$flavorName -$variantName -$versionCode .aab"
206+ val outputDir = finalBundleFile.asFile.get().parentFile
207+ finalBundleFile.set(File (outputDir, aabName))
208+ }
183209 }
184210}
185211
0 commit comments