Skip to content

Commit

Permalink
Use project.version as default for createSaganRelease task
Browse files Browse the repository at this point in the history
  • Loading branch information
sjohnr committed Oct 16, 2023
1 parent e242dec commit 67935d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 2 additions & 2 deletions gradle-plugin/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ The following command will perform a dry-run and provide output of what creating
=== `createSaganRelease`

Create a new release version for the current project on spring.io using the Sagan API.
This task uses the configured `referenceDocUrl` and `apiDocUrl` values from the DSL.
This task uses the configured `referenceDocUrl`, `apiDocUrl` and `replaceSnapshotVersionInReferenceDocUrl` values from the DSL.

The following command will create a new release version:

Expand All @@ -196,7 +196,7 @@ The following command will create a new release version:

*Task properties:*

* `nextVersion`: Specify the version used to create the release (optional, uses <<getNextReleaseMilestone>> if not specified)
* `nextVersion`: Specify the version used to create the release (optional, uses `project.version` if not specified)
* `gitHubAccessToken`: A personal access token used to access the Sagan API (required)

*Full example:*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import com.github.api.Repository;
import io.spring.gradle.plugin.core.ProjectUtils;
import io.spring.gradle.plugin.core.RegularFileUtils;
import io.spring.release.SpringReleases;
import org.gradle.api.DefaultTask;
import org.gradle.api.Project;
Expand Down Expand Up @@ -85,9 +84,7 @@ public static void register(Project project) {

// @formatter:off
var versionProvider = ProjectUtils.getProperty(project, SpringReleasePlugin.NEXT_VERSION_PROPERTY)
.orElse(ProjectUtils.findTaskByType(project, GetNextReleaseMilestoneTask.class)
.getNextReleaseMilestoneFile()
.map(RegularFileUtils::readString));
.orElse(project.getRootProject().getVersion().toString());
// @formatter:on

var owner = springRelease.getRepositoryOwner().get();
Expand Down

0 comments on commit 67935d8

Please sign in to comment.