aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorswpalmer <[email protected]>2003-09-04 15:12:02 +0000
committerswpalmer <[email protected]>2003-09-04 15:12:02 +0000
commitad2792c3bdd53de1e0b3b78b4c15cb60f8d15ef5 (patch)
treeccbd592af31d1e0b0324606e1a02bdfbc8636aa5 /plugins
parentd38e22b9e7c5bf6320e16dfef6c2b59cbd6a0957 (diff)
Preliminary Ant build support for OS X
git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@49 e343933a-64c8-49c5-92b1-88f2ce3e89e8
Diffstat (limited to 'plugins')
-rw-r--r--plugins/OSX/build.xml82
-rw-r--r--plugins/OSX/src/native/build.xml18
2 files changed, 100 insertions, 0 deletions
diff --git a/plugins/OSX/build.xml b/plugins/OSX/build.xml
new file mode 100644
index 0000000..e34804d
--- /dev/null
+++ b/plugins/OSX/build.xml
@@ -0,0 +1,82 @@
+<?xml version="1.0" ?>
+<project basedir="." default="all" name="OSX Plugin">
+
+ <target name="init">
+ <property name="hello" value="world"/>
+ <mkdir dir="classes"/>
+ <mkdir dir="bin"/>
+ </target>
+
+ <target depends="init" name="compile">
+ <javac debug="true" deprecation="true" destdir="classes" source="1.4" srcdir="src/java">
+ <classpath>
+ <pathelement location="../../coreAPI/bin/jinput.jar"/>
+ <pathelement location="../../coreAPI/lib/jutils.jar"/>
+ </classpath>
+ </javac>
+ </target>
+
+ <target depends="init,compile" name="jar">
+ <jar jarfile="bin/HIDWrapper.jar" compress="true" basedir="classes">
+ <exclude name="**/*.java"/>
+ <exclude name="HIDWrapper.jar"/>
+ <exclude name="apidoc"/>
+ </jar>
+ <copy file="bin/HIDWrapper.jar" todir="../../coreAPI/src/tests/controller" />
+ </target>
+
+ <target depends="compileNativeJinputLib,jar" description="Build everything." name="all">
+ <echo message="Application built. Hello ${hello}!"/>
+ </target>
+
+ <target name="javadoc" depends="init" description="Javadoc for OS X plugin for JInput.">
+ <mkdir dir="apidocs"/>
+ <javadoc packagenames="net.java.games.input.*"
+ destdir="apidocs"
+ additionalparam="-source 1.4"
+ link="../../../coreAPI/apidocs">
+ <sourcepath>
+ <pathelement location="src/java"/>
+ </sourcepath>
+ <classpath>
+ <pathelement location="../../coreAPI/bin/jinput.jar"/>
+ <pathelement location="../../coreAPI/lib/jutils.jar"/>
+ </classpath>
+ </javadoc>
+ </target>
+
+ <target description="Clean all build products." name="clean">
+ <delete failonerror="no">
+ <fileset dir="classes">
+ <include name="**/*.class"/>
+ </fileset>
+ </delete>
+ <delete file="bin/HIDWrapper.jar" failonerror="no"/>
+ <delete file="src/native/libjinput.jnilib" failonerror="no"/>
+ <delete file="../../coreAPI/src/tests/controller/HIDWrapper.jar" failonerror="no" />
+ <delete file="../../coreAPI/src/tests/controller/libjinput.jnilib" failonerror="no"/>
+ <delete file="apidoc" failonerror="no"/>
+ </target>
+
+ <target depends="init,compile" name="createJNIHeaders">
+ <javah destdir="src/native">
+ <classpath>
+ <pathelement path="classes"/>
+ <pathelement location="../../coreAPI/classes"/>
+ </classpath>
+ <class name="net.java.games.input.OSXEnvironmentPlugin"/>
+ </javah>
+ <!-- "net_java_games_input_OSXEnvironmentPlugin.h" -->
+ </target>
+
+ <!-- <target depends="init" name="createNativeDefinitions.java">
+ <exec dir="." executable="./getDefinitions" os="linux" output="src/java/net/java/games/input/NativeDefinitions.java">
+ <arg line="/usr/include/linux/input.h"/>
+ </exec>
+ </target> -->
+
+ <target name="compileNativeJinputLib" depends="init,createJNIHeaders" >
+ <ant dir="src/native" target="compileNativeJinputLib"/>
+ <copy file="src/native/libjinput.jnilib" todir="../../coreAPI/src/tests/controller" />
+ </target>
+</project>
diff --git a/plugins/OSX/src/native/build.xml b/plugins/OSX/src/native/build.xml
new file mode 100644
index 0000000..3d6a964
--- /dev/null
+++ b/plugins/OSX/src/native/build.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" ?>
+<project name="OS X Plugin, Native code" basedir="." default="compileNativeJinputLib">
+
+ <target name="init">
+ <mkdir dir="build"/>
+ </target>
+
+ <target name="compileNativeJinputLib" depends="init">
+ <exec dir="." executable="cc" os="Mac OS X">
+
+ <arg line="-c -I${java.home}/include jinputjnilib.c"/>
+ </exec>
+ <exec dir="." executable="cc" os="Mac OS X">
+ <arg line="-bundle -o libjinput.jnilib jinputjnilib.o -framework JavaVM -framework CoreFoundation -framework IOKit "/>
+ </exec>
+ </target>
+
+</project>