Revert "GEODE-1260: Cache SCM metadata for source distributions"

This reverts commit 19b9fe5ad6b4a697c512304f3db92c91a02f4072.


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

Branch: refs/heads/feature/GEODE-1255
Commit: fc38555c9b1094d915e8acb94348ab2dcc07450c
Parents: 19b9fe5
Author: Anthony Baker <aba...@apache.org>
Authored: Wed May 4 06:46:35 2016 -0700
Committer: Anthony Baker <aba...@apache.org>
Committed: Wed May 4 06:46:35 2016 -0700

----------------------------------------------------------------------
 geode-assembly/build.gradle | 12 -------
 geode-core/build.gradle     | 69 +++++++++++++++++-----------------------
 gradle/rat.gradle           |  1 -
 3 files changed, 30 insertions(+), 52 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/fc38555c/geode-assembly/build.gradle
----------------------------------------------------------------------
diff --git a/geode-assembly/build.gradle b/geode-assembly/build.gradle
index ed5154e..e786b24 100755
--- a/geode-assembly/build.gradle
+++ b/geode-assembly/build.gradle
@@ -227,17 +227,6 @@ task docs(type: Javadoc) {
    }
 }
 
-task writeBuildInfo {
-  def buildInfo = file "$buildDir/.buildinfo"
-  outputs.file buildInfo
-  doLast {
-    buildInfo.getParentFile().mkdirs();
-    new FileOutputStream(buildInfo).withStream { fos ->
-      project(':geode-core').readScmInfo().store(fos, '')
-    }
-  }
-}
-
 gradle.taskGraph.whenReady( { graph ->
   tasks.withType(AbstractArchiveTask).findAll {
     it.name.toLowerCase().contains("dist")
@@ -253,7 +242,6 @@ distributions {
   src {
     baseName = 'apache-geode-src'
     contents {
-      from writeBuildInfo
       from (rootDir) {
         exclude 'KEYS'
         exclude 'gradlew'

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/fc38555c/geode-core/build.gradle
----------------------------------------------------------------------
diff --git a/geode-core/build.gradle b/geode-core/build.gradle
index a0bc46a..45051dc 100755
--- a/geode-core/build.gradle
+++ b/geode-core/build.gradle
@@ -131,40 +131,7 @@ sourceSets {
     output.dir(generatedResources, builtBy: 'createVersionPropertiesFile')
   }
 }
-
-ext.readScmInfo = {
-  try {
-    def git = org.ajoberstar.grgit.Grgit.open(currentDir: projectDir)
-    try {
-      return [
-        'Source-Repository': git.branch.getCurrent().name,
-        'Source-Revision'  : git.head().id,
-        'Source-Date'      : git.head().getDate().format('yyyy-MM-dd HH:mm:ss 
Z')
-      ] as Properties
-    } finally {
-      git.close()
-    }
-  } catch (IllegalArgumentException e) {
-    // if we're building from the source distribution, we don't have git so
-    // use cached info written during the assembly process
-    def buildInfo = file "$rootDir/.buildinfo"
-    if (buildInfo.exists()) {
-      def props = new Properties()
-      new FileInputStream(buildInfo).withStream { fis ->
-        props.load(fis)
-      }
-      return props
-    }
-
-    logger.warn( '***** Unable to find Git workspace. Using default version 
information *****' )
-    return [
-      'Source-Repository': 'UNKNOWN',
-      'Source-Revision'  : 'UNKNOWN',
-      'Source-Date'      : new Date().format('yyyy-MM-dd HH:mm:ss Z')
-    ] as Properties
-  }
-}
-
+ 
 // Creates the version properties file and writes it to the classes dir
 task createVersionPropertiesFile {
   def propertiesFile = file(generatedResources + 
"/com/gemstone/gemfire/internal/GemFireVersion.properties");
@@ -172,18 +139,42 @@ task createVersionPropertiesFile {
   inputs.dir compileJava.destinationDir
 
   doLast {
+
+    try {
+      def grgit = org.ajoberstar.grgit.Grgit.open(currentDir: projectDir)
+      ext.branch = grgit.branch.getCurrent().name
+      ext.commitId = grgit.head().id
+      ext.sourceDate = grgit.head().getDate().format('yyyy-MM-dd HH:mm:ss Z')
+      grgit.close()
+    } catch (Exception e) {
+      logger.warn( '***** Unable to find Git workspace. Using default version 
information *****' )
+      ext.branch = 'UNKNOWN'
+      ext.commitId = 'UNKNOWN'
+      ext.sourceDate = new Date().format('yyyy-MM-dd HH:mm:ss Z')
+    }
+
+    ext.osArch = System.getProperty('os.arch')
+    ext.osName = System.getProperty('os.name')
+    ext.osVersion = System.getProperty('os.version')
+    ext.buildDate = new Date().format('yyyy-MM-dd HH:mm:ss Z')
+    ext.buildNumber = new Date().format('MMddyy')
+    ext.jdkVersion = System.getProperty('java.version')
+
     def props = [
       "Product-Name"      : "Apache Geode (incubating)",
       "Product-Version"   : version,
-      "Build-Id"          : "${System.env.USER} ${new 
Date().format('MMddyy')}",
-      "Build-Date"        : new Date().format('yyyy-MM-dd HH:mm:ss Z'),
-      "Build-Platform"    : "${System.getenv('os.name')} 
${System.getenv('os.version')} ${System.getenv('os.arch')}",
-      "Build-Java-Version": System.getenv('java.version'),
+      "Build-Id"          : System.env.USER + ' ' + ext.buildNumber,
+      "Build-Date"        : ext.buildDate,
+      "Build-Platform"    : ext.osName + ' ' + ext.osVersion + ' ' + 
ext.osArch,
+      "Build-Java-Version": ext.jdkVersion,
+      "Source-Date"       : ext.sourceDate,
+      "Source-Revision"   : ext.commitId,
+      "Source-Repository" : ext.branch
     ] as Properties
 
     propertiesFile.getParentFile().mkdirs();
     new FileOutputStream(propertiesFile).withStream { fos ->
-      props.plus(readScmInfo()).store(fos, '')
+      props.store(fos, '')
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/fc38555c/gradle/rat.gradle
----------------------------------------------------------------------
diff --git a/gradle/rat.gradle b/gradle/rat.gradle
index 3d0826a..f35b157 100644
--- a/gradle/rat.gradle
+++ b/gradle/rat.gradle
@@ -37,7 +37,6 @@ rat {
     'native/**',
     'wrapper/**',
     '**/build/**',
-    '.buildinfo',
 
     // SBT
     'geode-spark-connector/**/target/**',

Reply via email to