Weird hack for java6. I hope it works.

Dieser Commit ist enthalten in:
Kenzie Togami 2016-02-22 19:13:08 -08:00
Ursprung 698a610eaa
Commit a1680886a4

Datei anzeigen

@ -38,9 +38,12 @@ if (!project.hasProperty("artifactory_password")) ext.artifactory_password = ""
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) {
println "Error getting commit hash: " + e.getMessage()
ext.gitCommitHash = "no_git_id"
}
}