Permalink
Fetching contributors…
Cannot retrieve contributors at this time
124 lines (110 sloc) 4.29 KB
<project name="Tiled" default="dist">
<description>
A Java-based Tile Map Editor
</description>
<!-- set global properties for this build -->
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<property name="plugins" location="plugins"/>
<property name="nightly" location="nightly"/>
<property name="javadoc" location="docs/api"/>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
</target>
<target name="release_bin" depends="clean,dist" description="Build binary release">
<mkdir dir="releases"/>
<zip destfile="releases/tiled-${version}-bin.zip">
<zipfileset prefix="tiled-${version}" dir="."
includes="README COPYING INSTALL CHANGES TODO"/>
<zipfileset fullpath="tiled-${version}/tiled.jar" dir="dist"
includes="tiled.jar"/>
<zipfileset prefix="tiled-${version}/plugins" dir="dist/plugins"/>
<zipfileset prefix="tiled-${version}/examples" dir="examples"/>
</zip>
</target>
<target name="release_src" depends="clean" description="Build source release">
<mkdir dir="releases"/>
<zip destfile="releases/tiled-${version}-src.zip">
<zipfileset prefix="tiled-${version}/src" dir="src"/>
<zipfileset prefix="tiled-${version}/plugins" dir="plugins"/>
<zipfileset prefix="tiled-${version}" dir="."
includes="README COPYING CHANGES TODO build.xml MANIFEST.MF"/>
<zipfileset prefix="tiled-${version}/examples" dir="examples"/>
</zip>
</target>
<target name="compile" depends="init" description="Compile the source">
<javac source="1.5" target="1.5" srcdir="${src}" destdir="${build}"/>
<copy todir="${build}/tiled/mapeditor/resources">
<fileset dir="./src/tiled/mapeditor/resources">
<include name="*.png" />
<include name="*.properties" />
<include name="map.dtd" />
</fileset>
</copy>
</target>
<target name="compile_dep" depends="init" description="Compile the source">
<javac source="1.5" target="1.5" srcdir="${src}" destdir="${build}"
deprecation="on"/>
<copy todir="${build}/tiled/mapeditor/resources">
<fileset dir="./src/tiled/mapeditor/resources">
<include name="*.png" />
<include name="map.dtd" />
</fileset>
</copy>
</target>
<target name="dist" depends="compile" description="Generate the distribution">
<mkdir dir="${dist}"/>
<jar
jarfile="${dist}/tiled.jar"
manifest="MANIFEST.MF"
basedir="${build}"
excludes="tiled/plugins/**"
/>
<ant dir="plugins" target="dist"/>
</target>
<target name="core" depends="compile"
description="Generate a core I/O distribution for use in games, etc.">
<mkdir dir="${dist}"/>
<jar jarfile="${dist}/tiled-core.jar"
basedir="${build}" includes="tiled/core/**/*.class,tiled/io/**,tiled/mapeditor/Resources.class,tiled/mapeditor/util/cutter/**,tiled/util/Util.class,tiled/util/Base64.class,tiled/util/NumberedSet.class,tiled/mapeditor/util/TransparentImageFilter.class,tiled/mapeditor/resources/map.dtd"/>
</target>
<target name="dist_dep" depends="compile_dep"
description="Generate the distribution and warn about deprecation">
<mkdir dir="${dist}"/>
<jar
jarfile="${dist}/tiled.jar"
manifest="MANIFEST.MF"
basedir="${build}"
/>
</target>
<target name="nightly" depends="compile" description="Generate a nightly build">
<mkdir dir="${nightly}"/>
<jar
jarfile="${nightly}/tiled-${DSTAMP}.jar"
manifest="MANIFEST.MF"
basedir="${build}"
/>
</target>
<target name="clean" description="Clean up the build directory" >
<delete dir="${build}"/>
<ant dir="${plugins}" target="clean" inheritAll="false"/>
</target>
<target name="javadoc" description="Generate Javadoc">
<!-- Clean up previous Javadoc files -->
<delete dir="${javadoc}"/>
<!-- Generate Javadoc -->
<javadoc
packagenames="tiled.*"
sourcepath="src"
destdir="${javadoc}"
windowtitle="Tiled"
/>
</target>
<target name="plugins" description="Plugins for various map formats">
<ant dir="${plugins}" target="dist" inheritAll="false"/>
</target>
</project>