You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by fm...@apache.org on 2011/08/28 21:43:54 UTC

svn commit: r1162578 - in /chemistry/opencmis/trunk: ./ chemistry-opencmis-test/chemistry-opencmis-test-tck/ chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/runner/ chemistry-opencmis-workbench/chemis...

Author: fmui
Date: Sun Aug 28 19:43:53 2011
New Revision: 1162578

URL: http://svn.apache.org/viewvc?rev=1162578&view=rev
Log:
added revision number to jar manifests, Workbench and TCK

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/pom.xml
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/runner/AbstractRunner.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/pom.xml
    chemistry/opencmis/trunk/pom.xml

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/pom.xml
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/pom.xml?rev=1162578&r1=1162577&r2=1162578&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/pom.xml (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/pom.xml Sun Aug 28 19:43:53 2011
@@ -26,6 +26,42 @@
         <parentBasedir>../../</parentBasedir>
     </properties>
     
+    <build>
+        <resources>
+            <resource>
+                <directory>${basedir}/src/main/resources</directory>
+            </resource>
+            <resource>
+                <directory>${project.build.directory}/generated-resources</directory>
+            </resource>
+        </resources>
+        <plugins>
+            <plugin>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <version>1.5</version>
+                <executions>
+                    <execution>
+                        <phase>generate-resources</phase>
+                        <configuration>
+                            <target>
+                                <property name="version" value="${maven.version}" />
+                                <property name="timestamp" value="${timestamp}" />
+                                <property name="revision" value="${buildNumber}" />
+                                <property name="targetdir" value="${project.build.directory}" />
+                                 
+                                 <!-- build timestamp -->
+                                 <echo file="${targetdir}/generated-resources/META-INF/build-timestamp.txt">Version: ${project.version} / Revision: ${revision} / Build: ${timestamp}</echo>
+                            </target>
+                        </configuration>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+    
     <dependencies>
         <dependency>
             <groupId>org.apache.chemistry.opencmis</groupId>

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/runner/AbstractRunner.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/runner/AbstractRunner.java?rev=1162578&r1=1162577&r2=1162578&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/runner/AbstractRunner.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/runner/AbstractRunner.java Sun Aug 28 19:43:53 2011
@@ -40,6 +40,8 @@ public abstract class AbstractRunner {
 
     public static final String OVERRIDE_KEY = "org.apache.chemistry";
     public static final String DEFAULT_TCK_GROUPS = "/cmis-tck-groups.txt";
+    public static final String TCK_BUILD_TIMESTAMP = "/META-INF/build-timestamp.txt";
+    public static final String TCK_BUILD_TIMESTAMP_PARAMETER = "org.apache.chemistry.opencmis.tck.timestamp";
 
     private Map<String, String> parameters;
     private final List<CmisTestGroup> groups = new ArrayList<CmisTestGroup>();
@@ -62,6 +64,8 @@ public abstract class AbstractRunner {
             parameters.put(key.toString(), System.getProperties().getProperty(key.toString()));
         }
 
+        // set TCK build timestamp
+        parameters.put(TCK_BUILD_TIMESTAMP_PARAMETER, loadTCKTimestamp());
     }
 
     public void loadParameters(File file) throws Exception {
@@ -113,6 +117,27 @@ public abstract class AbstractRunner {
         return parameters;
     }
 
+    private String loadTCKTimestamp() {
+        StringBuilder result = new StringBuilder();
+
+        InputStream stream = getClass().getResourceAsStream(TCK_BUILD_TIMESTAMP);
+        if (stream != null) {
+            try {
+                BufferedReader br = new BufferedReader(new InputStreamReader(stream));
+
+                String s = null;
+                while ((s = br.readLine()) != null) {
+                    result.append(s);
+                }
+
+                br.close();
+            } catch (Exception e) {
+            }
+        }
+
+        return result.toString();
+    }
+
     // --- groups ---
 
     public void loadDefaultTckGroups() throws Exception {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/pom.xml
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/pom.xml?rev=1162578&r1=1162577&r2=1162578&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/pom.xml (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/pom.xml Sun Aug 28 19:43:53 2011
@@ -96,13 +96,14 @@
                          <configuration>
                              <target>
                                  <property name="version" value="${maven.version}" />
-                                 <property name="timestamp" value="${maven.build.timestamp}" />
+                                 <property name="timestamp" value="${timestamp}" />
+                                 <property name="revision" value="${buildNumber}" />
                                  <property name="basedir" value="${maven.basedir}" />
                                  <property name="targetdir" value="${project.build.directory}" />
                                  <property name="workbench.jar" value="${project.artifactId}-${project.version}.${project.packaging}" />
                                  
                                  <!-- build timestamp -->
-                                 <echo file="${targetdir}/generated-resources/META-INF/build-timestamp.txt">Version: ${project.version} / Build: ${timestamp}</echo>
+                                 <echo file="${targetdir}/generated-resources/META-INF/build-timestamp.txt">Version: ${project.version} / Revision: ${revision} / Build: ${timestamp}</echo>
                                  
                                  <!-- start scripts -->
                                  <mkdir dir="${targetdir}/start" />
@@ -111,7 +112,7 @@
                                  </copy>
                                  <replace dir="${targetdir}/start">
                                      <replacefilter token="@workbench.jar@" value="${workbench.jar}" />
-                                     <replacefilter token="@version@" value="Version: ${project.version} / Build: ${timestamp}" />
+                                     <replacefilter token="@version@" value="Version: ${project.version} / Revision: ${revision} / Build: ${timestamp}" />
                                  </replace>
                                  <chmod dir="${targetdir}/start" perm="+x" includes="**/*.sh" />
                              </target>

Modified: chemistry/opencmis/trunk/pom.xml
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/pom.xml?rev=1162578&r1=1162577&r2=1162578&view=diff
==============================================================================
--- chemistry/opencmis/trunk/pom.xml (original)
+++ chemistry/opencmis/trunk/pom.xml Sun Aug 28 19:43:53 2011
@@ -257,6 +257,26 @@
         </pluginManagement>
         <plugins>
             <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>buildnumber-maven-plugin</artifactId>
+                <version>1.0</version>
+                <executions>
+                    <execution>
+                        <phase>validate</phase>
+                        <goals>
+                            <goal>create</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <doCheck>false</doCheck>
+                    <doUpdate>false</doUpdate>
+                    <getRevisionOnlyOnce>true</getRevisionOnlyOnce>
+                    <revisionOnScmFailure>?</revisionOnScmFailure>
+                    <timestampFormat>{0,date,yyyy-MM-dd'T'HH:mm:ssZ}</timestampFormat>
+                </configuration>
+            </plugin>
+            <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-war-plugin</artifactId>
                 <configuration>
@@ -346,6 +366,7 @@
                         <manifestEntries>
                             <X-Compile-Source-JDK>${maven.compile.source}</X-Compile-Source-JDK>
                             <X-Compile-Target-JDK>${maven.compile.target}</X-Compile-Target-JDK>
+                            <X-Apache-SVN-Revision>${buildNumber}</X-Apache-SVN-Revision>
                         </manifestEntries>
                     </archive>
                 </configuration>