mirror of
https://github.com/shadowfacts/jinput-arm64.git
synced 2025-12-06 08:01:59 +01:00
Add version information that hudson will update.
This commit is contained in:
parent
530a7eaf94
commit
32829e5df6
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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">
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
14
coreAPI/src/java/net/java/games/input/test/VersionTest.java
Normal file
14
coreAPI/src/java/net/java/games/input/test/VersionTest.java
Normal file
|
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in a new issue