diff --git a/README.md b/README.md index dee0fa780..0dd11583b 100644 --- a/README.md +++ b/README.md @@ -40,16 +40,11 @@ Copy *tools* directory into *gui-database* to make it work properly. * Update and commit *dist/version.info* file according to desired version * Make working directory clean (commit/push or stash changes) * Check version: execute *currentVersion* task from Gradle -* Execute *release* task from Gradle to automatically select release tag version, or *release -Prelease.forceVersion=[version]* to specify a version. - -...it will: - -* Set local tag *tduf-[version]* -* Push it to remote. +* Perform release manually or via Github ### Preparing next development version ### -* Execute *markNextVersion -Prelease.forceVersion=[version]* task from Gradle to specify next dev version. +* Update and commit *dist/version.info* file according to desired development (alpha) version ### Packaging ### @@ -57,9 +52,9 @@ This needs a release tag to be set, see *Releasing* section above. * Checkout project from target release tag *tduf-[version]* * Execute one ok *pack...* tasks from Gradle: - - packCore: minimal set to run CLI with LIB - - packDatabaseEditor: minimal set to run Database Editor - - packFull: all TDUF in a single package. + - `packCore`: minimal set to run CLI with LIB + - `packDatabaseEditor`: minimal set to run Database Editor + - `packFull`: all TDUF in a single package. ...it will: diff --git a/build.gradle b/build.gradle index 1b730e93d..739c19ca3 100644 --- a/build.gradle +++ b/build.gradle @@ -5,17 +5,9 @@ buildscript { } plugins { - id 'pl.allegro.tech.build.axion-release' version '1.10.3' id 'org.kordamp.markdown.convert' version '1.2.0' } -// configures version for release plugin -scmVersion { - tag { - prefix = 'tduf' - } -} - // Helper script apply from: './src/main/groovy/helper.gradle' @@ -24,7 +16,7 @@ allprojects { project.group = 'fr.tduf' // version defined by plugin (if changes or ahead commits: x.y.z-SNAPSHOT) - project.version = scmVersion.version + project.version = getCurrentVersion // Version for common dependencies ext { @@ -430,3 +422,13 @@ task copyIcons(type: Copy) { include 'TDU-256px.ico' into 'pack/icons' } + +task currentVersion() { + description('Displays current version to console') + group('help') + + doLast { + println "Current version is ${project.version}." + } +} + diff --git a/dist/version.info b/dist/version.info index 359a5b952..5e38773b3 100644 --- a/dist/version.info +++ b/dist/version.info @@ -1 +1 @@ -2.0.0 \ No newline at end of file +2.0.1-SNAPSHOT \ No newline at end of file diff --git a/src/main/groovy/helper.gradle b/src/main/groovy/helper.gradle index 2e8f2bb68..058169d89 100644 --- a/src/main/groovy/helper.gradle +++ b/src/main/groovy/helper.gradle @@ -68,6 +68,23 @@ def databaseEditorPackDependencies = { -> *commonPackDeps ] } +/** + * @returns current version, as specified in dist/version.info file + */ +def currentVersion = { -> + File file = new File('./dist/version.info') + def version = "" + file.withReader { reader -> + def line = reader.readLine() + if (line == null) { + version = 'NA' + } else { + version = line + } + } + return version +} + ext { getCoreProjects = { -> coreProjects } getFullProjects = { -> fullProjects } @@ -75,6 +92,7 @@ ext { getCoreDependencies = corePackDependencies getFullDependencies = fullPackDependencies getDatabaseEditorDependencies = databaseEditorPackDependencies + getCurrentVersion = currentVersion LINUX_TARGET = PARAM_LINUX_TARGET WINDOWS_TARGET = PARAM_WINDOWS_TARGET }