diff options
| author | Harsh Shandilya <me@msfjarvis.dev> | 2022-02-23 14:25:03 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-23 14:25:03 +0530 |
| commit | acc448ce740b3756c622daf35d7be8372e76cebb (patch) | |
| tree | d826cfae39eea5c71104e5a13cd94eea1783e36b /build-logic/android-plugins/src/main/kotlin/artifacts/CollectBundleTask.kt | |
| parent | f08ad35d2e26b3f222cca4f973a865bdd815eeb3 (diff) | |
| download | HardenedPass-acc448ce740b3756c622daf35d7be8372e76cebb.tar.gz HardenedPass-acc448ce740b3756c622daf35d7be8372e76cebb.zip | |
Use explicit Gradle tasks to handle build artifact collection (#1745)
Diffstat (limited to 'build-logic/android-plugins/src/main/kotlin/artifacts/CollectBundleTask.kt')
| -rw-r--r-- | build-logic/android-plugins/src/main/kotlin/artifacts/CollectBundleTask.kt | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/build-logic/android-plugins/src/main/kotlin/artifacts/CollectBundleTask.kt b/build-logic/android-plugins/src/main/kotlin/artifacts/CollectBundleTask.kt new file mode 100644 index 00000000..a735fb7b --- /dev/null +++ b/build-logic/android-plugins/src/main/kotlin/artifacts/CollectBundleTask.kt @@ -0,0 +1,30 @@ +package artifacts + +import org.gradle.api.DefaultTask +import org.gradle.api.file.DirectoryProperty +import org.gradle.api.file.RegularFileProperty +import org.gradle.api.provider.Property +import org.gradle.api.tasks.Input +import org.gradle.api.tasks.InputFile +import org.gradle.api.tasks.OutputDirectory +import org.gradle.api.tasks.TaskAction + +abstract class CollectBundleTask : DefaultTask() { + @get:InputFile abstract val bundleFile: RegularFileProperty + + @get:Input abstract val variantName: Property<String> + + @get:Input abstract val versionName: Property<String> + + @get:OutputDirectory abstract val outputDirectory: DirectoryProperty + + @TaskAction + fun taskAction() { + val outputDir = outputDirectory.asFile.get() + outputDir.mkdirs() + bundleFile + .get() + .asFile + .renameTo(outputDir.resolve("APS-${variantName.get()}-${versionName.get()}.aab")) + } +} |
