|
From: <ma...@us...> - 2010-04-12 23:22:14
|
Revision: 3321
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3321&view=rev
Author: matzon
Date: 2010-04-12 23:22:08 +0000 (Mon, 12 Apr 2010)
Log Message:
-----------
forcefull check of version match when building
Modified Paths:
--------------
trunk/LWJGL/build.xml
Added Paths:
-----------
trunk/LWJGL/src/java/org/lwjgl/test/NativeTest.java
Modified: trunk/LWJGL/build.xml
===================================================================
--- trunk/LWJGL/build.xml 2010-04-12 19:04:27 UTC (rev 3320)
+++ trunk/LWJGL/build.xml 2010-04-12 23:22:08 UTC (rev 3321)
@@ -315,6 +315,29 @@
</echo>
</target>
+ <macrodef name="version-check">
+ <attribute name="platform"/>
+ <sequential>
+ <java classname="org.lwjgl.test.NativeTest" logError="false" resultproperty="nativetest.res" outputproperty="nativetest.out" errorproperty="nativetest.err" fork="true">
+ <jvmarg value="-Djava.library.path=libs/@{platform}"/>
+ <classpath>
+ <pathelement path="${lwjgl.bin}"/>
+ <pathelement path="${java.class.path}"/>
+ </classpath>
+ </java>
+
+ <fail message="Unable to load native library: ${nativetest.err}">
+ <condition>
+ <not>
+ <equals arg1="OK" arg2="${nativetest.out}"/>
+ </not>
+ </condition>
+ </fail>
+
+ <echo message="Successfully executed NativeTest"/>
+ </sequential>
+ </macrodef>
+
<!-- Compiles the Java source code -->
<target name="compile" description="Compiles the java source code" depends="-initialize">
<javac debug="yes" destdir="${lwjgl.bin}" source="1.4" target="1.4" classpath="${lwjgl.lib}/jinput.jar:${lwjgl.lib}/AppleJavaExtensions.jar" taskname="core">
@@ -359,6 +382,7 @@
<copy todir="${lwjgl.lib}/windows">
<fileset dir="${lwjgl.bin}/lwjgl" includes="lwjgl*.dll"/>
</copy>
+ <version-check platform="windows"/>
</target>
<!-- Compiles LWJGL on Linux platforms -->
@@ -367,6 +391,7 @@
<copy todir="${lwjgl.lib}/linux">
<fileset dir="${lwjgl.bin}/lwjgl" includes="liblwjgl*.so"/>
</copy>
+ <version-check platform="linux"/>
</target>
<!-- Compiles LWJGL on solaris platforms -->
@@ -376,12 +401,14 @@
<copy todir="${lwjgl.lib}/solaris">
<fileset dir="${lwjgl.bin}/lwjgl" includes="liblwjgl*.so"/>
</copy>
+ <version-check platform="solaris"/>
</target>
<!-- Compiles LWJGL on Mac platforms -->
<target name="-compile_native_macosx" if="lwjgl.platform.macosx">
<ant antfile="platform_build/macosx_ant/build.xml" inheritAll="false"/>
<copy file="${lwjgl.bin}/lwjgl/liblwjgl.jnilib" todir="${lwjgl.lib}/macosx"/>
+ <version-check platform="macosx"/>
</target>
<target name="repack200" description="Pack200-repack a jar file">
Added: trunk/LWJGL/src/java/org/lwjgl/test/NativeTest.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/test/NativeTest.java (rev 0)
+++ trunk/LWJGL/src/java/org/lwjgl/test/NativeTest.java 2010-04-12 23:22:08 UTC (rev 3321)
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2002-2010 LWJGL Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'LWJGL' nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.lwjgl.test;
+
+import org.lwjgl.Sys;
+
+/**
+ * <br>
+ * Simple test that just checks that the native library loads
+ *
+ * @author Brian Matzon <br...@ma...>
+ * @version $Revision: 2983 $
+ * $Id: SysTest.java 2983 2008-04-07 18:36:09Z matzon $
+ */
+public class NativeTest {
+
+ /**
+ * Entry point for test
+ *
+ * @param args ignored
+ */
+ public static void main(String[] args) {
+ Sys.getVersion();
+ System.out.println("OK");
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|