From bb8d0bc46b8f8bbc4a80bc82d92ad364be67bf20 Mon Sep 17 00:00:00 2001 From: Davis Date: Mon, 27 May 2024 12:10:27 +0200 Subject: [PATCH] [Task] Android process tasks now depend on versioning tasks --- .../davis/gradle/plugin/versioning/VersioningPlugin.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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) + } } }