changeset 44:9d3769896d66

created java folder and simple build script
author Robert McIntyre <rlm@mit.edu>
date Tue, 06 Mar 2012 21:53:31 -0600
parents 480951f6521d
children f6ff410a87fd
files .hgignore java/build.xml java/src/com/aurellem/gb/Gb.java src/com/aurellem/gb/Gb.java
diffstat 4 files changed, 70 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/.hgignore	Tue Mar 06 21:43:28 2012 -0600
     1.2 +++ b/.hgignore	Tue Mar 06 21:53:31 2012 -0600
     1.3 @@ -11,4 +11,7 @@
     1.4  *Makefile.in*
     1.5  config.h.in
     1.6  build/*
     1.7 -build-aux/*
     1.8 \ No newline at end of file
     1.9 +build-aux/*
    1.10 +java/dist/*
    1.11 +java/headers/*
    1.12 +java//ant-targets-build.xml
    1.13 \ No newline at end of file
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/java/build.xml	Tue Mar 06 21:53:31 2012 -0600
     2.3 @@ -0,0 +1,43 @@
     2.4 +<project name="gb-bindings" default="dist" basedir="."> 
     2.5 +
     2.6 +  <property name="build" value="build"/>
     2.7 +  <property name="src" value="src"/>
     2.8 +  <property name="dist" value="dist"/>
     2.9 +  <property name="headers"  value="headers"/>
    2.10 +  <property name="artifacts" value="../artifacts"/>
    2.11 +
    2.12 +  <target name="prepare">
    2.13 +    <mkdir dir="${build}"/>
    2.14 +    <mkdir dir="${headers}"/>
    2.15 +    <mkdir dir="${dist}"/> 
    2.16 +  </target>
    2.17 +
    2.18 +  <target name="compile" depends="prepare" >
    2.19 +    <javac srcdir="${src}" destdir="${build}"
    2.20 +	   includeantruntime="false"/>
    2.21 +  </target>
    2.22 +
    2.23 +  <target name="native" depends="prepare, compile" >
    2.24 +    <javah class="com.aurellem.gb.Gb"
    2.25 +	   destdir="${headers}"
    2.26 +	   classpath="${build}"/>
    2.27 +  </target>
    2.28 +
    2.29 +  <target name="dist">
    2.30 +    <jar jarfile="${dist}/gb-bindings.jar">
    2.31 +      <fileset dir="${build}"/>
    2.32 +      <fileset dir="${src}"/>
    2.33 +    </jar>
    2.34 +  </target>
    2.35 +
    2.36 +  <target name="all" depends="native, dist"/>
    2.37 +    
    2.38 +
    2.39 +  <target name="clean" > 
    2.40 +    <delete dir="${build}"/> 
    2.41 +    <delete dir="${dist}"/> 
    2.42 +    <delete dir="${headers}"/>
    2.43 +  </target> 
    2.44 +
    2.45 +</project>
    2.46 +
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/java/src/com/aurellem/gb/Gb.java	Tue Mar 06 21:53:31 2012 -0600
     3.3 @@ -0,0 +1,23 @@
     3.4 +package com.aurellem.gb;
     3.5 +
     3.6 +import java.nio.ByteBuffer;
     3.7 +
     3.8 +
     3.9 +public class Gb {
    3.10 + 
    3.11 +    
    3.12 +    public Gb(){}
    3.13 +
    3.14 +
    3.15 +    /** 
    3.16 +     * Hello World! This is just to test the native interface.
    3.17 +     */
    3.18 +    public native void sayHello();
    3.19 +    
    3.20 +    /** 
    3.21 +     * Run the emulator on a given rom
    3.22 +     * @param rom - the name of the rom.
    3.23 +     */
    3.24 +    public native void startEmulator(String rom);
    3.25 +
    3.26 +}
     4.1 --- a/src/com/aurellem/gb/Gb.java	Tue Mar 06 21:43:28 2012 -0600
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,23 +0,0 @@
     4.4 -package com.aurellem.gb;
     4.5 -
     4.6 -import java.nio.ByteBuffer;
     4.7 -
     4.8 -
     4.9 -public class Gb {
    4.10 - 
    4.11 -    
    4.12 -    public Gb(){}
    4.13 -
    4.14 -
    4.15 -    /** 
    4.16 -     * Hello World! This is just to test the native interface.
    4.17 -     */
    4.18 -    public native void sayHello();
    4.19 -    
    4.20 -    /** 
    4.21 -     * Run the emulator on a given rom
    4.22 -     * @param rom - the name of the rom.
    4.23 -     */
    4.24 -    public native void startEmulator(String rom);
    4.25 -
    4.26 -}