-->\r
<project name="template" default="all" basedir=".">\r
<!-- default values -->\r
- <property name="src" value="src"/>\r
+ <path id="src">\r
+ <pathelement location="src"/>\r
+ </path>\r
+ <path id="classpath"/>\r
<property name="jni" value="jni"/>\r
<property name="target" value="target" />\r
<property name="libs" value="libs" />\r
- <path id="classpath"/>\r
<zipfileset id="jarfiles" dir="." excludes="**"/>\r
+ <fileset id="resourcefiles" dir="." excludes="**"/>\r
\r
- <!-- clean output directories --> \r
+ <!-- clean output directories, create libs directory --> \r
<target name="clean"> \r
+ <mkdir dir="${libs}" />\r
<delete dir="${target}" />\r
</target>\r
\r
<!-- init task, creates all necessary directories -->\r
- <target name="init" depends="clean">\r
+ <target name="init" depends="clean"> \r
<mkdir dir="${target}" />\r
- <!-- need to copy the internal font to target if compiling the gdx core :/ -->\r
- <copy failonerror="false" tofile="${target}/com/badlogic/gdx/utils/arial-15.png" file="src/com/badlogic/gdx/utils/arial-15.png" />\r
- <copy failonerror="false" tofile="${target}/com/badlogic/gdx/utils/arial-15.fnt" file="src/com/badlogic/gdx/utils/arial-15.fnt" />\r
+ <mkdir dir="${target}/java" />\r
+ <!-- need to copy jni headers for gdx-jnigen -->\r
+ <copy failonerror="false" todir="${target}/java">\r
+ <fileset dir="src">\r
+ <include name="**/*.h"/>\r
+ <include name="**/*.template"/>\r
+ </fileset>\r
+ </copy>\r
+ <copy failonerror="false" todir="${target}/java">\r
+ <fileset dir="src">\r
+ <include name="**/*.gwt.xml"/>\r
+ </fileset>\r
+ </copy>\r
</target>\r
\r
<!-- compiles the java code -->\r
<target name="compile" depends="init">\r
- <javac debug="on" srcdir="${src}" destdir="${target}">\r
+ <javac debug="on" encoding="utf-8" source="1.6" target="1.6" destdir="${target}/java" includeantruntime="false">\r
+ <src>\r
+ <path refid="src"/>\r
+ </src>\r
<classpath>\r
<path refid="classpath"/>\r
<fileset file="${libs}/*.jar">\r
<exclude name="*-natives.jar"/>\r
</fileset>\r
</classpath>\r
+ <exclude name="**/gwt/emu/java/lang/System.java"/>\r
</javac>\r
</target>\r
\r
</and>\r
</condition>\r
</target>\r
+ \r
<target name="compile-natives" depends="init, check-natives" if="natives-present">\r
+ <mkdir dir="${libs}/android32" />\r
+ <mkdir dir="${libs}/armeabi" />\r
+ <mkdir dir="${libs}/armeabi-v7a" />\r
+ <mkdir dir="${libs}/x86" />\r
+ <mkdir dir="${libs}/linux32" />\r
+ <mkdir dir="${libs}/linux64" />\r
+ <mkdir dir="${libs}/macosx32" />\r
+ <mkdir dir="${libs}/windows32" />\r
+ <mkdir dir="${libs}/windows64" />\r
+ <mkdir dir="${libs}/ios32"/>\r
+ <echo message="compiling natives code"/>\r
<ant antfile="build.xml" target="clean" dir="${jni}"/>\r
<ant antfile="build.xml" target="all" dir="${jni}"/>\r
- <!-- copy shared libs for desktop -->\r
- <copy failonerror="false" file="${libs}/${jar}-natives.jar" tofile="${distDir}/${jar}-natives.jar"/>\r
<!-- copy shared libs for android -->\r
<copy failonerror="false" todir="${distDir}/armeabi">\r
<fileset dir="${libs}/armeabi">\r
<include name="**/*.so"/>\r
</fileset>\r
</copy>\r
+ <copy failonerror="false" todir="${distDir}/x86">\r
+ <fileset dir="${libs}/x86">\r
+ <include name="**/*.so"/>\r
+ </fileset>\r
+ </copy>\r
</target>\r
\r
<!-- create source and class jar -->\r
<target name="all" depends="compile,compile-natives">\r
<!-- source jar -->\r
- <jar destfile="${distDir}/sources/${jar}-sources.jar" basedir="${src}" />\r
+ <mkdir dir="${distDir}/sources" />\r
+ \r
+ <!-- FIXME doesn't work for bullet, as this only takes the src/ folder -->\r
+ <jar destfile="${distDir}/sources/${jar}-sources.jar" basedir="src"/> \r
+ \r
+ <!-- copy shared libs for desktop -->\r
+ <copy failonerror="false" todir="${distDir}">\r
+ <fileset dir="${libs}">\r
+ <include name="**/*-natives.jar"/>\r
+ <exclude name="**/test-natives.jar"/>\r
+ </fileset>\r
+ </copy>\r
+ \r
+ <!-- copy shared libs for android -->\r
+ <copy failonerror="false" todir="${distDir}/armeabi">\r
+ <fileset dir="${libs}/armeabi">\r
+ <include name="**/*.so"/>\r
+ </fileset>\r
+ </copy>\r
+ <copy failonerror="false" todir="${distDir}/armeabi-v7a">\r
+ <fileset dir="${libs}/armeabi-v7a">\r
+ <include name="**/*.so"/>\r
+ </fileset>\r
+ </copy>\r
+ <copy failonerror="false" todir="${distDir}/x86">\r
+ <fileset dir="${libs}/x86">\r
+ <include name="**/*.so"/>\r
+ </fileset>\r
+ </copy>\r
\r
<!-- class jar -->\r
<jar destfile="${distDir}/${jar}.jar">\r
- <fileset dir="${target}" />\r
- <!-- merge dependencies found in libs/ folder, exclude native, debug and android jars -->\r
+ <fileset dir="${target}/java"/>\r
+ <fileset refid="resourcefiles"/>\r
+ <!-- merge dependencies found in libs/ folder, exclude native, debug and android/gwt jars -->\r
<zipgroupfileset file="${libs}/*.jar">\r
<exclude name="*-natives.jar"/>\r
<exclude name="*-debug.jar"/>\r
<exclude name="android-*.jar"/>\r
+ <exclude name="robovm-*.jar"/>\r
+ <exclude name="gwt*.jar"/>\r
</zipgroupfileset>\r
<!-- merge dependencies specified in parent build.xml -->\r
<zipfileset refid="jarfiles"/>\r