[jboss-cvs] jbosside/core/plugins/org.jboss.ide.eclipse.core/src/main/org/jboss/ide/eclipse/core ...
Robert Stryker
rawblem at gmail.com
Tue Sep 12 17:31:51 EDT 2006
User: rawb
Date: 06/09/12 17:31:51
Modified: core/plugins/org.jboss.ide.eclipse.core/src/main/org/jboss/ide/eclipse/core
CorePlugin.java
Log:
Added JBoss IDE version ID to the core plugin. This will need to be changed for each release. Also utility method to compare versions.
Revision Changes Path
1.3 +36 -2 jbosside/core/plugins/org.jboss.ide.eclipse.core/src/main/org/jboss/ide/eclipse/core/CorePlugin.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CorePlugin.java
===================================================================
RCS file: /cvsroot/jboss/jbosside/core/plugins/org.jboss.ide.eclipse.core/src/main/org/jboss/ide/eclipse/core/CorePlugin.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- CorePlugin.java 29 Jan 2006 04:21:30 -0000 1.2
+++ CorePlugin.java 12 Sep 2006 21:31:51 -0000 1.3
@@ -25,13 +25,47 @@
* Core plugin.
*
* @author Laurent Etiemble
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class CorePlugin extends AbstractPlugin
{
/** The shared instance */
private static CorePlugin plugin;
+
+ public static final String ALPHA = "alpha";
+ public static final String BETA = "beta";
+ public static final String GA = "GA";
+
+ /**
+ * This variable will need to be updated at every release point.
+ * Whether alpha, beta, major, minor, revision, etc.
+ */
+ private static final String JBOSS_IDE_RELEASE_VERSION = "2.0.0." + BETA + ".2";
+
+ public static final String getCurrentVersion() {
+ return JBOSS_IDE_RELEASE_VERSION;
+ }
+
+
+ /**
+ * Returns 0 on a match, -1 if id is below target, 1 if id is above target
+ */
+ public static final int compare(String id, String targetId) {
+ String[] targetAsArray = targetId.split("\\.");
+ String[] idAsArray = id.split("\\.");
+
+ for( int i = 0; i < targetAsArray.length; i++ ) {
+ if( targetAsArray[i].equals("*"))
+ return 0;
+ if( !idAsArray[i].equals(targetAsArray[i]))
+ return idAsArray[i].compareTo(targetAsArray[i]);
+ }
+
+ return 0;
+ }
+
+
/** The constructor. */
public CorePlugin()
{
More information about the jboss-cvs-commits
mailing list