Skip to content

Commit

Permalink
[Task] Android process tasks now depend on versioning tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
OffRange committed May 27, 2024
1 parent a9d9c10 commit bb8d0bc
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,25 @@ class VersioningPlugin @Inject constructor(private val objectFactory: ObjectFact
addDependencies()
createVersionProviderFile(nextVersion, ext.computedVersionCode)

tasks.register<VersionPrinter>("printVersion") {
val versionPrinter = tasks.register<VersionPrinter>("printVersion") {
versionCodeGenerator = ext.versionCodeGenerator
version = target.version as Version
}

tasks.register("generateVersionProviderFile") {
val generatorTask = tasks.register("generateVersionProviderFile") {
description =
"Generates a Kotlin file that provides functions to receive the version of the current project"
group = "versioning"

dependsOn(versionPrinter.get())
doLast {
createVersionProviderFile(nextVersion, ext.computedVersionCode)
}
}

project.tasks.matching { it.name.startsWith("process") }.configureEach {
dependsOn(generatorTask)
}
}
}

Expand Down

0 comments on commit bb8d0bc

Please sign in to comment.