Change versioning to allow for an easier integration of SVN revision and build number. Removes version revision leaving the version to major.minor[.build-label] where build label may include things like svn revisions, dates, etc.

cusax-fix
Emil Ivov 13 years ago
parent 5cb8ad46a8
commit 98a6dde829

@ -64,7 +64,8 @@
<attribute name="javadoc_location" value="http://dbus.freedesktop.org/doc/dbus-java/api/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/installer-exclude/libjitsi.jar"/>
<classpathentry kind="lib" path="lib/installer-exclude/libjitsi.jar" sourcepath="/Users/emcho/devel/libjitsi/src"/>
<classpathentry kind="lib" path="/Users/emcho/devel/jitsi/lib/installer-exclude/libphonenumber-2.4.jar"/>
<classpathentry kind="lib" path="lib/installer-exclude/log4j-1.2.8.jar"/>
<classpathentry kind="lib" path="lib/installer-exclude/mac_widgets-0.9.5.jar"/>
<classpathentry kind="lib" path="lib/installer-exclude/objenesis-1.2.jar"/>

@ -49,7 +49,7 @@
<!-- set the build label property and make it take the cc bild into account -->
<condition property="build.label"
value="nightly.${label}">
value="${label}">
<isset property="label"/>
</condition>
@ -450,11 +450,6 @@
<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}"/>

@ -1,5 +1,5 @@
/*
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
@ -13,8 +13,5 @@
*/
public class NightlyBuildID
{
/**
* The build ID.
*/
public static final String BUILD_ID="0.build.by.SVN";
public static final String BUILD_ID="1234.5678";
}

@ -1,17 +0,0 @@
/*
* 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";
}

@ -18,18 +18,18 @@ public class VersionImpl
implements Version
{
/**
* The version major of the current SIP Communicator version. In an
* The version major of the current Jitsi version. In an
* example 2.3.1 version string 2 is the version major. The version major
* number changes when a relatively extensive set of new features and
* possibly rearchitecturing have been applied to the SIP Communicator.
* possibly rearchitecturing have been applied to the Jitsi.
*/
public static final int VERSION_MAJOR = 1;
/**
* The version major of the current SIP Communicator version. In an
* The version major of the current Jitsi version. In an
* example 2.3.1 version string 2 is the version major. The version major
* number changes when a relatively extensive set of new features and
* possibly rearchitecturing have been applied to the SIP Communicator.
* possibly rearchitecturing have been applied to the Jitsi.
*/
public static final int VERSION_MINOR = 1;
@ -40,16 +40,14 @@ public class VersionImpl
public static final boolean IS_PRE_RELEASE_VERSION = false;
/**
* Returns the version prerelease ID of the current SIP Communicator version
* and null if this version is not a prerelease. Version pre-release id-s
* and version revisions are exclusive, so in case this version is a pre-
* release the revision will bereturn null.
* Returns the version prerelease ID of the current Jitsi version
* and null if this version is not a prerelease.
*/
public static final String PRE_RELEASE_ID = "beta1";
/**
* Indicates if this SIP Communicator version corresponds to a nightly build
* of a repository snapshot or to an official SIP Communicator release.
* Indicates if this Jitsi version corresponds to a nightly build
* of a repository snapshot or to an official Jitsi release.
*/
public static final boolean IS_NIGHTLY_BUILD = true;
@ -65,15 +63,15 @@ public class VersionImpl
/**
* Returns the VersionImpl instance describing the current version of
* SIP Communicator.
* Jitsi.
*/
public static final VersionImpl CURRENT_VERSION = new VersionImpl();
/**
* Returns the version major of the current SIP Communicator version. In an
* Returns the version major of the current Jitsi version. In an
* example 2.3.1 version string 2 is the version major. The version major
* number changes when a relatively extensive set of new features and
* possibly rearchitecturing have been applied to the SIP Communicator.
* possibly rearchitecturing have been applied to the Jitsi.
*
* @return the version major String.
*/
@ -83,10 +81,10 @@ public int getVersionMajor()
}
/**
* Returns the version minor of the current SIP Communicator version. In an
* Returns the version minor of the current Jitsi version. In an
* example 2.3.1 version string 3 is the version minor. The version minor
* number changes after adding enhancements and possibly new features to a
* given SIP Communicator version.
* given Jitsi version.
*
* @return the version minor integer.
*/
@ -96,35 +94,11 @@ public int getVersionMinor()
}
/**
* 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.
*
* @return the version revision number or -1 if this version of
* SIP Communicator corresponds to a pre-release.
*/
public int getVersionRevision()
{
if(isPreRelease())
return -1;
try
{
return Integer.valueOf(RevisionID.REVISION_ID);
} catch (NumberFormatException numberFormatException)
{
// if we cannot parse the revision number return -1, so we skip it
return -1;
}
}
/**
* Indicates if this SIP Communicator version corresponds to a nightly build
* of a repository snapshot or to an official SIP Communicator release.
* Indicates if this Jitsi version corresponds to a nightly build
* of a repository snapshot or to an official Jitsi release.
*
* @return true if this is a build of a nightly repository snapshot and
* false if this is an official SIP Communicator release.
* false if this is an official Jitsi release.
*/
public boolean isNightly()
{
@ -133,8 +107,8 @@ public boolean isNightly()
/**
* If this is a nightly build, returns the build identifies (e.g.
* nightly-2007.12.07-06.45.17). If this is not a nightly build SIP
* Communicator version, the method returns null.
* nightly-2007.12.07-06.45.17). If this is not a nightly build Jitsi
* version, the method returns null.
*
* @return a String containing a nightly build identifier or null if this is
* a release version and therefore not a nightly build
@ -158,10 +132,8 @@ public boolean isPreRelease()
}
/**
* Returns the version prerelease ID of the current SIP Communicator version
* and null if this version is not a prerelease. Version pre-release id-s
* and version revisions are exclusive, so in case this version is a pre-
* release the revision will bereturn null
* Returns the version prerelease ID of the current Jitsi version
* and null if this version is not a prerelease.
*
* @return a String containing the version prerelease ID.
*/
@ -197,13 +169,13 @@ public int compareTo(Version version)
/**
* Compares the <tt>version</tt> parameter to this version and returns true
* if and only if both reference the same SIP Communicator version and
* if and only if both reference the same Jitsi version and
* false otherwise.
*
* @param version the version instance that we'd like to compare with this
* one.
* @return true if and only the version param references the same
* SIP Communicator version as this Version instance and false otherwise.
* Jitsi version as this Version instance and false otherwise.
*/
public boolean equals(Object version)
{
@ -216,13 +188,12 @@ public boolean equals(Object version)
/**
* Returns a String representation of this Version instance in the generic
* form of major.minor.revision[.nightly.build.id]. If you'd just
* like to obtain the version of SIP Communicator so that you could display
* it (e.g. in a Help->About dialog) then all you need is calling this
* method.
* form of major.minor[.nightly.build.id]. If you'd just like to obtain the
* version of Jitsi so that you could display it (e.g. in a Help->About
* dialog) then all you need is calling this method.
*
* @return a major.minor.revision[.build] String containing the complete
* SIP Communicator version.
* @return a major.minor[.build] String containing the complete
* Jitsi version.
*/
public String toString()
{
@ -237,19 +208,10 @@ public String toString()
versionStringBuff.append("-");
versionStringBuff.append(getPreReleaseID());
}
else
{
int rev = getVersionRevision();
if(rev >= 0)
{
versionStringBuff.append(".");
versionStringBuff.append(Integer.toString(rev));
}
}
if(isNightly())
{
versionStringBuff.append("-");
versionStringBuff.append(".");
versionStringBuff.append(getNightlyBuildID());
}
@ -258,10 +220,10 @@ public String toString()
/**
* Returns the VersionImpl instance describing the current version of
* SIP Communicator.
* Jitsi.
*
* @return the VersionImpl instance describing the current version of
* SIP Communicator.
* Jitsi.
*/
public static final VersionImpl currentVersion()
{
@ -270,10 +232,10 @@ public static final VersionImpl currentVersion()
/**
* Returns the name of the application that we're currently running. Default
* MUST be SIP Communicator.
* MUST be Jitsi.
*
* @return the name of the application that we're currently running. Default
* MUST be SIP Communicator.
* MUST be Jitsi.
*/
public String getApplicationName()
{

@ -98,42 +98,39 @@ public synchronized void checkForUpdates(
return;
}
Thread checkForUpdatesThread
= new Thread()
Thread checkForUpdatesThread = new Thread()
{
@Override
public void run()
{
@Override
public void run()
try
{
try
if(isLatestVersion())
{
if(isLatestVersion())
if(notifyAboutNewestVersion)
{
if(notifyAboutNewestVersion)
{
ResourceManagementService resources
= Resources.getResources();
UpdateActivator.getUIService()
.getPopupDialog()
.showMessagePopupDialog(
resources.getI18NString(
"plugin.updatechecker.DIALOG_NOUPDATE"),
resources.getI18NString(
"plugin.updatechecker.DIALOG_NOUPDATE_TITLE"),
PopupDialog.INFORMATION_MESSAGE);
}
ResourceManagementService resources
= Resources.getResources();
UpdateActivator.getUIService().getPopupDialog()
.showMessagePopupDialog(resources.getI18NString(
"plugin.updatechecker.DIALOG_NOUPDATE"),
resources.getI18NString(
"plugin.updatechecker.DIALOG_NOUPDATE_TITLE"),
PopupDialog.INFORMATION_MESSAGE);
}
else if (OSUtils.IS_WINDOWS)
showWindowsNewVersionAvailableDialog();
else
showGenericNewVersionAvailableDialog();
}
finally
{
exitCheckForUpdates(null);
}
else if (OSUtils.IS_WINDOWS)
showWindowsNewVersionAvailableDialog();
else
showGenericNewVersionAvailableDialog();
}
};
finally
{
exitCheckForUpdates(null);
}
}
};
checkForUpdatesThread.setDaemon(true);
@ -858,12 +855,13 @@ private static void windowsUpdate()
if(ver.isNightly())
deltaTarget = ver.getNightlyBuildID();
else
deltaTarget = String.valueOf(ver.getVersionRevision());
deltaTarget = String.valueOf(ver.toString());
String deltaLink
= downloadLink.replace(
latestVersion,
latestVersion + "-delta-" + deltaTarget);
/*
* TODO Download the delta update regardless of the logging level
* once the generation of delta updates is implemented and the whole

Loading…
Cancel
Save