<project name="VASSAL" default="no-op" basedir="/home/uckelman/projects/VASSAL/uckelman-caching">	
	<property name="VassalVersion" value="3.0.15-svn2704" />
	<property name="DocsVersion" value="3.0.9" />
	<property name="minorVersion" value="3.0" />
<!--
	<taskdef name="writeProperties" classname="org.vassalengine.ant.WriteProperties" />
	<taskdef name="writeZipContents" classname="org.vassalengine.ant.WriteZipContents" />
-->
	<property name="engineSrcPath" value="/home/uckelman/projects/VASSAL/uckelman-caching" />
  <property name="engineLibPath" value="/home/uckelman/projects/VASSAL/uckelman-caching/lib" />
	<property name="engineClassOutput" value="engineClasses" />
	<path id="EngineDependencies">
		<pathelement location="${engineLibPath}/cryptix32.jar" />
		<pathelement location="${engineLibPath}/smack.jar" />
		<pathelement location="${engineLibPath}/smackx.jar" />
		<pathelement location="${engineLibPath}/batik-awt-util.jar" />
		<pathelement location="${engineLibPath}/batik-bridge.jar" />
		<pathelement location="${engineLibPath}/batik-css.jar" />
		<pathelement location="${engineLibPath}/batik-dom.jar" />
		<pathelement location="${engineLibPath}/batik-ext.jar" />
		<pathelement location="${engineLibPath}/batik-extension.jar" />
		<pathelement location="${engineLibPath}/batik-gui-util.jar" />
		<pathelement location="${engineLibPath}/batik-gvt.jar" />
		<pathelement location="${engineLibPath}/batik-parser.jar" />
		<pathelement location="${engineLibPath}/batik-script.jar" />
		<pathelement location="${engineLibPath}/batik-svg-dom.jar" />
		<pathelement location="${engineLibPath}/batik-svggen.jar" />
		<pathelement location="${engineLibPath}/batik-swing.jar" />
		<pathelement location="${engineLibPath}/batik-transcoder.jar" />
		<pathelement location="${engineLibPath}/batik-util.jar" />
		<pathelement location="${engineLibPath}/batik-xml.jar" />
		<pathelement location="${engineLibPath}/js.jar" />
		<pathelement location="${engineLibPath}/pdf-transcoder.jar" />
		<pathelement location="${engineLibPath}/xerces_2_5_0.jar" />
		<pathelement location="${engineLibPath}/bml-apis.jar" />
		<pathelement location="${engineLibPath}/wizard.jar" />
		<pathelement location="${engineLibPath}/BrowserLauncher2-10.jar" />
	</path>
	<path id="EngineJars">
		<path refid="EngineDependencies"/>
		<pathelement location="lib/Vengine.jar" />
	</path>
	<target name="no-op">
	  <echo message="Do nothing"/>
		<signjar keystore="keystore" jar="batik.jar" alias="vassal_ws" storepass="vassalme" />

	</target>
	<target name="clean">
		<delete dir="${engineClassOutput}" />
	</target>
	<target name="engineClasses">
		<mkdir dir="${engineClassOutput}" />
		<javac srcdir="${engineSrcPath}" destdir="${engineClassOutput}" target="1.5" source="1.5" debug="true">
			<classpath refId="EngineDependencies"></classpath>
		</javac>
    <mkdir dir="${engineClassOutput}/VASSAL/i18n" />
		<copy todir="${engineClassOutput}/VASSAL/i18n">
			<fileset file="${engineSrcPath}/VASSAL/i18n/*.properties"/>
		</copy>
	</target>
	<target name="engineJar_plain" depends="engineClasses">
		<mkdir dir="${engineClassOutput}/images" />
		<copy todir="${engineClassOutput}/images">
			<fileset dir="${engineSrcPath}/images" />
		</copy>
		<jar basedir="${engineClassOutput}" destfile="lib/Vengine.jar" />
	</target>
	<target name="engineJar" depends="engineJar_plain">
<!--
		<signjar keystore="keystore" jar="lib/Vengine.jar" alias="vassal_ws" storepass="vassalme" />
-->
		<copy file="lib/Vengine.jar" tofile="Vengine__V${VassalVersion}.jar" overwrite="false" failonerror="true" />
	</target>
<!--
	<target name="docsJar" depends="docs">
		<delete dir="componentInstall" />
		<mkdir dir="componentInstall" />
		<writeZipContents zipFile="${basedir}/docs.zip" destFile="${basedir}/componentInstall/docsList" />
		<writeProperties destFile="${basedir}/componentInstall/docsInfo">
-->
<!--
			<property name="prompt" value="New Documentation has been downloaded.  Install now?" />
			<property name="initialPrompt" value="Select a directory to install the VASSAL documentation" /> 
			<property name="installDirKey" value="docsDirectory" />
-->
<!--
			<property name="checksumKey" value="docsChecksum-${minorVersion}" />
			<property name="installDir" value="${minorVersion}/docs" />
			<property name="required" value="README.html" />
			<property name="extractList" value="/docsList" />
			<property name="checksum" value="${DocsVersion}" />
		</writeProperties>
		<unzip src="docs.zip" dest="componentInstall" />
		<jar basedir="componentInstall" destfile="lib/docs.jar" />
		<signjar keystore="keystore" jar="lib/docs.jar" alias="vassal_ws" storepass="vassalme" />
	</target>
-->
	<target name="javadoc">
		<delete dir="api" />
		<mkdir dir="api" />
		<javadoc packagenames="VASSAL.*" sourcepath="${engineSrcPath}" destdir="${basedir}/api">
		</javadoc>
	</target>
	<target name="release" depends="javadoc">
		<zip destfile="VASSAL-${VassalVersion}.zip">
			<zipfileset dir="api" prefix="javadoc" />
			<zipfileset dir="${engineSrcPath}" prefix="src">
				<include name="**/*.java" />
			</zipfileset>
			<zipfileset dir="${engineSrcPath}">
				<include name="images/*" />
				<include name="**/*.txt" />
			</zipfileset>
		</zip>
<!--
		<ftp server="upload.sourceforge.net" userid="anonymous" password="rkinney" remotedir="incoming" binary="true">
			<fileset dir="${basedir}">
				<include name="VASSAL-${VassalVersion}.zip" />
			</fileset>
		</ftp>
-->
	</target>
	<target name="libraryRelease">
		<delete file="VASSAL-libraries-${VassalVersion}.zip" />
		<zip destfile="VASSAL-libraries-${VassalVersion}.zip">
			<zipfileset dir=".">
				<include name="BinaryLicense.txt" />
				<include name="lib/cryptix32.jar" />
				<include name="lib/VASSAL.jar" />
			</zipfileset>
		</zip>
		<ftp server="upload.sourceforge.net" userid="anonymous" password="rkinney" remotedir="incoming" binary="true">
			<fileset dir="${basedir}">
				<include name="VASSAL-libraries-${VassalVersion}.zip" />
			</fileset>
		</ftp>
	</target>
	<target name="installer" depends="engineClasses">
		<jar destFile="InstallVASSAL.jar" basedir="${engineClassOutput}" includes="VASSAL/launch/**,VASSAL/chat/HttpRequestWrapper*">
			<manifest>
			      <attribute name="Main-Class" value="VASSAL/launch/install/InstallWizard"/>
		    </manifest>
		</jar>
	</target>
	<target name="deployInstaller" depends="installer">
		<ftp server="vassalengine.org" userid="vassal2" password="${ftpPassword}" remotedir="www" binary="true">
			<fileset dir=".">
				<include name="InstallVASSAL.jar" />
			</fileset>
		</ftp>
	</target>
<!--
	<target name="deployJarRunner" depends="jarRunner">
		<zip destfile="VASSAL.zip">
			<zipfileset file="runVassal.jar" />
			<zipfileset dir=".">
				<include name="lib/VASSAL.jar" />
				<include name="lib/Vengine.jar" />
				<include name="lib/docs.jar" />
				<include name="lib/cryptix32.jar" />
			</zipfileset>
		</zip>
		<ftp server="vassalengine.org" userid="vassal2" password="vassalme" remotedir="www" binary="true">
			<fileset dir=".">
				<include name="VASSAL.zip" />
			</fileset>
		</ftp>
	</target>
-->
	<target name="deployEngine" depends="engineJar">
		<ftp server="vassalengine.org" userid="vassal2" password="${ftpPassword}" remotedir="www/ws" binary="true">
			<fileset dir="${basedir}">
				<include name="Vengine__V${VassalVersion}.jar" />
			</fileset>
		</ftp>
		<get src="http://www.vassalengine.org/util/updateInstall?version=${minorVersion}&amp;jar=Vengine&amp;jarVersion=${VassalVersion}" dest="updateVengine.out" />
	</target>
	<target name="publishEngine">
		<property name="publishFile" value="Vengine.jar" />
		<property name="publishVersion" value="${VassalVersion}" />
		<antcall target="publishJar" />
		<antcall target="updateJarRunner" />
	</target>
	<target name="deployAndPublishEngine" depends="deployEngine,publishEngine"/>
<!--
	<target name="deployDocs" depends="docsJar">
		<copy file="lib/docs.jar" tofile="docs__V${DocsVersion}.jar" />
		<ftp server="vassalengine.org" userid="vassal2" password="${ftpPassword}" remotedir="www/ws" binary="true">
			<fileset dir="${basedir}">
				<include name="docs__V${DocsVersion}.jar" />
			</fileset>
		</ftp>
		<get src="http://www.vassalengine.org/util/updateInstall?version=${minorVersion}&amp;jar=docs&amp;jarVersion=${DocsVersion}" dest="updateDocs.out" />
	</target>
-->
	<target name="publishDocs">
		<property name="publishFile" value="docs.jar" />
		<property name="publishVersion" value="${DocsVersion}" />
		<antcall target="publishJar" />
		<antcall target="updateJarRunner" />
	</target>
<!--
	<target name="deployAndPublishDocs" depends="deployDocs,publishDocs"/>
-->
	<target name="cvsBackup">
		<delete file="${cvsSrcPath}/../cvsBackup.zip" />
		<zip destfile="${cvsSrcPath}/../cvsBackup.zip">
			<zipfileset dir="${cvsSrcPath}/cvsroot" prefix="cvsroot" />
		</zip>
		<ftp server="vassalengine.org" userid="vassal2" password="${ftpPassword}" remotedir="transfer" binary="true">
			<fileset dir="${cvsSrcPath}/..">
				<include name="cvsBackup.zip" />
			</fileset>
		</ftp>
	</target>
<!--
	<target name="deployServlets" depends="webJar">
		<ftp server="vassalengine.org" userid="vassal2" password="${ftpPassword}" remotedir="www/WEB-INF/lib" binary="true">
			<fileset dir="${basedir}">
				<include name="Vweb.jar" />
			</fileset>
		</ftp>
	</target>
-->
	<target name="publishJar">
		<get src="http://www.vassalengine.org/util/publishJar?file=${publishFile}&amp;version=${publishVersion}" dest="publish.out" />
		<get src="http://www.vasl.org/build/updateJar.php?file=${publishFile}" dest="updateJarVasl.out" />
	</target>
	<target name="updateJarRunner">
		<get src="http://www.vassalengine.org/util/updateJarRunner" dest="updateJarRunner.out" />
		<get src="http://www.vasl.org/build/updateInstaller.php" dest="updateInstallerVasl.out" />
	</target>
</project>
