A complete 3D game development suite written purely in Java.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jmonkeyengine/engine/build.xml

418 lines
22 KiB

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" name="jMonkeyEngine3" default="default" basedir=".">
<description>Builds, tests, and runs the jMonkeyEngine3 core engine.</description>
<import file="nbproject/build-impl.xml"/>
<target name="build-bullet-natives" description="uses native build tools to build the bulletjme binary (read bullet-native-build.txt for more info)" depends="jar">
<ant antfile="nbproject/build-bullet-natives.xml" target="build-bullet-natives"/>
</target>
<target name="run-bullet-native" description="runs the jMonkeyEngine3 demos using native bullet">
<copy file="${dist.dir}/opt/native-bullet/jME3-bullet-natives.jar" todir="${dist.dir}/lib" failonerror="false"/>
<copy file="${dist.dir}/opt/native-bullet/jME3-bullet.jar" todir="${dist.dir}/lib" failonerror="false"/>
<delete file="${dist.dir}/lib/jME3-jbullet.jar" failonerror="false"/>
<exec executable="java" dir="dist">
<arg line="-jar jMonkeyEngine3.jar"/>
</exec>
</target>
<target name="-do-compile" description="Overrides default compile target to separate the build into folders" depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources">
<mkdir dir="${build.dir}/core"/>
<mkdir dir="${build.dir}/plugins"/>
<mkdir dir="${build.dir}/jogg"/>
<mkdir dir="${build.dir}/blender"/>
<mkdir dir="${build.dir}/desktop"/>
<mkdir dir="${build.dir}/terrain"/>
<mkdir dir="${build.dir}/jbullet"/>
<mkdir dir="${build.dir}/bullet"/>
<mkdir dir="${build.dir}/niftygui"/>
<mkdir dir="${build.dir}/lwjgl"/>
<mkdir dir="${build.dir}/android"/>
<mkdir dir="${build.dir}/test"/>
<echo>Compile Core</echo>
<j2seproject3:javac
destdir="${build.dir}/core"
srcdir="${src.core.dir}:${src.core-data.dir}:${src.core-plugins.dir}:${src.tools.dir}:${src.networking.dir}"
gensrcdir="${build.generated.sources.dir}"/>
<copy todir="${build.dir}/core">
<fileset dir="${src.core.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
<fileset dir="${src.core-data.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
<fileset dir="${src.core-plugins.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
<fileset dir="${src.tools.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
</copy>
<echo>Compile Plugins (Ogre, XML)</echo>
<j2seproject3:javac
destdir="${build.dir}/plugins"
srcdir="${src.ogre.dir}:${src.xml.dir}"
classpath="${javac.classpath}:${build.dir}/core"
gensrcdir="${build.generated.sources.dir}"/>
<copy todir="${build.dir}/plugins">
<fileset dir="${src.ogre.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
<fileset dir="${src.xml.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
</copy>
<echo>Compile Jogg</echo>
<j2seproject3:javac
destdir="${build.dir}/jogg"
srcdir="${src.jogg.dir}"
classpath="${javac.classpath}:${build.dir}/core"
gensrcdir="${build.generated.sources.dir}"/>
<copy todir="${build.dir}/jogg">
<fileset dir="${src.jogg.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
</copy>
<echo>Compile Desktop</echo>
<j2seproject3:javac
destdir="${build.dir}/desktop"
srcdir="${src.desktop.dir}:${src.desktop-fx.dir}"
classpath="${javac.classpath}:${build.dir}/core"
gensrcdir="${build.generated.sources.dir}"/>
<copy todir="${build.dir}/desktop">
<fileset dir="${src.desktop.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
<fileset dir="${src.desktop-fx.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
</copy>
<echo>Compile Blender Loader</echo>
<j2seproject3:javac
destdir="${build.dir}/blender"
srcdir="${src.blender.dir}"
classpath="${javac.classpath}:${build.dir}/core:${build.dir}/plugins:${build.dir}/desktop"
gensrcdir="${build.generated.sources.dir}"/>
<copy todir="${build.dir}/blender">
<fileset dir="${src.blender.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
</copy>
<echo>Compile Terrain</echo>
<j2seproject3:javac
destdir="${build.dir}/terrain"
srcdir="${src.terrain.dir}"
classpath="${javac.classpath}:${build.dir}/core:${build.dir}/desktop"
gensrcdir="${build.generated.sources.dir}"/>
<copy todir="${build.dir}/terrain">
<fileset dir="${src.terrain.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
</copy>
<echo>Compile jBullet</echo>
<j2seproject3:javac
destdir="${build.dir}/jbullet"
srcdir="${src.jbullet.dir}:${src.bullet-common.dir}"
classpath="${javac.classpath}:${build.dir}/core:${build.dir}/terrain"
gensrcdir="${build.generated.sources.dir}"/>
<copy todir="${build.dir}/jbullet">
<fileset dir="${src.jbullet.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
<fileset dir="${src.bullet-common.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
</copy>
<echo>Compile Bullet</echo>
<j2seproject3:javac
destdir="${build.dir}/bullet"
srcdir="${src.bullet.dir}:${src.bullet-common.dir}"
classpath="${javac.classpath}:${build.dir}/core:${build.dir}/terrain"
gensrcdir="${build.generated.sources.dir}"/>
<copy todir="${build.dir}/bullet">
<fileset dir="${src.bullet.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
<fileset dir="${src.bullet-common.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
</copy>
<echo>Compile Nifty</echo>
<j2seproject3:javac
destdir="${build.dir}/niftygui"
srcdir="${src.niftygui.dir}"
classpath="${javac.classpath}:${build.dir}/core"
gensrcdir="${build.generated.sources.dir}"/>
<copy todir="${build.dir}/niftygui">
<fileset dir="${src.niftygui.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
</copy>
<echo>Compile Lwjgl</echo>
<j2seproject3:javac
destdir="${build.dir}/lwjgl"
srcdir="${src.lwjgl.dir}"
classpath="${javac.classpath}:${build.dir}/core:${build.dir}/desktop"
gensrcdir="${build.generated.sources.dir}"/>
<copy todir="${build.dir}/lwjgl">
<fileset dir="${src.lwjgl.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
</copy>
<echo>Compile Android</echo>
<j2seproject3:javac
destdir="${build.dir}/android"
srcdir="${src.android.dir}"
classpath="${javac.classpath}:${build.dir}/core:${build.dir}/plugins"
gensrcdir="${build.generated.sources.dir}"
excludes="${excludes},**/jme3test/**"
/>
<copy todir="${build.dir}/android">
<fileset dir="${src.android.dir}" excludes="${build.classes.excludes},${excludes},**/jme3test/**,**/res/**" includes="${includes}"/>
</copy>
<echo>Compile Tests</echo>
<j2seproject3:javac
destdir="${build.classes.dir}"
srcdir="${src.test.dir}"
classpath="${javac.classpath}:${build.dir}/core:${build.dir}/plugins:${build.dir}/jogg:${build.dir}/desktop:${build.dir}/blender:${build.dir}/terrain:${build.dir}/jbullet:${build.dir}/niftygui"
gensrcdir="${build.generated.sources.dir}"/>
<copy todir="${build.classes.dir}">
<fileset dir="${src.test.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
</copy>
</target>
<target name="-pre-jar" description="Prepares the separate jME3-xxx.jar files and modifies properties for libraries to be used for lib/ folder, Manifest etc.">
<echo>Building Engine JAR files..</echo>
<jar jarfile="${build.dir}/jME3-core.jar" basedir="${build.dir}/core" compress="true"/>
<jar jarfile="${build.dir}/jME3-plugins.jar" basedir="${build.dir}/plugins" compress="true"/>
<jar jarfile="${build.dir}/jME3-jogg.jar" basedir="${build.dir}/jogg" compress="true"/>
<jar jarfile="${build.dir}/jME3-desktop.jar" basedir="${build.dir}/desktop" compress="true"/>
<jar jarfile="${build.dir}/jME3-blender.jar" basedir="${build.dir}/blender" compress="true"/>
<jar jarfile="${build.dir}/jME3-terrain.jar" basedir="${build.dir}/terrain" compress="true"/>
<jar jarfile="${build.dir}/jME3-jbullet.jar" basedir="${build.dir}/jbullet" compress="true"/>
<jar jarfile="${build.dir}/jME3-bullet.jar" basedir="${build.dir}/bullet" compress="true"/>
<jar jarfile="${build.dir}/jME3-niftygui.jar" basedir="${build.dir}/niftygui" compress="true"/>
<jar jarfile="${build.dir}/jME3-lwjgl.jar" basedir="${build.dir}/lwjgl" compress="true"/>
<jar jarfile="${build.dir}/jME3-android.jar" basedir="${build.dir}/android" compress="true"/>
<echo>Building TestData JAR file..</echo>
<jar jarfile="${build.dir}/jME3-testdata.jar" basedir="test-data" compress="true"/>
<property location="test-data" name="testdata.dir.resolved"/>
<property location="${build.dir}/jME3-testdata.jar" name="testdata.jar.resolved"/>
<property location="lib/android/android.jar" name="android.jar.resolved"/>
<property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
<property location="${build.dir}/core" name="build.core.dir.resolved"/>
<property location="${build.dir}/plugins" name="build.plugins.dir.resolved"/>
<property location="${build.dir}/jogg" name="build.jogg.dir.resolved"/>
<property location="${build.dir}/desktop" name="build.desktop.dir.resolved"/>
<property location="${build.dir}/blender" name="build.blender.dir.resolved"/>
<property location="${build.dir}/terrain" name="build.terrain.dir.resolved"/>
<property location="${build.dir}/jbullet" name="build.jbullet.dir.resolved"/>
<property location="${build.dir}/bullet" name="build.bullet.dir.resolved"/>
<property location="${build.dir}/niftygui" name="build.niftygui.dir.resolved"/>
<property location="${build.dir}/lwjgl" name="build.lwjgl.dir.resolved"/>
<property location="${build.dir}/android" name="build.android.dir.resolved"/>
<pathconvert property="run.classpath.without.build.classes.dir">
<path path="${run.classpath}"/>
<map from="${build.classes.dir.resolved}" to=""/>
<map from="${build.core.dir.resolved}" to=""/>
<map from="${build.plugins.dir.resolved}" to=""/>
<map from="${build.jogg.dir.resolved}" to=""/>
<map from="${build.desktop.dir.resolved}" to=""/>
<map from="${build.blender.dir.resolved}" to=""/>
<map from="${build.terrain.dir.resolved}" to=""/>
<map from="${build.jbullet.dir.resolved}" to=""/>
<map from="${build.bullet.dir.resolved}" to=""/>
<map from="${build.niftygui.dir.resolved}" to=""/>
<map from="${build.lwjgl.dir.resolved}" to=""/>
<map from="${build.android.dir.resolved}" to=""/>
<map from="${testdata.dir.resolved}" to="${testdata.jar.resolved}"/>
<map from="${android.jar.resolved}" to=""/>
<path path="${build.dir}/jME3-core.jar"/>
<path path="${build.dir}/jME3-plugins.jar"/>
<path path="${build.dir}/jME3-jogg.jar"/>
<path path="${build.dir}/jME3-desktop.jar"/>
<path path="${build.dir}/jME3-blender.jar"/>
<path path="${build.dir}/jME3-terrain.jar"/>
<path path="${build.dir}/jME3-jbullet.jar"/>
<path path="${build.dir}/jME3-bullet.jar"/>
<path path="${build.dir}/jME3-niftygui.jar"/>
<path path="${build.dir}/jME3-lwjgl.jar"/>
<!--path path="${build.dir}/jME3-android.jar"/-->
</pathconvert>
</target>
<target name="-post-jar">
<echo>Moving optional packages</echo>
<mkdir dir="${dist.dir}/opt"/>
<mkdir dir="${dist.dir}/opt/native-bullet"/>
<!--ant antfile="nbproject/build-bullet-natives.xml" target="bullet-api-diff"/-->
<!--move file="bullet-api-diff.html" todir="${dist.dir}/opt/native-bullet" overwrite="true"/-->
<move file="${dist.dir}/lib/jME3-bullet.jar" todir="${dist.dir}/opt/native-bullet" overwrite="true"/>
<move file="${dist.dir}/lib/jME3-bullet-natives.jar" todir="${dist.dir}/opt/native-bullet" overwrite="true"/>
<copy file="lib/bullet/jME3-bullet-natives-android.jar" todir="${dist.dir}/opt/native-bullet" overwrite="true"/>
<mkdir dir="${dist.dir}/opt/android"/>
<copy file="${build.dir}/jME3-android.jar" todir="${dist.dir}/opt/android" overwrite="true"/>
</target>
<!--
****************************************************************
Only Relevant for building the SDK from here on
****************************************************************
-->
<target name="update-sdk" depends="jar, javadoc" description="convenience target to transfer jme3 libraries to sdk (jMonkeyPlatform)">
<antcall target="-do-update-sdk" inheritall="true">
<param name="jmp_dir" value="../sdk/"/>
</antcall>
</target>
<target name="-do-update-sdk">
<fileset id="jme3-jars" dir="build">
<include name="**/jME3**.jar"/>
<exclude name="**/jME3-testdata.jar"/>
<exclude name="**/jME3-bullet-natives.jar"/>
<exclude name="**/jME3-bullet-natives-android.jar"/>
</fileset>
<fileset id="jme3-sdk-jars" dir="build">
<include name="**/jME3**.jar"/>
<exclude name="**/jME3-android.jar"/>
<exclude name="**/jME3-testdata.jar"/>
<exclude name="**/jME3-bullet.jar"/>
<exclude name="**/jME3-bullet-natives.jar"/>
<exclude name="**/jME3-bullet-natives-android.jar"/>
</fileset>
<fileset id="jme3-bullet-native-jars" dir="${dist.dir}/opt/native-bullet">
<include name="**/jME3-bullet-native**.jar"/>
</fileset>
<fileset id="jme3-testdata-jars" dir="build">
<include name="**/jME3-testdata.jar"/>
</fileset>
<fileset id="jme3-lwjgl-native-jars" dir="${dist.dir}/lib">
<include name="**/jME3-lwjgl-natives.jar"/>
</fileset>
<fileset id="jme3-external-libraries" dir="${dist.dir}/lib/">
<exclude name="jME3-**"/>
<exclude name="**/nifty-examples.jar"/>
</fileset>
<echo>Clearing old files</echo>
<delete dir="${jmp_dir}/JME3TestsTemplate/src/"/>
<delete dir="${jmp_dir}/jme3-core-baselibs/release/modules/ext/"/>
<delete dir="${jmp_dir}/jme3-core-libraries/release/modules/ext/"/>
<delete dir="${jmp_dir}/jme3-project-libraries/release/libs/"/>
<delete dir="${jmp_dir}/jme3-project-baselibs/release/libs/"/>
<delete dir="${jmp_dir}/jme3-project-testdata/release/libs/"/>
<echo>Copying jMonkeyPlatform jME3 libs</echo>
<copy toDir="${jmp_dir}/jme3-core-baselibs/release/modules/ext/" overwrite="true" failonerror="true" verbose="false" flatten="true">
<fileset refid="jme3-sdk-jars"/>
<!--natives need to be in jme3 package for jme to work in jMP-->
<fileset refid="jme3-lwjgl-native-jars"/>
</copy>
<echo>Copying jMonkeyPlatform external libraries</echo>
<copy todir="${jmp_dir}/jme3-core-libraries/release/modules/ext/" overwrite="true" failonerror="true" verbose="false" flatten="true">
<fileset refid="jme3-external-libraries"/>
</copy>
<echo>Copying Project jME3 libs</echo>
<copy toDir="${jmp_dir}/jme3-project-baselibs/release/libs/" overwrite="true" failonerror="true" verbose="false" flatten="true">
<fileset refid="jme3-jars"/>
</copy>
<echo>Copying Project external libraries</echo>
<copy todir="${jmp_dir}/jme3-project-libraries/release/libs/" overwrite="true" failonerror="true" verbose="false" flatten="true">
<fileset refid="jme3-external-libraries"/>
<fileset refid="jme3-lwjgl-native-jars"/>
<fileset refid="jme3-bullet-native-jars"/>
</copy>
<echo>Copying Test Project Data</echo>
<copy toDir="${jmp_dir}/jme3-project-testdata/release/libs/" overwrite="true" failonerror="true" verbose="false">
<fileset refid="jme3-testdata-jars"/>
</copy>
<echo>Copying Javadoc</echo>
<zip destfile="${dist.dir}/jMonkeyEngine3-javadoc.zip">
<zipfileset dir="${dist.dir}/javadoc/"/>
</zip>
<copy file="${dist.dir}/jMonkeyEngine3-javadoc.zip" toDir="${jmp_dir}/jme3-project-baselibs/release/libs/" overwrite="true" failonerror="true" verbose="false"/>
<zip destfile="${dist.dir}/jMonkeyEngine3-sources.zip">
<zipfileset dir="${src.core.dir}"/>
<zipfileset dir="${src.core-data.dir}"/>
<zipfileset dir="${src.core-plugins.dir}"/>
<zipfileset dir="${src.desktop.dir}"/>
<zipfileset dir="${src.desktop-fx.dir}"/>
<zipfileset dir="${src.jbullet.dir}"/>
<zipfileset dir="${src.niftygui.dir}"/>
<zipfileset dir="${src.jogg.dir}"/>
<zipfileset dir="${src.lwjgl.dir}"/>
<zipfileset dir="${src.ogre.dir}"/>
<zipfileset dir="${src.test.dir}"/>
<zipfileset dir="${src.tools.dir}"/>
<zipfileset dir="${src.xml.dir}"/>
<zipfileset dir="${src.terrain.dir}"/>
<zipfileset dir="${src.networking.dir}"/>
</zip>
<copy file="${dist.dir}/jMonkeyEngine3-sources.zip" toDir="${jmp_dir}/jme3-project-baselibs/release/libs/" overwrite="true" failonerror="true" verbose="false"/>
<copy todir="${jmp_dir}/jme3-project-libraries/release/libs/" overwrite="true" failonerror="true" verbose="false" flatten="true">
<fileset refid="jme3-external-libraries"/>
<fileset refid="jme3-lwjgl-native-jars"/>
<fileset refid="jme3-bullet-native-jars"/>
<fileset dir="lib/niftygui/">
<include name="nifty-javadoc.jar"/>
<include name="nifty-default-controls-javadoc.jar"/>
</fileset>
</copy>
<echo>Copying Test Examples</echo>
<copy todir="${jmp_dir}/JME3TestsTemplate/src/" overwrite="true" failonerror="true" verbose="false">
<fileset dir="src/test/">
<exclude name=".svn"/>
</fileset>
</copy>
</target>
<!--
****************************************************************
Only Relevant for building nightly on Hudson server from here on
****************************************************************
-->
<target depends="init" name="create-zip-distribution" description="puts jme3 jars, libs, source and javadoc in a dated zip file">
<tstamp>
<format property="date" pattern="yyyy-MM-dd" locale="en,US"/>
</tstamp>
<property name="jme3zip" value="jME3_${date}.zip"/>
<zip destfile="${jme3zip}">
<fileset dir=".">
<include name="TestChooser.exe"/>
<include name="README.TXT"/>
</fileset>
<fileset dir="${dist.dir}/">
<include name="jMonkeyEngine3.jar"/>
</fileset>
<zipfileset dir="${dist.dir}/lib" prefix="lib"/>
<zipfileset dir="${dist.dir}/opt" prefix="opt"/>
<zipfileset dir="${dist.dir}/javadoc" prefix="javadoc"/>
<zipfileset dir="${src.core.dir}" prefix="source"/>
<zipfileset dir="${src.core-data.dir}" prefix="source"/>
<zipfileset dir="${src.core-plugins.dir}" prefix="source"/>
<zipfileset dir="${src.desktop.dir}" prefix="source"/>
<zipfileset dir="${src.desktop-fx.dir}" prefix="source"/>
<zipfileset dir="${src.jbullet.dir}" prefix="source"/>
<zipfileset dir="${src.niftygui.dir}" prefix="source"/>
<zipfileset dir="${src.jogg.dir}" prefix="source"/>
<zipfileset dir="${src.lwjgl.dir}" prefix="source"/>
<zipfileset dir="${src.ogre.dir}" prefix="source"/>
<zipfileset dir="${src.test.dir}" prefix="source"/>
<zipfileset dir="${src.tools.dir}" prefix="source"/>
<zipfileset dir="${src.xml.dir}" prefix="source"/>
<zipfileset dir="${src.terrain.dir}" prefix="source"/>
<zipfileset dir="${src.networking.dir}" prefix="source"/>
</zip>
</target>
<target depends="init" name="update-sdk-nobuild">
<antcall target="-do-update-sdk" inheritall="true">
<param name="jmp_dir" value="../sdk/"/>
</antcall>
</target>
<target name="copy-javadoc">
<copydir
src="${dist.dir}/javadoc/" dest="/var/www/org/javadoc/" forceoverwrite="true"
/>
</target>
</project>