From e425973c7598c407dd18142920d4b76dcc9b9035 Mon Sep 17 00:00:00 2001 From: JFronny Date: Thu, 28 Apr 2022 22:43:08 +0200 Subject: [PATCH] Single version calculation in root projects --- build.gradle | 12 +++++------- commons-gson/build.gradle | 6 ++---- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/build.gradle b/build.gradle index e6cbe6e..d5bc26b 100644 --- a/build.gradle +++ b/build.gradle @@ -3,9 +3,11 @@ plugins { id 'maven-publish' } -ext { - versionPrefix = "0.1.0" -} +var cl = Calendar.instance +var day = "${cl.get(cl.YEAR)}.${cl.get(cl.MONTH) + 1}.${cl.get(cl.DATE)}" +var time = "${cl.get(cl.HOUR_OF_DAY)}.${cl.get(cl.MINUTE)}.${cl.get(cl.SECOND)}" + +version = "0.1.0.$day.$time" repositories { mavenCentral() @@ -27,10 +29,6 @@ publishing { mavenJava(MavenPublication) { groupId = 'io.gitlab.jfronny' artifactId = 'commons' - var cl = Calendar.instance - var day = "${cl.get(cl.YEAR)}.${cl.get(cl.MONTH) + 1}.${cl.get(cl.DATE)}" - var time = "${cl.get(cl.HOUR_OF_DAY)}.${cl.get(cl.MINUTE)}.${cl.get(cl.SECOND)}" - version = "$versionPrefix.$day.$time" from components.java } diff --git a/commons-gson/build.gradle b/commons-gson/build.gradle index 872aebf..9e69bae 100644 --- a/commons-gson/build.gradle +++ b/commons-gson/build.gradle @@ -4,6 +4,8 @@ plugins { id 'com.github.johnrengelman.shadow' version '7.1.2' } +version = rootProject.version + repositories { mavenCentral() maven { @@ -33,10 +35,6 @@ publishing { mavenJava(MavenPublication) { groupId = 'io.gitlab.jfronny' artifactId = 'commons-gson' - var cl = Calendar.instance - var day = "${cl.get(cl.YEAR)}.${cl.get(cl.MONTH) + 1}.${cl.get(cl.DATE)}" - var time = "${cl.get(cl.HOUR_OF_DAY)}.${cl.get(cl.MINUTE)}.${cl.get(cl.SECOND)}" - version = "${rootProject.versionPrefix}.$day.$time" project.shadow.component(it) }