You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by or...@apache.org on 2014/09/15 17:24:06 UTC

svn commit: r1625062 - in /qpid/trunk/qpid/java/common: build-generate-sources.xml pom.xml src/main/java/org/apache/qpid/common/QpidProperties.java src/main/resources/ src/main/resources/qpidversion.properties

Author: orudyy
Date: Mon Sep 15 15:24:06 2014
New Revision: 1625062

URL: http://svn.apache.org/r1625062
Log:
QPID-6101: Allow setting of qpid version suffix whilst building qpid common library

Added:
    qpid/trunk/qpid/java/common/src/main/resources/
    qpid/trunk/qpid/java/common/src/main/resources/qpidversion.properties
Modified:
    qpid/trunk/qpid/java/common/build-generate-sources.xml
    qpid/trunk/qpid/java/common/pom.xml
    qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/common/QpidProperties.java

Modified: qpid/trunk/qpid/java/common/build-generate-sources.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/build-generate-sources.xml?rev=1625062&r1=1625061&r2=1625062&view=diff
==============================================================================
--- qpid/trunk/qpid/java/common/build-generate-sources.xml (original)
+++ qpid/trunk/qpid/java/common/build-generate-sources.xml Mon Sep 15 15:24:06 2014
@@ -27,7 +27,6 @@
           <isset property="generated-amqp-0-8-dir"/>
           <isset property="generated-amqp-0-10-dir"/>
           <isset property="gentools.classes"/>
-          <isset property="version.file"/>
         </and>
       </not>
     </condition>
@@ -50,29 +49,6 @@
   <property name="gentools.src" value="${basedir}/gentools/src"/>
   <property name="generated.package" value="org/apache/qpid/framing" />
 
-  <property file="${version.file}" prefix="old."/>
-
-  <target name="check-version">
-    <exec executable="svnversion" spawn="false" failifexecutionfails="false"
-        dir="${basedir}" outputproperty="svnversion.output">
-      <arg line="."/>
-    </exec>
-    <condition property="version.stale">
-      <not>
-        <equals arg1="${svnversion.output}" arg2="${old.qpid.svnversion}"/>
-      </not>
-    </condition>
-  </target>
-
-  <target name="create-version" depends="check-version" if="version.stale">
-    <echo message="Writing new qpidversion.properties file with svnversion: '${svnversion.output}'"/>
-    <!-- Write the version.properties out.-->
-    <!-- Echos exactly as shown, so leave no spaces before/after lines -->
-    <echo file="${version.file}" append="false">qpid.version=${project.version}
-qpid.svnversion=${svnversion.output}
-qpid.name=qpid
-</echo>
-  </target>
 
   <target name="amqp-0-10-generation" if="generate.protocol.sources">
       <mkdir dir="${generated-amqp-0-10-dir}"/>
@@ -110,6 +86,6 @@ qpid.name=qpid
     </java>
   </target>
 
-  <target name="generate-sources" depends="amqp-0-8-generation, amqp-0-10-generation, create-version"/>
+  <target name="generate-sources" depends="amqp-0-8-generation, amqp-0-10-generation"/>
 
 </project>

Modified: qpid/trunk/qpid/java/common/pom.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/pom.xml?rev=1625062&r1=1625061&r2=1625062&view=diff
==============================================================================
--- qpid/trunk/qpid/java/common/pom.xml (original)
+++ qpid/trunk/qpid/java/common/pom.xml Mon Sep 15 15:24:06 2014
@@ -33,7 +33,10 @@
     <generated-amqp-0-8-dir>${basedir}/src/main/java</generated-amqp-0-8-dir>
     <generated-amqp-0-10-dir>${basedir}/src/main/java</generated-amqp-0-10-dir>
     <selector.output.dir>${basedir}/src/main/java/org/apache/qpid/filter/selector</selector.output.dir>
-    <version.file>${project.build.directory}/classes/qpidversion.properties</version.file>
+    <qpid.name>qpid</qpid.name>
+    <qpid.version>${project.version}</qpid.version>
+    <qpid.version.suffix></qpid.version.suffix>
+    <buildNumber>Unversioned directory</buildNumber>
   </properties>
 
   <dependencies>
@@ -54,6 +57,14 @@
   </dependencies>
    
   <build>
+
+    <resources>
+        <resource>
+            <directory>src/main/resources</directory>
+            <filtering>true</filtering>
+        </resource>
+    </resources>
+
     <testResources>
         <testResource>
             <directory>${basedir}/src/test/java</directory>
@@ -68,6 +79,24 @@
 
     <plugins>
       <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>buildnumber-maven-plugin</artifactId>
+        <version>1.3</version>
+        <executions>
+            <execution>
+                <phase>validate</phase>
+                <goals>
+                    <goal>create</goal>
+                </goals>
+            </execution>
+        </executions>
+        <configuration>
+            <doCheck>false</doCheck>
+            <doUpdate>false</doUpdate>
+        </configuration>
+      </plugin>
+
+      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-antrun-plugin</artifactId>
         <!--version specified in parent pluginManagement -->

Modified: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/common/QpidProperties.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/common/QpidProperties.java?rev=1625062&r1=1625061&r2=1625062&view=diff
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/common/QpidProperties.java (original)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/common/QpidProperties.java Mon Sep 15 15:24:06 2014
@@ -58,6 +58,9 @@ public class QpidProperties
     /** Defines the name of the version property. */
     public static final String RELEASE_VERSION_PROPERTY = "qpid.version";
 
+    /** Defines the name of the version suffix property. */
+    public static final String RELEASE_VERSION_SUFFIX = "qpid.version.suffix";
+
     /** Defines the name of the source code revision property. */
     public static final String BUILD_VERSION_PROPERTY = "qpid.svnversion";
 
@@ -101,7 +104,9 @@ public class QpidProperties
                 }
 
                 productName = readPropertyValue(props, PRODUCT_NAME_PROPERTY);
-                releaseVersion = readPropertyValue(props, RELEASE_VERSION_PROPERTY);
+                String versionSuffix = (String) props.get(RELEASE_VERSION_SUFFIX);
+                String version = readPropertyValue(props, RELEASE_VERSION_PROPERTY);
+                releaseVersion = versionSuffix == null || "".equals(versionSuffix) ? version : version + ";" + versionSuffix;
                 buildVersion = readPropertyValue(props, BUILD_VERSION_PROPERTY);
             }
         }

Added: qpid/trunk/qpid/java/common/src/main/resources/qpidversion.properties
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/resources/qpidversion.properties?rev=1625062&view=auto
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/resources/qpidversion.properties (added)
+++ qpid/trunk/qpid/java/common/src/main/resources/qpidversion.properties Mon Sep 15 15:24:06 2014
@@ -0,0 +1,23 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+qpid.name=${qpid.name}
+qpid.version=${qpid.version}
+qpid.version.suffix=${qpid.version.suffix}
+qpid.svnversion=${buildNumber}
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org