<?xml version="1.0"?>
<project name="Processing Core" default="build">

  <target name="clean" description="Clean out the build directories">
    <delete dir="bin" />
    <delete file="library/core.jar" />
  </target>
  
  <target name="compile" description="Compile">
    <taskdef name="methods" 
	     classname="PAppletMethods" 
	     classpath="methods/methods.jar" />
    <methods dir="${basedir}/src/processing/core" recorder="true" />

    <mkdir dir="bin" />
    <javac source="1.7"
	   target="1.7" 
	   encoding="UTF-8"
	   includeAntRuntime="false"
	   debug="true"
	   srcdir="src" destdir="bin"
	   classpath="library/jogl-all.jar; library/gluegen-rt.jar"
	   nowarn="true"
	   compiler="org.eclipse.jdt.core.JDTCompilerAdapter">
      <compilerclasspath path="../java/mode/ecj.jar" />
    </javac>
    
    <!-- Copy the jnilib to the bin folder so it's included. -->
    <copy todir="bin/japplemenubar" 
	  file="src/japplemenubar/libjAppleMenuBar.jnilib" />

    <!-- Copy shaders to bin. (Eclipse does this automatically.) -->
    <copy todir="bin">
      <fileset dir="src">
	<include name="processing/opengl/*.glsl" />
	<include name="icon/*.png" />
      </fileset>
    </copy>
  </target>		

  <target name="build" depends="compile" description="Build core library">
    <jar basedir="bin" destfile="library/core.jar" />
  </target>
  
</project>
