saveOn target not called through defaultTasks() function to update version.properties including the build number
allprojects {
afterEvaluate {
group = prjGroup
var verE = rootProject.extensions.getByName("versioning") as VersioningExtension
version = "${verE.major}.${verE.minor}.${verE.build}-${verE.preRelease}"
}
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/nagkumar/java")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
gradlePluginPortal()
mavenCentral()
}
defaultTasks("clean", "build", "publish")
}
The version.properties is not being updated when we use the command, but that internally calls clean, build, publish when my definition is
versioning {
preRelease= "SNAPSHOT"
saveOn = "publish"
}
The same definition works fine i.e. it updates the properties file when I call the full command as
gradle clean build publish
fix should be in
eu.davidea.gradle.GrabVer#readUserConfiguration
val requestedTasks: List<String> = project.gradle.startParameter.taskNames
if (requestedTasks.isEmpty()) {
// No explicit tasks requested, so Gradle will run defaultTasks
val defaultTasks = project.defaultTasks
println("No requested tasks; default tasks to be run: $defaultTasks")
} else {
println("Requested tasks: $requestedTasks")
}
Must check the even project.defaultTasks
In short change line 122 to
List<String> runTasks = project.gradle.startParameter.taskNames + project.defaultTasks
Could you fix and release a new version please.
can you pl. fix it ..waiting for you to respond..
hi.. hope you are active.. and willing to consider to fix this bug.. kindly revert..