Преглед изворни кода

[build] Don't resolve the revision hash unless you need it

This fixes the build for folks that build without git installed locally
and should speed up the general case because we aren't trying to resolve
git information when it isn't really needed.
Nik Everett пре 9 година
родитељ
комит
c966d14f8b
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      build.gradle

+ 2 - 2
build.gradle

@@ -53,10 +53,10 @@ subprojects {
       tests = false
     }
     nexus {
-      Repository repo = new RepositoryBuilder().findGitDir(new File('.')).build()
-      String shortHash = repo.resolve('HEAD')?.name?.substring(0,7)
       String buildSnapshot = System.getProperty('build.snapshot', 'true')
       if (buildSnapshot == 'false') {
+        Repository repo = new RepositoryBuilder().findGitDir(new File('.')).build()
+        String shortHash = repo.resolve('HEAD')?.name?.substring(0,7)
         repositoryUrl = project.hasProperty('build.repository') ? project.property('build.repository') : "file://${System.getenv('HOME')}/elasticsearch-releases/${version}-${shortHash}/"
       }
     }