From 32788f8e7c9fd732aca14696dcd72371a252038e Mon Sep 17 00:00:00 2001 From: Damian Minkov Date: Tue, 20 Apr 2010 11:51:16 +0000 Subject: [PATCH] Add revision number template in order we can change revision numbers in version service. --- build.xml | 9 +++++++++ .../communicator/impl/version/RevisionID.java | 17 +++++++++++++++++ .../impl/version/RevisionID.java.tmpl | 17 +++++++++++++++++ .../communicator/impl/version/VersionImpl.java | 17 ++++++++--------- 4 files changed, 51 insertions(+), 9 deletions(-) create mode 100644 src/net/java/sip/communicator/impl/version/RevisionID.java create mode 100644 src/net/java/sip/communicator/impl/version/RevisionID.java.tmpl diff --git a/build.xml b/build.xml index b1c0f365d..f19fd6674 100644 --- a/build.xml +++ b/build.xml @@ -435,6 +435,15 @@ + + + + + + diff --git a/src/net/java/sip/communicator/impl/version/RevisionID.java b/src/net/java/sip/communicator/impl/version/RevisionID.java new file mode 100644 index 000000000..ebfc8fc7e --- /dev/null +++ b/src/net/java/sip/communicator/impl/version/RevisionID.java @@ -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"; +} diff --git a/src/net/java/sip/communicator/impl/version/RevisionID.java.tmpl b/src/net/java/sip/communicator/impl/version/RevisionID.java.tmpl new file mode 100644 index 000000000..caf93775a --- /dev/null +++ b/src/net/java/sip/communicator/impl/version/RevisionID.java.tmpl @@ -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"; +} diff --git a/src/net/java/sip/communicator/impl/version/VersionImpl.java b/src/net/java/sip/communicator/impl/version/VersionImpl.java index e0f102687..f4b0541ce 100644 --- a/src/net/java/sip/communicator/impl/version/VersionImpl.java +++ b/src/net/java/sip/communicator/impl/version/VersionImpl.java @@ -47,14 +47,6 @@ public class VersionImpl */ 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 @@ public int getVersionRevision() 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; + } } /**