aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/deploy_snapshot.yml2
-rw-r--r--build-logic/android-plugins/src/main/kotlin/app/passwordstore/gradle/RenameArtifactsPlugin.kt9
2 files changed, 7 insertions, 4 deletions
diff --git a/.github/workflows/deploy_snapshot.yml b/.github/workflows/deploy_snapshot.yml
index 7bf57d1b..b87eefb5 100644
--- a/.github/workflows/deploy_snapshot.yml
+++ b/.github/workflows/deploy_snapshot.yml
@@ -35,7 +35,7 @@ jobs:
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
with:
- arguments: collectFreeReleaseApks collectNonFreeReleaseApks -PsentryUploadMappings
+ arguments: collectFreeReleaseApks collectNonFreeReleaseApks collectFreeReleaseBundle collectNonFreeReleaseBundle -PsentryUploadMappings
gradle-home-cache-cleanup: true
- name: Clean secrets
diff --git a/build-logic/android-plugins/src/main/kotlin/app/passwordstore/gradle/RenameArtifactsPlugin.kt b/build-logic/android-plugins/src/main/kotlin/app/passwordstore/gradle/RenameArtifactsPlugin.kt
index 04eb57e3..6807b6ef 100644
--- a/build-logic/android-plugins/src/main/kotlin/app/passwordstore/gradle/RenameArtifactsPlugin.kt
+++ b/build-logic/android-plugins/src/main/kotlin/app/passwordstore/gradle/RenameArtifactsPlugin.kt
@@ -4,7 +4,7 @@ import app.passwordstore.gradle.artifacts.CollectApksTask
import app.passwordstore.gradle.artifacts.CollectBundleTask
import com.android.build.api.artifact.SingleArtifact
import com.android.build.api.variant.ApplicationAndroidComponentsExtension
-import com.android.build.gradle.internal.dsl.BaseAppModuleExtension
+import com.android.build.api.variant.VariantOutputConfiguration
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.getByType
@@ -15,7 +15,6 @@ class RenameArtifactsPlugin : Plugin<Project> {
override fun apply(project: Project) {
project.pluginManager.withPlugin("com.android.application") {
- val android = project.extensions.getByType<BaseAppModuleExtension>()
project.extensions.getByType<ApplicationAndroidComponentsExtension>().run {
onVariants { variant ->
project.tasks.register<CollectApksTask>("collect${variant.name.capitalize()}Apks") {
@@ -25,8 +24,12 @@ class RenameArtifactsPlugin : Plugin<Project> {
outputDirectory.set(project.layout.projectDirectory.dir("outputs"))
}
project.tasks.register<CollectBundleTask>("collect${variant.name.capitalize()}Bundle") {
+ val mainOutput =
+ variant.outputs.single {
+ it.outputType == VariantOutputConfiguration.OutputType.SINGLE
+ }
variantName.set(variant.name)
- versionName.set(android.defaultConfig.versionName)
+ versionName.set(mainOutput.versionName)
bundleFile.set(variant.artifacts.get(SingleArtifact.BUNDLE))
outputDirectory.set(project.layout.projectDirectory.dir("outputs"))
}