Merge remote-tracking branch 'origin/master' into feature/sponge-new
This commit is contained in:
15
build.gradle
15
build.gradle
@@ -26,9 +26,9 @@ buildscript {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.0'
|
||||
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3'
|
||||
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:3.0.1'
|
||||
classpath 'org.ajoberstar:gradle-git:0.12.0'
|
||||
classpath 'org.ajoberstar:gradle-git:1.4.2'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,14 +36,19 @@ if (!project.hasProperty("artifactory_contextUrl")) ext.artifactory_contextUrl =
|
||||
if (!project.hasProperty("artifactory_user")) ext.artifactory_user = "guest"
|
||||
if (!project.hasProperty("artifactory_password")) ext.artifactory_password = ""
|
||||
|
||||
if (!project.hasProperty("gitCommitHash")) {
|
||||
if (!project.hasProperty("gitCommitHash") && !JavaVersion.current().isJava6()) {
|
||||
try {
|
||||
def repo = org.ajoberstar.grgit.Grgit.open(project.file('.'))
|
||||
def Grgit = Class.forName("org.ajoberstar.grgit.Grgit");
|
||||
def Grgit_open = Grgit.getDeclaredMethod("open", File.class)
|
||||
def repo = Grgit_open.invoke(null, project.file('.'))
|
||||
ext.gitCommitHash = repo.head().abbreviatedId
|
||||
} catch (Exception e) {
|
||||
ext.gitCommitHash = "no_git_id"
|
||||
println "Error getting commit hash: " + e.getMessage()
|
||||
}
|
||||
}
|
||||
if (!project.hasProperty("gitCommitHash")) {
|
||||
ext.gitCommitHash = "no_git_id"
|
||||
}
|
||||
|
||||
subprojects {
|
||||
apply plugin: 'java'
|
||||
|
||||
Reference in New Issue
Block a user