diff --git a/dotCMS/build.gradle b/dotCMS/build.gradle index df363d636487..8470c84e8a4e 100644 --- a/dotCMS/build.gradle +++ b/dotCMS/build.gradle @@ -74,23 +74,26 @@ project.ext { homeFolder = serverFolder + webAppRootFolder dotcmsHome = serverFolder + webAppRootFolder - - - - if (project.gradle.startParameter.taskNames.contains('deployWarTomcat') || project.gradle.startParameter.taskNames.contains('createDist')|| project.gradle.startParameter.taskNames.contains('docker')){ - try { - git = Grgit.open(file('..')) - dotcmsReleaseBuild = git.head().abbreviatedId // abbreviatedId of head() method. - } catch (Exception ignored) { - println "ERROR:>> " + ignored.getMessage() - //Do nothing, this will fail only if git is not installed on this machine - } + try { + dotcmsReleaseBuild = getCheckedOutGitCommitHash() + println "SETTING BUILD TO:>> " + dotcmsReleaseBuild + + } catch (Exception ignored) { + println "ERROR:>> " + ignored.getMessage() + //Do nothing, this will fail only if git is not installed on this machine } + tomcatDistBase = "$distLocation/$tomcatDistInstallLocation-$tomcatInstallVersion" dotcmsDistBase = "../$tomcatDistInstallLocation-$tomcatInstallVersion" } +// this is way faster than Grgit +def getCheckedOutGitCommitHash() { + grgit.head().abbreviatedId +} + + if (project.hasProperty('jarBaseName')) { archivesBaseName = "$jarBaseName"