Skip to content

Commit

Permalink
fix: Only properties version and versionValue is now (#56)
Browse files Browse the repository at this point in the history
This allows getting an updated version after thre release task has run using the property semVersion (or versionValue).
  • Loading branch information
jmongard committed Jun 23, 2024
1 parent 7b01642 commit 8cfc131
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,24 +93,24 @@ abstract class GitSemverPluginExtension(project: Project, providerFactory: Provi
/**
* The semantic version for the project with commit info e.g. 1.2.3-Alpha.4+005.sha.7f8c962
*/
val semVersion: SemInfoVersion by lazy { semInfoVersionValueSource.get() }
val semVersion: SemInfoVersion
get() = semInfoVersionValueSource.get()

/**
* The semantic version for the project with commit info excluding sha as a string e.g. "1.2.3-Alpha.4+005"
*/
val infoVersion: String
get() = semVersion.toInfoVersionString()
val infoVersion: String by lazy { semVersion.toInfoVersionString() }

/**
* The semantic version for the project e.g. 1.2.3-Alpha.4
*/
val versionValue: SemVersion by lazy { semVersionValueSource.get() }
val versionValue: SemVersion
get() = semVersionValueSource.get()

/**
* The semantic version for the project as a string e.g. "1.2.3-Alpha.4"
*/
val version: String
get() = versionValue.toString()
val version: String by lazy { versionValue.toString() }

private var semInfoVersionValueSource = project.providers.of(SemInfoVersionValueSource::class.java) {
it.parameters.getGitDir().set(gitDir);
Expand Down

0 comments on commit 8cfc131

Please sign in to comment.