aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build.xml6
-rw-r--r--coreAPI/build.xml25
-rw-r--r--coreAPI/src/java/net/java/games/input/Version.java12
-rw-r--r--coreAPI/src/java/net/java/games/input/test/VersionTest.java14
4 files changed, 49 insertions, 8 deletions
diff --git a/build.xml b/build.xml
index 9cb1087..0d7898f 100644
--- a/build.xml
+++ b/build.xml
@@ -57,6 +57,12 @@
</antcall>
</target>
+ <target name="versiontest" depends="init,all" description="Try running it.">
+ <antcall target="runtest">
+ <param name="mainclass" value="net.java.games.input.test.VersionTest"/>
+ </antcall>
+ </target>
+
<macrodef name="iterate">
<attribute name="target"/>
<sequential>
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());
+ }
+
+}