diff --git a/buildSrc/src/main/kotlin/custom/Auth.kt b/buildSrc/src/main/kotlin/custom/Auth.kt index 00754d5e1..9cdd62e1c 100644 --- a/buildSrc/src/main/kotlin/custom/Auth.kt +++ b/buildSrc/src/main/kotlin/custom/Auth.kt @@ -120,12 +120,12 @@ class Transaction( }).execute().prettyPrint() @Suppress("DEPRECATION") - fun addBundleToTrackInDraft(versionCode: Int, versionName: String?): Track = + fun addBundleToTrackInDraft(versionCode: Int?, versionName: String?): Track = publisher.edits().tracks().update(packageName, editId, "internal", Track().apply { releases = listOf(TrackRelease().apply { status = "draft" name = versionName - versionCodes = listOf(versionCode.toLong()) + versionCodes = listOf(versionCode?.toLong()) }) track = "internal" }).execute().prettyPrint() diff --git a/custom/build.gradle.kts b/custom/build.gradle.kts index c2edf5e39..f39b25bea 100644 --- a/custom/build.gradle.kts +++ b/custom/build.gradle.kts @@ -36,7 +36,7 @@ android { } File("$projectDir/../install_time_asset_for_dwds/src/main/assets", "$name.zim").let { createDownloadTaskForPlayAssetDelivery(it) - createPublishBundleWithAssetPlayDelivery(applicationVariants) + createPublishBundleWithAssetPlayDelivery() } } } @@ -48,11 +48,6 @@ android { enableSplit = false } } - splits { - abi { - isUniversalApk = true - } - } assetPacks += ":install_time_asset_for_dwds" } @@ -192,9 +187,7 @@ fun DomainObjectSet.releaseVariantsFor(productFlavor: Produc find { it.name.equals("${productFlavor.name}Release", true) }!! .outputs.filterIsInstance().sortedBy { it.versionCodeOverride } -fun ProductFlavor.createPublishBundleWithAssetPlayDelivery( - applicationVariants: DomainObjectSet -): Task { +fun ProductFlavor.createPublishBundleWithAssetPlayDelivery(): Task { val capitalizedName = name.replaceFirstChar { if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else "$it" } return tasks.create("publish${capitalizedName}ReleaseBundleWithPlayAssetDelivery") { @@ -205,8 +198,6 @@ fun ProductFlavor.createPublishBundleWithAssetPlayDelivery( println("packageName $packageName") createPublisher(File(rootDir, "playstore.json")) .transactionWithCommit(packageName) { - val variants = - applicationVariants.releaseVariantsFor(this@createPublishBundleWithAssetPlayDelivery) val generatedBundleFile = File( "$buildDir/outputs/bundle/${capitalizedName.lowercase(Locale.getDefault())}" + @@ -214,7 +205,7 @@ fun ProductFlavor.createPublishBundleWithAssetPlayDelivery( ) if (generatedBundleFile.exists()) { uploadBundle(generatedBundleFile) - addBundleToTrackInDraft(variants[0].versionCode, versionName) + addBundleToTrackInDraft(versionCode, versionName) } else { throw FileNotFoundException("Unable to find generated aab file") }