geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mbr...@apache.org
Subject incubator-geode git commit: [GEODE-160] Modify Git workspace check to use '--is-inside-working-tree' git command
Date Tue, 28 Jul 2015 18:55:26 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 4f86d40b1 -> ea8ce3f54


[GEODE-160] Modify Git workspace check to use '--is-inside-working-tree' git command

Tested with using Git checkout and outside Git workspace using git archive


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/ea8ce3f5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/ea8ce3f5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/ea8ce3f5

Branch: refs/heads/develop
Commit: ea8ce3f54f196d26d0f5290ec3efb179720bdb62
Parents: 4f86d40
Author: Mark Bretl <mbretl@pivotal.io>
Authored: Mon Jul 27 13:00:36 2015 -0700
Committer: Mark Bretl <mbretl@pivotal.io>
Committed: Tue Jul 28 11:54:31 2015 -0700

----------------------------------------------------------------------
 gemfire-core/build.gradle | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ea8ce3f5/gemfire-core/build.gradle
----------------------------------------------------------------------
diff --git a/gemfire-core/build.gradle b/gemfire-core/build.gradle
index 2992ee9..1c17474 100755
--- a/gemfire-core/build.gradle
+++ b/gemfire-core/build.gradle
@@ -99,10 +99,22 @@ task createVersionPropertiesFile {
   inputs.dir compileJava.destinationDir
 
   doLast {
-    def gitFolder = new File ("${rootProject.projectDir}/.git")
-    if ( gitFolder.exists() ) {
+    new ByteArrayOutputStream().withStream { gitWorkspaceStream ->
+      def result = exec {
+        workingDir = "${projectDir}"
+        standardOutput = gitWorkspaceStream
+        ignoreExitValue = true
+        executable = "git"
+        args = ['rev-parse', '--is-inside-work-tree']
+      }
+      ext.isGitWorkspace = gitWorkspaceStream.toString()
+      ext.isGitWorkspace = ext.isGitWorkspace.trim()
+    }
+
+    if ( isGitWorkspace.equalsIgnoreCase('true') ) {
       new ByteArrayOutputStream().withStream { gitBranchStream ->
         def result = exec {
+          workingDir = "${projectDir}"
           standardOutput = gitBranchStream
           executable = "git"
           args = ['rev-parse', '--abbrev-ref', 'HEAD']
@@ -113,6 +125,7 @@ task createVersionPropertiesFile {
 
       new ByteArrayOutputStream().withStream { commitStream ->
         def result = exec {
+          workingDir = "${projectDir}"
           standardOutput = commitStream
           executable = "git"
           args = ['rev-parse', 'HEAD']
@@ -123,6 +136,7 @@ task createVersionPropertiesFile {
 
       new ByteArrayOutputStream().withStream { sourceDateStream ->
         def result = exec {
+          workingDir = "${projectDir}"
           standardOutput = sourceDateStream
           executable = "git"
           args = ['show', '-s', '--format=%ci', "${ext.commitId}"]
@@ -146,7 +160,7 @@ task createVersionPropertiesFile {
     ext.jdkVersion = System.getProperty('java.version')
 
     def props = [
-      "Product-Name"      : "Pivotal GemFire",
+      "Product-Name"      : "Apache Geode (incubating)",
       "Product-Version"   : version,
       "Build-Id"          : System.env.USER + ' ' + ext.buildNumber,
       "Build-Date"        : ext.buildDate,


Mime
View raw message