<!--

    Copyright (c) 2001-2020 Mathew A. Nelson and Robocode contributors
    All rights reserved. This program and the accompanying materials
    are made available under the terms of the Eclipse Public License v1.0
    which accompanies this distribution, and is available at
    https://robocode.sourceforge.io/license/epl-v10.html

-->
<project name="Launch Dir Builder" default="build">
	
	<property name="launch-dir" location="${basedir}/robocode.api/target/launch"/>

	<target name="build">
		<!-- Make new launch dir + libs dir -->
		<mkdir dir="${launch-dir}/libs"/>

		<!-- Copy all resources into launch dir -->
		<copy todir="${launch-dir}">
			<fileset dir="${basedir}/robocode.content/src/main/resources"/>
		</copy>

		<!-- Copy required versions.txt into launch dir -->
		<copy todir="${launch-dir}" file="${basedir}/versions.md"/>

		<!-- Create libs/robocode.jar file (for Robot Editor etc.) -->
		<jar destfile="${launch-dir}/libs/robocode.jar" basedir="${basedir}/robocode.api/target/classes"/>

		<!-- Copy ECJ compiler into launch dir -->
		<copy todir="${launch-dir}/compilers">
			<fileset file="${basedir}/robocode.content/target/classes/compilers/ecj.jar"/>
		</copy>		
	</target>

	<target name="clean">
		<!-- Delete launch dir -->
		<delete dir="${launch-dir}"/>
	</target>

</project>
