geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dschnei...@apache.org
Subject [34/52] [abbrv] incubator-geode git commit: GEODE-852: do not rename the GemFireVersion.properties file
Date Fri, 29 Jan 2016 01:16:51 GMT
GEODE-852: do not rename the GemFireVersion.properties file

* closes #80 (committed by klund)


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

Branch: refs/heads/feature/GEODE-831
Commit: 49a984c23918eabfd6f573aac0b66c51e731490e
Parents: 4e211e2
Author: Jinmei Liao <jiliao@pivotal.io>
Authored: Wed Jan 27 09:18:35 2016 -0800
Committer: Kirk Lund <klund@pivotal.io>
Committed: Wed Jan 27 10:12:40 2016 -0800

----------------------------------------------------------------------
 gemfire-pulse/build.gradle                      | 55 +++-----------------
 .../pulse/internal/data/PulseConstants.java     |  4 +-
 .../gemfire/tools/pulse/tests/PulseTest.java    | 32 +++++-------
 3 files changed, 22 insertions(+), 69 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/49a984c2/gemfire-pulse/build.gradle
----------------------------------------------------------------------
diff --git a/gemfire-pulse/build.gradle b/gemfire-pulse/build.gradle
index 4c1135d..78043cd 100755
--- a/gemfire-pulse/build.gradle
+++ b/gemfire-pulse/build.gradle
@@ -78,60 +78,17 @@ def generatedResources = "$buildDir/generated-resources/main"
 
 sourceSets {
   main {
-    output.dir(generatedResources, builtBy: 'createPulsePropFile')
+    output.dir(generatedResources, builtBy: 'copyGemFireVersionFile')
   }
 }
 
-// Creates the version properties file and writes it to the resources dir
-task createPulsePropFile {
-  description 'Creates a new Pule properties file with build/ version information'
-  def propertiesFile = file(generatedResources + "/pulseversion.properties");
-  outputs.file propertiesFile
-  inputs.dir compileJava.destinationDir
-
-  doLast {
-    try {
-      def grgit = org.ajoberstar.grgit.Grgit.open()
-      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 = 'UNKNOWN'
-    }
-    // Build machine & java information - for screen output only
-    ext.osArch = System.getProperty('os.arch')
-    ext.osName = System.getProperty('os.name')
-    ext.osVersion = System.getProperty('os.version')
-    ext.jdkVersion = System.getProperty('java.version')
-
-    ext.buildDate = new Date().format('yyyy-MM-dd HH:mm:ss Z')
-    ext.buildNumber = new Date().format('MMddyy')
-
-    def props = [
-            "pulse.version"     : version,
-            "Build-Id"          : ext.buildNumber,
-            "Build-Date"        : ext.buildDate,
-            "Source-Date"       : ext.sourceDate,
-            "Source-Revision"   : ext.commitId,
-            "Source-Repository" : ext.branch
-    ] as Properties
-
-    propertiesFile.getParentFile().mkdirs();
-    new FileOutputStream(propertiesFile).withStream { fos ->
-      props.store(fos, '')
-    }
-  }
+task copyGemFireVersionFile(type: Copy) {
+  from project(':gemfire-core').buildDir.absolutePath + "/generated-resources/main/com/gemstone/gemfire/internal/GemFireVersion.properties"
+  into generatedResources
 }
 
 jar {
   from sourceSets.main.output
-  doFirst {
-    project.createPulsePropFile
-  }
 }
 
 eclipse.classpath.file {
@@ -150,9 +107,9 @@ artifacts {
   archives war
 }
 
-def pulseWarFile = "gemfire-pulse-"+version+".war"
-
 war {
   classpath configurations.runtime
   classpath project(':gemfire-core').webJar.archivePath
 }
+
+uiTest.dependsOn war

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/49a984c2/gemfire-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/data/PulseConstants.java
----------------------------------------------------------------------
diff --git a/gemfire-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/data/PulseConstants.java
b/gemfire-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/data/PulseConstants.java
index 9c22a03..9c5732e 100644
--- a/gemfire-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/data/PulseConstants.java
+++ b/gemfire-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/data/PulseConstants.java
@@ -37,8 +37,8 @@ public class PulseConstants {
   public static final String APPLICATION_COUNTRY = "US";
 
   // Pulse version details properties from properties file
-  public static final String PULSE_VERSION_PROPERTIES_FILE = "pulseversion.properties";
-  public static final String PROPERTY_PULSE_VERSION = "pulse.version";
+  public static final String PULSE_VERSION_PROPERTIES_FILE = "GemFireVersion.properties";
+  public static final String PROPERTY_PULSE_VERSION = "Product-Version";
   public static final String PROPERTY_BUILD_ID = "Build-Id";
   public static final String PROPERTY_BUILD_DATE = "Build-Date";
   public static final String PROPERTY_SOURCE_DATE = "Source-Date";

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/49a984c2/gemfire-pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/PulseTest.java
----------------------------------------------------------------------
diff --git a/gemfire-pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/PulseTest.java
b/gemfire-pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/PulseTest.java
index d30c14c..ec06085 100644
--- a/gemfire-pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/PulseTest.java
+++ b/gemfire-pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/PulseTest.java
@@ -18,23 +18,10 @@
  */
 package com.vmware.gemfire.tools.pulse.tests;
 
-import java.io.*;
-import java.text.DecimalFormat;
-import java.util.List;
-import java.util.Properties;
-import java.util.concurrent.TimeUnit;
-
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 import com.gemstone.gemfire.test.junit.categories.UITest;
-import com.gemstone.gemfire.test.junit.categories.UnitTest;
 import junit.framework.Assert;
-
 import org.apache.catalina.startup.Tomcat;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.FixMethodOrder;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.*;
 import org.junit.experimental.categories.Category;
 import org.junit.runners.MethodSorters;
 import org.openqa.selenium.By;
@@ -47,6 +34,15 @@ import org.openqa.selenium.support.ui.ExpectedCondition;
 import org.openqa.selenium.support.ui.ExpectedConditions;
 import org.openqa.selenium.support.ui.WebDriverWait;
 
+import java.io.BufferedReader;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.text.DecimalFormat;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.TimeUnit;
+
 @Category(UITest.class)
 @FixMethodOrder(MethodSorters.JVM)
 public class PulseTest {
@@ -181,13 +177,13 @@ public class PulseTest {
         String warPath = null;
         ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
         InputStream inputStream = classLoader
-                .getResourceAsStream("pulseversion.properties");
+                .getResourceAsStream("GemFireVersion.properties");
         Properties properties = new Properties();
         properties.load(inputStream);
-        String version = properties.getProperty("pulse.version");
+        String version = properties.getProperty("Product-Version");
         warPath = "gemfire-pulse-"+version+".war";
-        String propFilePath = classLoader.getResource("pulseversion.properties").getPath();
-        warPath = propFilePath.substring(0, propFilePath.indexOf("resources"))+"libs/"+warPath;
+        String propFilePath = classLoader.getResource("GemFireVersion.properties").getPath();
+        warPath = propFilePath.substring(0, propFilePath.indexOf("generated-resources"))+"libs/"+warPath;
         return warPath;
     }
 


Mime
View raw message