Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
Memoize the project version provider (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
Azurelol authored Apr 15, 2024
1 parent 2ec08a5 commit e6a2014
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/groovy/wooga/gradle/version/VersionPlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ class VersionPlugin implements Plugin<Project> {
}

private static void setProjectVersion(Project project, VersionPluginExtension extension) {
def sharedVersion = new ToStringProvider(extension.version.map({ it.version }))
def versionProvider = new ToStringProvider(extension.version.map({ it.version }.memoize()))
applyOnCurrentAndSubProjects(project) { Project prj ->
prj.setVersion(sharedVersion)
prj.setVersion(versionProvider)
def versionCodeExt = project.extensions.findByName(VERSION_CODE_EXTENSION_NAME) as VersionCodeExtension
if(!versionCodeExt) {
versionCodeExt = DefaultVersionCodeExtension.empty(prj, VERSION_CODE_EXTENSION_NAME)
Expand Down

0 comments on commit e6a2014

Please sign in to comment.