diff options
author | endolf <[email protected]> | 2009-12-12 13:29:01 +0000 |
---|---|---|
committer | endolf <[email protected]> | 2009-12-12 13:29:01 +0000 |
commit | e78a60a0dc6ebc4cc24a27ea0eb15b5f1904dd33 (patch) | |
tree | 9cc8002829b52cc018f3fbd9b9ce8cb9f7ba9708 /coreAPI | |
parent | 341499addf81df07ea33abadb512cdf089c4530a (diff) |
Add version information that hudson will update.
git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@231 e343933a-64c8-49c5-92b1-88f2ce3e89e8
Diffstat (limited to 'coreAPI')
-rw-r--r-- | coreAPI/build.xml | 25 | ||||
-rw-r--r-- | coreAPI/src/java/net/java/games/input/Version.java | 12 | ||||
-rw-r--r-- | coreAPI/src/java/net/java/games/input/test/VersionTest.java | 14 |
3 files changed, 43 insertions, 8 deletions
diff --git a/coreAPI/build.xml b/coreAPI/build.xml index d4986ed..bef1953 100644 --- a/coreAPI/build.xml +++ b/coreAPI/build.xml @@ -9,13 +9,24 @@ </target> <target name="compile" depends="init"> - <javac srcdir="src/java" destdir="classes" debug="true" deprecation="true" source="1.4" target="1.4"> - <include name="net/**"/> - <!-- To add something to the classpath: --> - <classpath> - <pathelement location="${utils}"/> - </classpath> - </javac> + <javac srcdir="src/java" destdir="classes" debug="true" deprecation="true" source="1.4" target="1.4"> + <include name="net/**"/> + <exclude name="**/Version.java"/> + <!-- To add something to the classpath: --> + <classpath> + <pathelement location="${utils}"/> + </classpath> + </javac> + <buildnumber/> + <copy file="src/java/net/java/games/input/Version.java" + todir="build/src/java/net/java/games/input/" overwrite="true"> + <filterset> + <filter token="BUILD_NUMBER" value="${build.number}"/> + </filterset> + </copy> + <javac srcdir="build/src/java" destdir="classes" debug="true" deprecation="true" source="1.4" target="1.4"> + <include name="net/**" /> + </javac> </target> <target name="jar" depends="init,compile"> diff --git a/coreAPI/src/java/net/java/games/input/Version.java b/coreAPI/src/java/net/java/games/input/Version.java index 582e66a..06491d1 100644 --- a/coreAPI/src/java/net/java/games/input/Version.java +++ b/coreAPI/src/java/net/java/games/input/Version.java @@ -89,8 +89,14 @@ public final class Version { /** * Version string of this build. */ - private static final String version = "2.0.0-b01"; + private static final String apiVersion = "2.0.1"; + private static final String buildNumber = "@BUILD_NUMBER@"; + /* + * Split so that ant does not replace the token; + */ + private static final String antToken = "@BUILD_" + "NUMBER@"; + /** * Returns the verison string and build number of * this implementation. See the class descritpion @@ -99,6 +105,10 @@ public final class Version { * @return The version string of this implementation. */ public static String getVersion() { + String version = apiVersion; + if(!antToken.equals(buildNumber)) { + version += "-b" + buildNumber; + } return version; } } diff --git a/coreAPI/src/java/net/java/games/input/test/VersionTest.java b/coreAPI/src/java/net/java/games/input/test/VersionTest.java new file mode 100644 index 0000000..b97cc62 --- /dev/null +++ b/coreAPI/src/java/net/java/games/input/test/VersionTest.java @@ -0,0 +1,14 @@ +package net.java.games.input.test; + +import net.java.games.input.Version; + +public class VersionTest { + + /** + * @param args + */ + public static void main(String[] args) { + System.out.println("JInput version: " + Version.getVersion()); + } + +} |