Skip to content

saveOn target not called through defaultTasks() function to update version.properties #33

@nagkumar

Description

@nagkumar
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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions