From 837faa5bcd1b9b0225e3361eb1f99fdc9e46c7a7 Mon Sep 17 00:00:00 2001 From: Sekwah Date: Sun, 15 Dec 2024 04:20:31 +0000 Subject: [PATCH] fix: version number is now set correctly, was 1.0.0 --- build.gradle | 17 +++++++++++------ gradle.properties | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index c68f76d7..4b083f10 100644 --- a/build.gradle +++ b/build.gradle @@ -23,6 +23,9 @@ plugins { id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.7' } +apply from: 'env-variables.gradle' +apply from: 'changelog-util.gradle' + allprojects { apply plugin: 'java' apply plugin: 'idea' @@ -48,11 +51,15 @@ allprojects { sourceCompatibility = JavaVersion.VERSION_16 targetCompatibility = JavaVersion.VERSION_16 -} - + ext.branch = rootProject.ext.branch + ext.snapshotName = rootProject.ext.snapshotName + ext.githubSha = rootProject.ext.githubSha + ext.shaRef = rootProject.ext.shaRef + ext.isRelease = rootProject.ext.isRelease -apply from: 'env-variables.gradle' -apply from: 'changelog-util.gradle' + def versionString = (rootProject.file('./version.txt').text + (isRelease ? "" : "-${snapshotName}${shaRef}")).replaceAll('\n', '').replaceAll('\r', '') + setVersion(versionString) +} println("Branch ${ext.branch}${ext.shaRef} isRelease: '${ext.isRelease}'") @@ -62,8 +69,6 @@ println("Sha Ref: ${ext.shaRef}") archivesBaseName = "Advanced-Portals" group = 'com.sekwah.advancedportals' -def versionString = (file('./version.txt').text + (isRelease ? "" : "-${snapshotName}${shaRef}")).replaceAll('\n', '').replaceAll('\r', '') -setVersion(versionString) println "Version: ${getVersion()}" description = "" diff --git a/gradle.properties b/gradle.properties index 52313959..1fc602ca 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -z# https://docs.gradle.org/current/userguide/build_environment.html +# https://docs.gradle.org/current/userguide/build_environment.html # Disable with --no-build-cache org.gradle.caching=true version=1.0.0