diff --git a/src/main/kotlin/de/davis/gradle/plugin/versioning/VersioningPlugin.kt b/src/main/kotlin/de/davis/gradle/plugin/versioning/VersioningPlugin.kt index 5770899..9d5c6c8 100644 --- a/src/main/kotlin/de/davis/gradle/plugin/versioning/VersioningPlugin.kt +++ b/src/main/kotlin/de/davis/gradle/plugin/versioning/VersioningPlugin.kt @@ -21,20 +21,25 @@ class VersioningPlugin @Inject constructor(private val objectFactory: ObjectFact addDependencies() createVersionProviderFile(nextVersion, ext.computedVersionCode) - tasks.register("printVersion") { + val versionPrinter = tasks.register("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) + } } }