I am updating a defaults plugin for our projects and noticed that this plugin needs to decide during Gradle configuration time which Maven repository should be used based on the project version. This check triggers reckon to compute the version which could take some time since git work is involved.
The defaults plugin basically does:
project.getExtensions.configure(PublishingExtension.class, publishing -> {
// .....
publishing.repositories(artifactRepositories -> {
artifactRepositories.maven(mavenArtifactRepository -> {
// -----------
// reckon is triggered here and I would like to avoid it somehow
// -----------
var isSnapshotPublication = prj.getVersion().toString().endsWith("SNAPSHOT");
var repo = isSnapshotPublication ? "snapshots" : "releases";
mavenArtifactRepository.setUrl("https://example.com/maven/" + repo);
});
});
});
Of course I could use some logic to read the reckon.stage property but then I would replicate what reckon is already doing and have the risk that my logic might become incorrect if reckon changes in the future. So I would like to see some public API in reckon that does not evaluate the actual version number using git but instead only evaluates if it's a release or a snapshot version.
I am updating a defaults plugin for our projects and noticed that this plugin needs to decide during Gradle configuration time which Maven repository should be used based on the project version. This check triggers reckon to compute the version which could take some time since git work is involved.
The defaults plugin basically does:
Of course I could use some logic to read the
reckon.stage
property but then I would replicate what reckon is already doing and have the risk that my logic might become incorrect if reckon changes in the future. So I would like to see some public API in reckon that does not evaluate the actual version number using git but instead only evaluates if it's a release or a snapshot version.