svn commit: r7017 - trunk: . src/net/java/sip/communicator/impl/version

damencho at dev.java.net damencho at dev.java.net
Tue Apr 20 13:51:18 CEST 2010


Author: damencho
Date: 2010-04-20 11:51:16+0000
New Revision: 7017

Added:
   trunk/src/net/java/sip/communicator/impl/version/RevisionID.java
   trunk/src/net/java/sip/communicator/impl/version/RevisionID.java.tmpl
Modified:
   trunk/build.xml
   trunk/src/net/java/sip/communicator/impl/version/VersionImpl.java

Log:
Add revision number template in order we can change revision numbers in version service.

Modified: trunk/build.xml
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/build.xml?view=diff&rev=7017&p1=trunk/build.xml&p2=trunk/build.xml&r1=7016&r2=7017
==============================================================================
--- trunk/build.xml	(original)
+++ trunk/build.xml	2010-04-20 11:51:16+0000
@@ -435,6 +435,15 @@
         <!-- set the build id according to the cruisecontrol property -->
         <replace file="${src}/net/java/sip/communicator/impl/version/NightlyBuildID.java"
             token="build.id" value="${build.label}"/>
+
+        <!-- create a class that would contain our nightly revision.id if any -->
+        <copy file="${src}/net/java/sip/communicator/impl/version/RevisionID.java.tmpl"
+              tofile="${src}/net/java/sip/communicator/impl/version/RevisionID.java"
+              overwrite="true"/>
+
+        <!-- set the build id according to the cruisecontrol property -->
+        <replace file="${src}/net/java/sip/communicator/impl/version/RevisionID.java"
+            token="revision.id" value="${build.label}"/>
     </target>
 
     <!-- SIP Communicator Version -->

Added: trunk/src/net/java/sip/communicator/impl/version/RevisionID.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/version/RevisionID.java?view=auto&rev=7017
==============================================================================
--- (empty file)
+++ trunk/src/net/java/sip/communicator/impl/version/RevisionID.java	2010-04-20 11:51:16+0000
@@ -0,0 +1,17 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.impl.version;
+
+/**
+ * This file is autoupdated by build.xml in order to set revision id.
+ *
+ * @author Damian Minkov
+ */
+public class RevisionID
+{
+    public static final String REVISION_ID="0";
+}

Added: trunk/src/net/java/sip/communicator/impl/version/RevisionID.java.tmpl
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/version/RevisionID.java.tmpl?view=auto&rev=7017
==============================================================================
--- (empty file)
+++ trunk/src/net/java/sip/communicator/impl/version/RevisionID.java.tmpl	2010-04-20 11:51:16+0000
@@ -0,0 +1,17 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.impl.version;
+
+/**
+ * This file is autoupdated by build.xml in order to set revision id.
+ *
+ * @author Damian Minkov
+ */
+public class RevisionID
+{
+    public static final String REVISION_ID="revision.id";
+}

Modified: trunk/src/net/java/sip/communicator/impl/version/VersionImpl.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/version/VersionImpl.java?view=diff&rev=7017&p1=trunk/src/net/java/sip/communicator/impl/version/VersionImpl.java&p2=trunk/src/net/java/sip/communicator/impl/version/VersionImpl.java&r1=7016&r2=7017
==============================================================================
--- trunk/src/net/java/sip/communicator/impl/version/VersionImpl.java	(original)
+++ trunk/src/net/java/sip/communicator/impl/version/VersionImpl.java	2010-04-20 11:51:16+0000
@@ -48,14 +48,6 @@
     public static final String PRE_RELEASE_ID = "alpha3";
 
     /**
-     * Returns the version revision number of the current SIP Communicator
-     * version. In an example 2.3.1 version string 1 is the revision number.
-     * The version revision number number changes after applying bug fixes and
-     * possible some small enhancements to a given SIP Communicator version.
-     */
-    public static final int VERSION_REVISION = 0;
-
-    /**
      * Indicates if this SIP Communicator version corresponds to a nightly build
      * of a repository snapshot or to an official SIP Communicator release.
      */
@@ -119,7 +111,14 @@
         if(isPreRelease())
             return -1;
 
-        return VERSION_REVISION;
+        try
+        {
+            return Integer.valueOf(RevisionID.REVISION_ID);
+        } catch (NumberFormatException numberFormatException)
+        {
+            // if we cannot parse the revision number return 0
+            return 0;
+        }
     }
 
     /**

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe at sip-communicator.dev.java.net
For additional commands, e-mail: commits-help at sip-communicator.dev.java.net





More information about the commits mailing list