Skip to content

Commit a408b7d

Browse files
committed
fix
1 parent 3c67f21 commit a408b7d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

build.gradle

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ ext {
3030
}
3131
}
3232

33+
ext.reloadVersion = () -> projectVersion = Version.parseProjectVersion( readVersionFromProperties( rootProject.projectVersionFile ) )
34+
3335
// nexusPublishing uses group and version
3436
// as defaults
3537
group = projectGroup
@@ -201,6 +203,10 @@ subprojects {
201203
}
202204
}
203205

206+
void reloadVersion() {
207+
project.version = Version.parseProjectVersion( null )
208+
}
209+
204210
private static String readVersionFromProperties(File file) {
205211
if ( !file.exists() ) {
206212
throw new FileNotFoundException( "Version file $file.canonicalPath does not exists" )
@@ -276,4 +282,4 @@ class Version {
276282
String getFamily() {
277283
"$major.$minor"
278284
}
279-
}
285+
}

release/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def releasePreparePostGitTask = tasks.register( 'gitTasksAfterRelease' ) {
230230
void updateVersionFile(String version) {
231231
logger.lifecycle( "Updating `gradle/version.properties` version to `${version}`" )
232232
project.projectVersionFile.text = "projectVersion=${version}"
233-
project.version = Version.parseProjectVersion( version )
233+
project.version =
234234
}
235235

236236
def publishReleaseArtifactsTask = tasks.register( 'publishReleaseArtifacts' ) {

0 commit comments

Comments
 (0)