<project name="josm" default="dist" basedir=".">

	<!-- All jar files necessary to run only JOSM (no tests) -->
	<fileset id="josm_required_libs" dir="lib">
		<include name="gettext-commons-0.9.jar"/>
		<include name="metadata-extractor-2.3.1.jar"/>
		<include name="MinML2.jar"/>
	</fileset>

	<!-- Java classpath addition (all jar files to compile tests with this) -->
	<path id="classpath">
		<fileset dir="lib">
			<include name="**/*.jar"/>
		</fileset>
	</path>

	<target name="dist" depends="compile">
		<!-- jars -->
		<unjar dest="build">
			<fileset refid="josm_required_libs" />
		</unjar>

		<!-- images -->
		<copy todir="build/images">
			<fileset dir="images" />
		</copy>

		<!-- create josm-custom.jar -->
		<jar destfile="dist/josm-custom.jar" basedir="build">
			<manifest>
				<attribute name="Main-class" value="org.openstreetmap.josm.gui.MainApplication" />
			</manifest>
		</jar>
	</target>

	<target name="compile" depends="init">
		<javac srcdir="src" classpathref="classpath" destdir="build" />
	</target>



	<target name="init">
		<mkdir dir="build" />
		<mkdir dir="dist" />
	</target>

	<target name="clean">
		<delete dir="build" />
		<delete dir="dist" />
	</target>

</project>
