mirror of
https://github.com/corda/corda.git
synced 2025-05-02 08:43:15 +00:00
ENT-4595 Add git based version (#5799)
* ENT-4595 Allow publishing a version with a git based version string * ENT-4595 rename option and add comment * ENT-4595 Fix groovy/Java string incompatibility * Remove Constants.kt so it gets regenerated on a fresh check-out. * Add Constants.kt to .gitignore * Reverted deletion of Constants.kt as it would cause problems for IntelliJ users * Reverted logging Constants.kt file to how it was before * Undid template change too * Reverted template file properly this time.
This commit is contained in:
parent
3fc916fb6c
commit
b80d1b3009
2
.gitignore
vendored
2
.gitignore
vendored
@ -103,4 +103,4 @@ virtualenv/
|
|||||||
# Files you may find useful to have in your working directory.
|
# Files you may find useful to have in your working directory.
|
||||||
PLAN
|
PLAN
|
||||||
NOTES
|
NOTES
|
||||||
TODO
|
TODO
|
21
build.gradle
21
build.gradle
@ -11,7 +11,9 @@ buildscript {
|
|||||||
file("$projectDir/constants.properties").withInputStream { constants.load(it) }
|
file("$projectDir/constants.properties").withInputStream { constants.load(it) }
|
||||||
|
|
||||||
// Our version: bump this on release.
|
// Our version: bump this on release.
|
||||||
ext.corda_release_version = constants.getProperty("cordaVersion")
|
ext.baseVersion = constants.getProperty("cordaVersion")
|
||||||
|
ext.versionSuffix = constants.getProperty("versionSuffix")
|
||||||
|
|
||||||
ext.corda_platform_version = constants.getProperty("platformVersion")
|
ext.corda_platform_version = constants.getProperty("platformVersion")
|
||||||
ext.gradle_plugins_version = constants.getProperty("gradlePluginsVersion")
|
ext.gradle_plugins_version = constants.getProperty("gradlePluginsVersion")
|
||||||
|
|
||||||
@ -186,7 +188,8 @@ plugins {
|
|||||||
// Add the shadow plugin to the plugins classpath for the entire project.
|
// Add the shadow plugin to the plugins classpath for the entire project.
|
||||||
id 'com.github.johnrengelman.shadow' version '2.0.4' apply false
|
id 'com.github.johnrengelman.shadow' version '2.0.4' apply false
|
||||||
id "com.gradle.build-scan" version "2.2.1"
|
id "com.gradle.build-scan" version "2.2.1"
|
||||||
}
|
id "org.ajoberstar.grgit" version "4.0.0"
|
||||||
|
}
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
}
|
}
|
||||||
@ -198,6 +201,20 @@ apply plugin: 'maven-publish'
|
|||||||
apply plugin: 'com.jfrog.artifactory'
|
apply plugin: 'com.jfrog.artifactory'
|
||||||
apply plugin: "com.bmuschko.docker-remote-api"
|
apply plugin: "com.bmuschko.docker-remote-api"
|
||||||
|
|
||||||
|
|
||||||
|
// If the command line project option -PversionFromGit is added to the gradle invocation, we'll resolve
|
||||||
|
// the latest git commit hash and timestamp and create a version postfix from that
|
||||||
|
if (project.hasProperty("versionFromGit")){
|
||||||
|
ext.versionSuffix = "${grgit.head().dateTime.format("yyyyMMdd_HHmmss")}-${grgit.head().abbreviatedId}"
|
||||||
|
}
|
||||||
|
|
||||||
|
// Need the `toString()` call on these, because they need to be converted from GStringImpl to Java Strings.
|
||||||
|
if (ext.versionSuffix != ""){
|
||||||
|
ext.corda_release_version = "${ext.baseVersion}-${ext.versionSuffix}".toString()
|
||||||
|
} else {
|
||||||
|
ext.corda_release_version = "${ext.baseVersion}".toString()
|
||||||
|
}
|
||||||
|
|
||||||
// We need the following three lines even though they're inside an allprojects {} block below because otherwise
|
// We need the following three lines even though they're inside an allprojects {} block below because otherwise
|
||||||
// IntelliJ gets confused when importing the project and ends up erasing and recreating the .idea directory, along
|
// IntelliJ gets confused when importing the project and ends up erasing and recreating the .idea directory, along
|
||||||
// with the run configurations. It also doesn't realise that the project is a Java 8 project and misconfigures
|
// with the run configurations. It also doesn't realise that the project is a Java 8 project and misconfigures
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
# because some versions here need to be matched by app authors in
|
# because some versions here need to be matched by app authors in
|
||||||
# their own projects. So don't get fancy with syntax!
|
# their own projects. So don't get fancy with syntax!
|
||||||
|
|
||||||
cordaVersion=4.3-SNAPSHOT
|
|
||||||
|
cordaVersion=4.3
|
||||||
|
versionSuffix=SNAPSHOT
|
||||||
gradlePluginsVersion=5.0.4
|
gradlePluginsVersion=5.0.4
|
||||||
kotlinVersion=1.2.71
|
kotlinVersion=1.2.71
|
||||||
java8MinUpdateVersion=171
|
java8MinUpdateVersion=171
|
||||||
|
Loading…
x
Reference in New Issue
Block a user