2004-05-02 16:24:19 +02:00
<?xml version="1.0"?>
2007-04-27 19:26:57 +02:00
<!-- This file includes targets for building FreeCol,
the metaserver, distribution packages, running tests
and creating documentation. -->
2004-05-02 16:24:19 +02:00
<project name= "FreeCol" default= "package" >
2007-04-27 19:26:57 +02:00
<description >
This file includes targets for building FreeCol,
the metaserver, distribution packages, running tests
and creating documentation.
</description>
2013-01-16 09:46:00 +01:00
<property name= "java.target.version" value= "1.6" />
2007-04-27 19:26:57 +02:00
<property name= "freecol.name" value= "freecol" />
2010-10-28 17:47:53 +02:00
<property environment= "env" />
2007-04-27 19:26:57 +02:00
<property name= "freecol.data.dir" value= "${basedir}/data" />
2010-09-12 10:14:30 +02:00
<property name= "freecol.rules.dir" value= "${basedir}/data/rules" />
2007-04-27 19:26:57 +02:00
<property name= "freecol.src.dir" value= "${basedir}/src" />
<property name= "freecol.build.dir" value= "${basedir}/build" />
<property name= "freecol.packaging.dir" value= "${basedir}/packaging" />
<property name= "freecol.release.dir" value= "${basedir}/dist" />
<property name= "freecol.doc.dir" value= "${basedir}/doc" />
<property name= "freecol.javadoc.dir" value= "${freecol.doc.dir}/javadoc" />
<property name= "freecol.jar.file" value= "${basedir}/FreeCol.jar" />
<property name= "freecol.metaserver.jar.file" value= "${basedir}/FreeCol-metaserver.jar" />
<property name= "freecol.overview.file" value= "${freecol.src.dir}/overview.html" />
2010-11-21 14:30:14 +01:00
<property name= "test" value= "AllTests" />
2012-06-13 07:59:29 +02:00
<property name= "miglayout.jar" value= "jars/miglayout-4.0-swing.jar" />
2010-11-21 14:30:14 +01:00
<property name= "cli.jar" value= "jars/commons-cli-1.1.jar" />
2010-12-09 09:25:54 +01:00
<property name= "cortado.jar" value= "jars/cortado-0.6.0.jar" />
2010-11-21 14:41:16 +01:00
2007-04-27 19:26:57 +02:00
2008-01-22 07:44:00 +01:00
<path id= "libraries.classpath" >
2009-01-27 17:20:27 +01:00
<!-- MigLayout manager -->
2010-11-21 14:30:14 +01:00
<pathelement location= "${basedir}/${miglayout.jar}" />
2009-04-05 14:14:26 +02:00
<!-- Command line processor -->
2010-11-21 14:30:14 +01:00
<pathelement location= "${basedir}/${cli.jar}" />
2009-04-04 11:43:00 +02:00
<!-- Cortado Video Applet -->
2010-11-21 14:30:14 +01:00
<pathelement location= "${basedir}/${cortado.jar}" />
2012-11-09 22:41:24 +01:00
<!-- JOgg/JOrbis libraries -->
<pathelement location= "${basedir}/jars/jogg-0.0.7.jar" />
<pathelement location= "${basedir}/jars/jorbis-0.0.15.jar" />
2010-11-21 15:40:36 +01:00
</path>
2008-01-22 07:44:00 +01:00
<path id= "junit.classpath" >
<pathelement location= "${basedir}/test/lib/junit.jar" />
</path>
<path id= "freecol.build.classpath" >
<path refid= "libraries.classpath" />
</path>
<path id= "test.build.classpath" >
<path refid= "junit.classpath" />
<path refid= "libraries.classpath" />
</path>
<path id= "test.run.classpath" >
<pathelement location= "${freecol.build.dir}" />
<path refid= "junit.classpath" />
<path refid= "libraries.classpath" />
</path>
2007-04-27 19:26:57 +02:00
<condition property= "isOsUnixLike" >
<os family= "unix" />
</condition>
2007-04-29 14:09:14 +02:00
2007-04-27 19:26:57 +02:00
<condition property= "isOsWindows" >
<os family= "windows" />
2007-04-29 14:09:14 +02:00
</condition>
<condition property= "isOsMac" >
<os family= "mac" />
</condition>
<condition property= "isNotMacOrWindows" >
<not >
<or >
<isset property= "isOsWindows" />
<isset property= "isOsMac" />
</or>
</not>
</condition>
2007-04-27 19:26:57 +02:00
2007-05-26 11:49:57 +02:00
<target name= "define-jsmoothgen" >
<taskdef name= "jsmoothgen"
classname="net.charabia.jsmoothgen.ant.JSmoothGen"
classpath="${freecol.build.dir}/jars/jsmoothgen-ant.jar"
/>
</target>
2007-04-08 11:35:40 +02:00
2007-04-27 19:26:57 +02:00
<target name= "init" unless= "TSTAMP" >
<tstamp />
</target>
<!-- Compiles the java source files. -->
<target name= "compile" depends= "init" >
<mkdir dir= "${freecol.build.dir}" />
<javac srcdir= "${freecol.src.dir}"
destdir="${freecol.build.dir}"
2008-01-22 07:44:00 +01:00
classpathref="freecol.build.classpath"
2007-04-27 19:26:57 +02:00
debug="on"
optimize="on"
deprecation="off"
2008-05-09 07:42:13 +02:00
source="${java.target.version}"
2010-03-12 16:39:34 +01:00
target="${java.target.version}"
includeantruntime="false">
2009-02-24 19:43:26 +01:00
<compilerarg value= "-Xlint:unchecked" />
2010-04-17 14:51:22 +02:00
<compilerarg value= "-Xlint:deprecation" />
2008-11-16 15:39:51 +01:00
<compilerarg value= "-g" />
2008-04-14 17:17:48 +02:00
</javac>
2007-04-27 19:26:57 +02:00
</target>
2008-01-22 07:44:00 +01:00
<!-- Compile the JUnit tests -->
2007-04-27 19:26:57 +02:00
<target name= "compile-test" depends= "init" >
<mkdir dir= "${freecol.build.dir}" />
<javac srcdir= "test/src"
destdir="${freecol.build.dir}"
2008-01-22 07:44:00 +01:00
classpathref="test.build.classpath"
2007-04-27 19:26:57 +02:00
debug="on"
optimize="on"
deprecation="off"
2008-05-09 07:42:13 +02:00
source="${java.target.version}"
target="${java.target.version}"
2012-06-10 14:18:02 +02:00
includeantruntime="false">
</javac>
2007-04-27 19:26:57 +02:00
</target>
2010-10-28 17:47:53 +02:00
<target name= "build" depends= "init,compile" description= "Compiles the source files." >
2007-11-11 12:16:49 +01:00
<copy todir= "${freecol.build.dir}" >
2010-10-28 17:47:53 +02:00
<fileset dir= "${freecol.src.dir}" includes= "**/*.xml" />
2007-11-11 12:16:49 +01:00
</copy>
2007-05-12 11:01:48 +02:00
</target>
2013-01-20 02:05:47 +01:00
<condition property= "have-revision" >
<isset property= "FreeCol.Revision" />
</condition>
<target name= "git-raw-revision" unless= "have-revision"
description="Set gitRawRevision property using git">
<exec executable= "git" failifexecutionfails= "false"
outputproperty="gitRawRevision" logError="true">
<arg value= "rev-parse" />
<arg value= "HEAD" />
2007-11-11 12:16:49 +01:00
</exec>
2012-09-04 11:54:49 +02:00
</target>
2013-01-20 02:05:47 +01:00
<target name= "git-revision" unless= "have-revision"
depends="git-raw-revision" if="gitRawRevision"
description="Set FreeCol.Revision from gitRawRevision using git">
2012-09-04 11:54:49 +02:00
<exec executable= "git" failifexecutionfails= "false"
2013-01-20 02:05:47 +01:00
outputproperty="FreeCol.Revision" logError="true">
<arg value= "describe" />
<arg value= "--always" />
</exec>
</target>
<target name= "svnproperties" unless= "have-revision"
description="Creates the svn properties file using svn, setting FreeCol.Revision">
<exec executable= "svn" failifexecutionfails= "false"
2012-09-04 11:54:49 +02:00
output="${basedir}/build/svn.properties">
<arg value= "info" />
<arg value= "." />
</exec>
2013-01-20 02:05:47 +01:00
<property prefix= "FreeCol" file= "build/svn.properties" />
2012-09-04 11:54:49 +02:00
</target>
2013-01-19 15:47:39 +01:00
2013-01-20 02:05:47 +01:00
<target name= "manifest" depends= "git-revision,svnproperties"
2012-09-04 11:54:49 +02:00
description="Creates the Manifest file.">
2013-02-10 14:57:47 +01:00
<manifestclasspath property= "jar.classpath"
jarfile="Freecol.jar">
<classpath refid= "libraries.classpath" />
</manifestclasspath>
2007-11-11 12:16:49 +01:00
<manifest file= "${basedir}/src/MANIFEST.MF" >
<attribute name= "Created-By" value= "FreeCol Team" />
<attribute name= "Main-Class" value= "net.sf.freecol.FreeCol" />
2013-02-10 14:57:47 +01:00
<attribute name= "Class-Path" value= "${jar.classpath}" />
2012-10-11 15:00:40 +02:00
<attribute name= "Product-Name" value= "FreeCol" />
<attribute name= "Package-Title" value= "FreeCol" />
2013-01-20 02:05:47 +01:00
<attribute name= "Package-Version" value= "${FreeCol.Revision}" />
2012-10-11 15:00:40 +02:00
<attribute name= "Package-Vendor" value= "FreeCol Team" />
2007-11-11 12:16:49 +01:00
</manifest>
</target>
2007-04-27 19:26:57 +02:00
<!-- Compiles the source files and creates a JAR - file. -->
2007-11-11 12:16:49 +01:00
<target name= "package" depends= "init,build,manifest" description= "Compiles the source files and creates a JAR-file." >
2007-04-27 19:26:57 +02:00
<jar jarfile= "${freecol.jar.file}"
basedir="${freecol.build.dir}"
manifest="${basedir}/src/MANIFEST.MF"
includes="net/**, org/**"
2007-08-19 09:13:23 +02:00
excludes="**/.svn/**, **/metaserver/**"
2007-04-27 19:26:57 +02:00
/>
</target>
<!-- Compiles the metaserver and creates a JAR - file. -->
2007-11-11 12:16:49 +01:00
<target name= "metaserver" depends= "init,build,manifest" description= "Compiles the metaserver and creates a JAR-file." >
2007-04-27 19:26:57 +02:00
<jar jarfile= "${freecol.metaserver.jar.file}"
basedir="${freecol.build.dir}"
manifest="${basedir}/src/MANIFEST.MF"
includes="net/**, org/**"
2007-08-19 09:13:23 +02:00
excludes="**/.svn/**"
2007-04-27 19:26:57 +02:00
/>
</target>
2007-04-29 14:09:14 +02:00
<target name= "mydist" depends= "mydistWindows,mydistMac,mydistJava"
description="Creates a distribution package for the current system." />
<target name= "mydistWindows" if= "isOsWindows" >
<antcall target= "winInstallerBundle" />
</target>
<target name= "mydistMac" if= "isOsMac" >
<antcall target= "tarMacJavaBundle" />
</target>
<target name= "mydistJava" if= "isNotMacOrWindows" >
<antcall target= "javaInstallerBundle" />
</target>
2007-04-27 19:26:57 +02:00
<!--
Creates archives and installers for distribution and places these in the
"dist" directory.
Various platforms can be omitted for prerelease testing by setting properties on the command line:
skip.dist.mac="true" suppresses mac packaging
skip.dist.installer="true" suppresses creation of installers
skip.dist.java="true" suppresses zip and tar creation of the jarfiles
skip.dist.source="true" suppresses packaging the source files
For a formal release, none of these properties should be set.
-->
2010-10-28 17:47:53 +02:00
<target name= "dist" description= "Creates archives and installers for distribution."
2011-01-23 11:40:16 +01:00
depends="init,initDist,zipJavaBundle,zipSourceBundle,javaInstallerBundle,winInstallerBundle,tarMacJavaBundle">
2007-04-27 19:26:57 +02:00
<echo message= "" />
<echo message= "-------------------------------------------------" />
<echo message= "Distribution files created:" />
<echo message= "${freecol.release.dir}" />
<echo message= "-------------------------------------------------" />
</target>
<target name= "initDist" depends= "init,setReleaseVersion" >
<mkdir dir= "${freecol.release.dir}" />
</target>
2011-04-10 11:52:26 +02:00
<target name= "setReleaseVersion" depends= "askReleaseVersion" >
2010-10-28 17:47:53 +02:00
<property name= "freecol.release.name" value= "${freecol.name}-${freecol.version}" />
2007-04-27 19:26:57 +02:00
<echo message= "Creating Distribution of ${freecol.release.name}" />
<replaceregexp file= "${freecol.src.dir}/net/sf/freecol/FreeCol.java"
match="FREECOL_VERSION\s*=\s*" (.*?)" \;"
replace="FREECOL_VERSION = " ${freecol.version}" \;"
/>
<echo message= "Game version updated in FreeCol.java" />
</target>
2011-04-10 11:52:26 +02:00
<target name= "askReleaseVersion" unless= "freecol.version" >
2013-02-06 07:24:29 +01:00
<input message= "Please specify the release version (default: git-${DSTAMP}): "
addproperty="freecol.version" defaultvalue="git-${DSTAMP}" />
2011-04-10 11:52:26 +02:00
</target>
2007-04-27 19:26:57 +02:00
<target name= "prepareManual" depends= "initDist,print-manual" >
<mkdir dir= "${freecol.release.dir}/manual/${freecol.name}" />
<copy todir= "${freecol.release.dir}/manual/${freecol.name}" >
<fileset dir= "${freecol.doc.dir}" includes= "FreeCol.pdf" />
</copy>
</target>
2013-02-06 07:24:29 +01:00
<target name= "prepareBaseFiles" depends= "initDist,desktop-entry" >
2007-04-27 19:26:57 +02:00
<antcall target= "clean" />
<antcall target= "package" />
<mkdir dir= "${freecol.release.dir}/base/${freecol.name}" />
<copy todir= "${freecol.release.dir}/base/${freecol.name}" >
<fileset dir= "${basedir}" includes= "FreeCol.jar" />
<fileset dir= "${freecol.packaging.dir}/common" includes= "COPYING" />
<fileset dir= "${freecol.packaging.dir}/common" includes= "README" />
2012-03-17 10:41:13 +01:00
<fileset dir= "${freecol.packaging.dir}/common" includes= "freecol.cmd" />
2007-04-27 19:26:57 +02:00
<fileset dir= "${freecol.packaging.dir}/common" includes= "freecol.xpm" />
2007-08-19 09:13:23 +02:00
<fileset dir= "${basedir}" includes= "data/**" excludes= "**/.svn/**" />
<fileset dir= "${basedir}" includes= "jars/**" excludes= "**/.svn/**" />
2007-04-27 19:26:57 +02:00
</copy>
2012-12-29 02:32:05 +01:00
<copy file= "${freecol.packaging.dir}/common/freecol.sh"
tofile="${freecol.release.dir}/base/${freecol.name}/freecol"/>
2007-04-27 19:26:57 +02:00
</target>
<target name= "prepareSourceFiles" depends= "initDist" >
<antcall target= "clean" />
<mkdir dir= "${freecol.release.dir}/source/${freecol.name}" />
<copy todir= "${freecol.release.dir}/source/${freecol.name}" >
2007-08-19 09:13:23 +02:00
<fileset dir= "${basedir}" excludes= "**/.svn/**,dist/**,data/**,jars/**" />
2007-04-27 19:26:57 +02:00
</copy>
</target>
2007-05-26 11:49:57 +02:00
<target name= "prepareWinFiles" depends= "initDist,define-jsmoothgen" >
2007-04-27 19:26:57 +02:00
<jsmoothgen project= "${freecol.build.dir}/startup.jsmooth" skeletonroot= "${freecol.build.dir}/skeletons" />
<move todir= "${freecol.release.dir}/win/${freecol.name}" >
<fileset dir= "${freecol.build.dir}" includes= "freecol.exe" />
</move>
<mkdir dir= "${freecol.release.dir}/win/${freecol.name}/Uninstaller" />
<jsmoothgen project= "${freecol.build.dir}/uninstaller.jsmooth" skeletonroot= "${freecol.build.dir}/skeletons" />
<move todir= "${freecol.release.dir}/win/${freecol.name}/Uninstaller" >
<fileset dir= "${freecol.build.dir}" includes= "uninstaller.exe" />
</move>
</target>
<target name= "zipJavaBundle" unless= "skip.dist.java" depends= "initDist,prepareManual,prepareBaseFiles" >
<zip destfile= "${freecol.release.dir}/${freecol.release.name}.zip" >
<fileset dir= "${freecol.release.dir}/base" includes= "${freecol.name}/**" />
<fileset dir= "${freecol.release.dir}/manual" includes= "${freecol.name}/**" />
</zip>
</target>
<target name= "zipSourceBundle" unless= "skip.dist.source" depends= "initDist,prepareSourceFiles" >
<zip destfile= "${freecol.release.dir}/${freecol.release.name}-src.zip" >
<fileset dir= "${freecol.release.dir}/base" includes= "${freecol.name}/**" />
<fileset dir= "${freecol.release.dir}/source" includes= "${freecol.name}/**" />
</zip>
</target>
2010-10-28 17:47:53 +02:00
2008-11-24 22:40:27 +01:00
<target name= "executeIzpack" >
2011-01-23 11:40:16 +01:00
<izpack output= "${freecol.release.dir}/${freecol.release.name}-installer.jar"
2010-10-28 17:47:53 +02:00
installerType="standard"
2007-04-27 19:26:57 +02:00
basedir="${freecol.release.dir}/"
izpackdir="${freecol.build.dir}">
<config > < ![CDATA[
<installation version= "1.0" >
<info >
<appname > FreeCol</appname>
<appversion > @{freecol.version}</appversion>
<appsubpath > freecol</appsubpath>
<url > http://www.freecol.org</url>
<authors >
<author name= "The FreeCol Team" email= "developers@freecol.org" />
</authors>
2013-01-16 09:46:00 +01:00
<javaversion > 1.6</javaversion>
2007-04-27 19:26:57 +02:00
</info>
2007-07-05 13:06:20 +02:00
<guiprefs width= "640" height= "480" resizable= "no" >
<laf name= "looks" >
<os family= "unix" />
</laf>
2007-07-05 13:15:04 +02:00
<modifier key= "langDisplayType" value= "native" />
2007-07-05 13:06:20 +02:00
</guiprefs>
2007-04-27 19:26:57 +02:00
<locale >
2010-06-23 08:05:04 +02:00
<langpack iso3= "cat" />
<langpack iso3= "chn" />
<langpack iso3= "cze" />
<langpack iso3= "dan" />
2007-04-27 19:26:57 +02:00
<langpack iso3= "deu" />
2010-06-23 08:05:04 +02:00
<langpack iso3= "eng" />
2011-01-22 10:34:39 +01:00
<!-- <langpack iso3="eus"/> -->
2007-04-27 19:26:57 +02:00
<langpack iso3= "fin" />
<langpack iso3= "fra" />
2011-01-22 10:34:39 +01:00
<!-- <langpack iso3="glg"/> -->
2007-07-05 12:39:20 +02:00
<langpack iso3= "hun" />
<langpack iso3= "ita" />
2010-06-23 08:05:04 +02:00
<langpack iso3= "jpn" />
<!-- <langpack iso3="mys"/> -->
2007-07-05 12:39:20 +02:00
<langpack iso3= "ned" />
2010-06-23 08:05:04 +02:00
<langpack iso3= "nor" />
2007-07-05 12:39:20 +02:00
<langpack iso3= "pol" />
2007-04-27 19:26:57 +02:00
<langpack iso3= "por" />
2011-01-22 10:34:39 +01:00
<!-- <langpack iso3="prt"/> -->
2010-06-23 08:05:04 +02:00
<!-- <langpack iso3="rom"/> -->
2007-07-05 12:39:20 +02:00
<langpack iso3= "rus" />
2010-06-23 08:05:04 +02:00
<!-- <langpack iso3="scg"/> -->
2007-07-05 12:39:20 +02:00
<langpack iso3= "spa" />
2010-06-23 08:05:04 +02:00
<!-- <langpack iso3="svk"/> -->
2007-07-05 12:39:20 +02:00
<langpack iso3= "swe" />
2010-06-23 08:05:04 +02:00
<langpack iso3= "ukr" />
2007-04-27 19:26:57 +02:00
</locale>
<resources >
<res id= "LicencePanel.licence" src= "base/@{freecol.name}/COPYING" />
<res id= "shortcutSpec.xml" src= "@{freecol.build.dir}/winShortcutSpec.xml" />
<res id= "Unix_shortcutSpec.xml" src= "@{freecol.build.dir}/unixShortcutSpec.xml" />
2007-07-06 14:06:54 +02:00
<res id= "installer.langsel.img" src= "@{freecol.build.dir}/install.png" />
2010-06-19 09:43:45 +02:00
<res id= "packsLang.xml_cat" src= "@{freecol.build.dir}/installer/lang.xml_cat" />
<res id= "packsLang.xml_chn" src= "@{freecol.build.dir}/installer/lang.xml_chn" />
<res id= "packsLang.xml_cze" src= "@{freecol.build.dir}/installer/lang.xml_cze" />
<res id= "packsLang.xml_dan" src= "@{freecol.build.dir}/installer/lang.xml_dan" />
2007-07-11 14:13:55 +02:00
<res id= "packsLang.xml_deu" src= "@{freecol.build.dir}/installer/lang.xml_deu" />
2010-06-19 09:43:45 +02:00
<res id= "packsLang.xml_eng" src= "@{freecol.build.dir}/installer/lang.xml_eng" />
<res id= "packsLang.xml_eus" src= "@{freecol.build.dir}/installer/lang.xml_eus" />
<res id= "packsLang.xml_fin" src= "@{freecol.build.dir}/installer/lang.xml_fin" />
2007-07-12 20:48:56 +02:00
<res id= "packsLang.xml_fra" src= "@{freecol.build.dir}/installer/lang.xml_fra" />
2010-06-19 09:43:45 +02:00
<res id= "packsLang.xml_glg" src= "@{freecol.build.dir}/installer/lang.xml_glg" />
<res id= "packsLang.xml_hun" src= "@{freecol.build.dir}/installer/lang.xml_hun" />
2007-07-12 21:25:07 +02:00
<res id= "packsLang.xml_ita" src= "@{freecol.build.dir}/installer/lang.xml_ita" />
2010-06-19 09:43:45 +02:00
<res id= "packsLang.xml_jpn" src= "@{freecol.build.dir}/installer/lang.xml_jpn" />
<!-- <res id="packsLang.xml_mys" src="@{freecol.build.dir}/installer/lang.xml_mys"/> -->
<res id= "packsLang.xml_ned" src= "@{freecol.build.dir}/installer/lang.xml_ned" />
<res id= "packsLang.xml_nor" src= "@{freecol.build.dir}/installer/lang.xml_nor" />
<res id= "packsLang.xml_pol" src= "@{freecol.build.dir}/installer/lang.xml_pol" />
2007-07-13 08:50:08 +02:00
<res id= "packsLang.xml_por" src= "@{freecol.build.dir}/installer/lang.xml_por" />
2010-06-19 09:43:45 +02:00
<res id= "packsLang.xml_prt" src= "@{freecol.build.dir}/installer/lang.xml_prt" />
<!-- <res id="packsLang.xml_rom" src="@{freecol.build.dir}/installer/lang.xml_rom"/> -->
<res id= "packsLang.xml_rus" src= "@{freecol.build.dir}/installer/lang.xml_rus" />
<!-- <res id="packsLang.xml_scg" src="@{freecol.build.dir}/installer/lang.xml_scg"/> -->
<res id= "packsLang.xml_spa" src= "@{freecol.build.dir}/installer/lang.xml_spa" />
<!-- <res id="packsLang.xml_svk" src="@{freecol.build.dir}/installer/lang.xml_svk"/> -->
2007-07-13 13:28:41 +02:00
<res id= "packsLang.xml_swe" src= "@{freecol.build.dir}/installer/lang.xml_swe" />
2010-06-19 09:43:45 +02:00
<res id= "packsLang.xml_ukr" src= "@{freecol.build.dir}/installer/lang.xml_ukr" />
2007-04-27 19:26:57 +02:00
</resources>
<native type= "izpack" name= "ShellLink.dll" />
<panels >
<panel classname= "HelloPanel" />
<panel classname= "LicencePanel" />
<panel classname= "TargetPanel" />
<panel classname= "PacksPanel" />
<panel classname= "InstallPanel" />
<panel classname= "ShortcutPanel" />
<panel classname= "SimpleFinishPanel" />
</panels>
<packs >
2007-07-06 14:06:54 +02:00
<pack id= "FreeCol" name= "FreeCol" required= "yes" >
<description > The FreeCol application and data files. This pack includes all files required to play the game.</description>
2007-04-27 19:26:57 +02:00
<fileset dir= "base/@{freecol.name}" targetdir= "$INSTALL_PATH" />
<fileset dir= "@{freecol.packaging.dir}/common/" includes= "Uninstaller/**" targetdir= "$INSTALL_PATH" />
<fileset dir= "win/@{freecol.name}" targetdir= "$INSTALL_PATH" os= "windows" />
<executable targetfile= "$INSTALL_PATH/freecol" stage= "never" keep= "true" />
<executable targetfile= "$INSTALL_PATH/Uninstaller/uninstaller" stage= "never" keep= "true" />
</pack>
2007-07-06 14:06:54 +02:00
<pack id= "GameManual" name= "Game Manual" required= "no" preselected= "yes" >
<description > This pack includes the game manual.</description>
2007-04-27 19:26:57 +02:00
<fileset dir= "manual/@{freecol.name}" targetdir= "$INSTALL_PATH" />
</pack>
</packs>
</installation>
]]></config>
</izpack>
</target>
2008-11-24 22:40:27 +01:00
<target name= "javaInstallerBundle" unless= "skip.dist.installer" description= "Builds a platform independent installer"
2010-06-19 09:43:45 +02:00
depends="initDist,prepareWinFiles,prepareManual,prepareBaseFiles,prepareSourceFiles,installer-translations">
2008-11-24 22:40:27 +01:00
<taskdef name= "izpack"
classname="com.izforge.izpack.ant.IzPackTask"
classpath="${freecol.build.dir}/jars/standalone-compiler.jar"
/>
<antcall target= "executeIzpack" />
</target>
2007-04-27 19:26:57 +02:00
<target name= "winInstallerBundle" unless= "skip.dist.installer" description= "Builds a windows installer"
2007-05-26 11:49:57 +02:00
depends="initDist,javaInstallerBundle,define-jsmoothgen">
2007-04-27 19:26:57 +02:00
<copy todir= "${freecol.release.dir}" >
<fileset dir= "${freecol.build.dir}" includes= "installer.jsmooth" />
</copy>
2010-10-28 17:47:53 +02:00
<replace file= "${freecol.release.dir}/installer.jsmooth"
2007-04-27 19:26:57 +02:00
token="%ant:freecol.release.name%"
value="${freecol.release.name}"
/>
2010-10-28 17:47:53 +02:00
<replace file= "${freecol.release.dir}/installer.jsmooth"
2007-04-27 19:26:57 +02:00
token="%ant:freecol.installerjar%"
value="${freecol.release.dir}/${freecol.release.name}-installer.jar"
/>
<jsmoothgen project= "${freecol.release.dir}/installer.jsmooth" skeletonroot= "${freecol.build.dir}/skeletons" />
</target>
<!-- Builds a doubleclickable application bundle running on Mac OS X -->
2007-05-26 11:49:57 +02:00
<target name= "macJavaBundle" unless= "skip.dist.mac" depends= "prepareManual,prepareBaseFiles" >
<!-- JarBundler is a feature - rich Ant task which will create a Mac OS X
application bundle from a list of Jar files and a main class name.
(GPL-Software) -> http://informagen.com/JarBundler/ -->
2010-10-28 17:47:53 +02:00
<taskdef name= "jarbundler"
classname="net.sourceforge.jarbundler.JarBundler"
2007-05-26 11:49:57 +02:00
classpath="${freecol.build.dir}/jars/jarbundler.jar"
/>
2007-04-27 19:26:57 +02:00
<jarbundler dir= "${freecol.release.dir}"
name="FreeCol"
mainclass="net.sf.freecol.FreeCol"
version="${freecol.version}"
2010-06-03 09:39:37 +02:00
vmoptions="-Xmx256M -Dapple.awt.fakefullscreen=true"
2009-06-25 07:42:16 +02:00
jvmversion="1.6+"
2007-04-27 19:26:57 +02:00
arguments="--windowed --freecol-data FreeCol.app/Contents/Resources/"
stubfile="${freecol.build.dir}/skeletons/FreeCol"
2010-10-28 17:47:53 +02:00
icon="${freecol.packaging.dir}/icons/FreeCol.icns">
2007-04-27 19:26:57 +02:00
<jarfileset dir= "${freecol.release.dir}/base/freecol/" >
<include name= "**/*" />
<exclude name= "data/**" />
</jarfileset>
<resourcefileset dir= "${freecol.release.dir}/base/freecol/data" />
</jarbundler>
</target>
<target name= "tarMacJavaBundle" unless= "skip.dist.mac" depends= "tarMacJavaBundleOnUnixLike,tarMacJavaBundleOnWindows" description= "Creates a Mac OS X application bundle inside a tar file." >
</target>
<target name= "tarMacJavaBundleOnUnixLike" unless= "skip.dist.mac" if= "isOsUnixLike" depends= "macJavaBundle" >
<delete file= "${freecol.release.dir}/FreeCol.app/Contents/MacOS/FreeCol" />
<symlink link= "${freecol.release.dir}/FreeCol.app/Contents/MacOS/FreeCol" resource= "/System/Library/Frameworks/JavaVM.framework/Resources/MacOS/JavaApplicationStub" />
<exec executable= "tar" >
<arg value= "cfvj" />
<arg value= "${freecol.release.dir}/${freecol.release.name}-mac.tar.bz2" />
<arg value= "-C" />
<arg value= "${freecol.release.dir}" />
<arg value= "FreeCol.app/" />
</exec>
</target>
<target name= "tarMacJavaBundleOnWindows" depends= "macJavaBundle" unless= "skip.dist.mac" if= "isOsWindows" >
<echo message= "Warning: You are building a Mac Os X Java Application Bundle containing a Copy Java Application Stub. Creating a bundle with the current copy of Java Launching Stub could lead to a future situation where the JavaApplicationStub file could become incompatible with a future OS X update. To avoid this, use a unix like system ... " />
<tar destfile= "${freecol.release.dir}/${freecol.release.name}-mac.tar.bz2" compression= "bzip2" >
2010-10-28 17:47:53 +02:00
<tarfileset dir= "${freecol.release.dir}" mode= "755"
includes="FreeCol.app/Contents/MacOS/FreeCol"
2007-04-27 19:26:57 +02:00
excludes="**/freecol*"
2010-10-28 17:47:53 +02:00
followsymlinks="false"
2007-04-27 19:26:57 +02:00
/>
<tarfileset followsymlinks= "false" dir= "${freecol.release.dir}" >
<include name= "FreeCol.app/**" />
<exclude name= "**/freecol*" />
<exclude name= "FreeCol.app/Contents/MacOS/FreeCol" />
2010-10-28 17:47:53 +02:00
</tarfileset>
2007-04-27 19:26:57 +02:00
</tar>
</target>
<!-- Cleans the directories by removing auto - generated files. -->
<target name= "clean" depends= "init" description= "Cleans the directories by removing auto-generated files." >
<delete quiet= "true" includeEmptyDirs= "true" >
2013-02-10 14:57:47 +01:00
<fileset dir= "${freecol.build.dir}" includes= "net/**" />
<fileset dir= "${freecol.build.dir}" includes= "timestamp.inf" />
<fileset dir= "${freecol.build.dir}" includes= "report/**" />
<fileset dir= "${freecol.build.dir}" includes= "TEST-net.sf.freecol.*" />
<fileset dir= "${freecol.build.dir}" includes= "dependencies.txt" />
<fileset dir= "${freecol.doc.dir}" excludes= "*.tex images/*" />
2007-04-27 19:26:57 +02:00
</delete>
2007-05-15 16:04:58 +02:00
<delete quiet= "true" file= "${freecol.jar.file}" />
<delete quiet= "true" file= "TESTS-TestSuites.xml" />
2007-04-27 19:26:57 +02:00
<delete quiet= "true" dir= "${freecol.javadoc.dir}" />
2007-05-15 16:04:58 +02:00
<delete quiet= "true" file= "Freecol.log" />
2007-04-27 19:26:57 +02:00
</target>
<target name= "distclean" depends= "init,clean" description= "Cleans the directories and removes the distribution directory." >
<delete quiet= "true" includeEmptyDirs= "true" >
<fileset dir= "${freecol.release.dir}" />
</delete>
</target>
<target name= "fix" depends= "init" >
<fixcrlf srcdir= "${freecol.src.dir}"
includes="**/*.java"
eol="asis"
tab="remove"
javafiles="yes"
tablength="4"
eof="asis"
/>
</target>
<!-- Generate JavaDoc documentation. -->
<target name= "javadoc" depends= "init" description= "Generate JavaDoc documentation." >
<mkdir dir= "${freecol.javadoc.dir}" />
<javadoc sourcepath= "${freecol.src.dir}"
overview="${freecol.overview.file}"
destdir="${freecol.javadoc.dir}"
packagenames="net.sf.freecol.*"
2007-06-19 01:21:30 +02:00
private="true"
2008-01-22 07:44:00 +01:00
classpathref="freecol.build.classpath"
2007-04-27 19:26:57 +02:00
Author="true"
Windowtitle="FreeCol Code Documentation"
/>
<echo message= "" />
<echo message= "-------------------------------------------------" />
<echo message= "JavaDoc-generated documentation created:" />
<echo message= "${freecol.javadoc.dir}" />
<echo message= "-------------------------------------------------" />
</target>
<!-- example:
2007-05-15 16:04:58 +02:00
ant -lib test/lib/junit.jar -Dtest=common.model.BuildingTest test
2007-04-27 19:26:57 +02:00
-->
2007-05-15 16:04:58 +02:00
<target name= "test" depends= "build-unit-tests"
2007-04-27 19:26:57 +02:00
description="Runs a particular unit test"
>
<echo message= "if the next task fails then please read the build script" />
<!-- if the next fails then here is the long answer:
http://ant.apache.org/faq.html#delegating-classloader
the short answer depends.
2010-10-28 17:47:53 +02:00
if you have Ant 1.7, the junit.jar can exist on the classpath.
2007-04-27 19:26:57 +02:00
upgrading to 1.7 may be the best solution.
if you have Ant 1.6:
ant -lib test/lib/junit.jar testall
if you have a version of Ant prior to 1.6 on Windows:
set CLASSPATH=%CLASSPATH%;test\lib\junit.jar
ant testall
if you have a version of Ant prior to 1.6 on UNIX:
export CLASSPATH=${CLASSPATH}:test/lib/junit.jar; ant testall
-->
<junit printsummary= "yes" >
2010-11-21 15:40:36 +01:00
<classpath refid= "test.run.classpath" />
<formatter type= "brief" usefile= "false" />
<formatter type= "plain" />
<test todir= "${freecol.build.dir}" name= "net.sf.freecol.${test}" />
<sysproperty key= "java.awt.headless" value= "true" />
2007-04-27 19:26:57 +02:00
</junit>
2007-05-15 16:50:58 +02:00
<echo message= "For more detailed information about this test run see:" />
<echo message= "${freecol.build.dir}/TEST-net.sf.freecol.${test}.txt" />
2007-04-27 19:26:57 +02:00
</target>
<target name= "testall" depends= "build-unit-tests" unless= "skip.dist.test"
2007-09-24 21:15:32 +02:00
description="Runs all unit tests">
2010-10-28 17:47:53 +02:00
2007-09-24 21:15:32 +02:00
<delete dir= "${freecol.build.dir}/report" />
<mkdir dir= "${freecol.build.dir}/report" />
<mkdir dir= "${freecol.build.dir}/report/xml" />
2010-10-28 17:47:53 +02:00
2007-04-27 19:26:57 +02:00
<echo message= "if the next task fails then please read the build script" />
<!-- if the next fails then here is the long answer:
http://ant.apache.org/faq.html#delegating-classloader
the short answer depends.
2010-10-28 17:47:53 +02:00
if you have Ant 1.7, the junit.jar can exist on the classpath.
2007-04-27 19:26:57 +02:00
upgrading to 1.7 may be the best solution.
if you have Ant 1.6:
ant -lib test/lib/junit.jar testall
if you have a version of Ant prior to 1.6 on Windows:
set CLASSPATH=%CLASSPATH%;test\lib\junit.jar
ant testall
if you have a version of Ant prior to 1.6 on UNIX:
export CLASSPATH=${CLASSPATH}:test/lib/junit.jar; ant testall
-->
2011-02-01 12:17:15 +01:00
<junit printsummary= "on" errorProperty= "error.junit"
failureProperty="error.junit" fork="yes" maxmemory="48m">
2008-01-22 07:44:00 +01:00
<classpath refid= "test.run.classpath" />
2007-04-27 19:26:57 +02:00
<formatter type= "xml" />
2010-10-28 17:47:53 +02:00
2007-09-26 21:56:20 +02:00
<test todir= "${freecol.build.dir}/report/xml" name= "net.sf.freecol.AllTests" fork= "yes" />
2010-10-28 17:47:53 +02:00
2007-09-24 21:15:32 +02:00
<!--
<batchtest fork= "false" todir= "${freecol.build.dir}/report/xml" >
2007-04-27 19:26:57 +02:00
<fileset dir= "test/src" includes= "**/*Test.java" />
</batchtest>
2007-09-24 21:15:32 +02:00
-->
2008-07-03 07:53:27 +02:00
<sysproperty key= "java.awt.headless" value= "true" />
2007-04-27 19:26:57 +02:00
</junit>
2010-10-28 17:47:53 +02:00
2007-04-27 19:26:57 +02:00
<junitreport >
2007-09-24 21:15:32 +02:00
<fileset dir= "${freecol.build.dir}/report/xml" >
2007-04-27 19:26:57 +02:00
<include name= "TEST-*.xml" />
</fileset>
2007-09-24 21:15:32 +02:00
<report todir= "${freecol.build.dir}/report" />
2007-04-27 19:26:57 +02:00
</junitreport>
2007-09-24 21:15:32 +02:00
<echo message= "For detailed results of the test run see: ${freecol.build.dir}/report/index.html" />
2010-10-28 17:47:53 +02:00
2007-09-24 21:15:32 +02:00
<fail if= "error.junit" message= "Automated Unit Tests failed." />
2007-04-27 19:26:57 +02:00
</target>
<target name= "build-unit-tests" depends= "build" >
<depend srcDir= "test/src" destDir= "${freecol.build.dir}"
cache="${freecol.build.dir}" />
<javac srcdir= "test/src" destdir= "${freecol.build.dir}"
2008-01-22 07:44:00 +01:00
classpathref="test.build.classpath" debug="on" deprecation="off"
2010-10-28 17:47:53 +02:00
source="${java.target.version}" target="${java.target.version}"
2010-03-12 16:51:35 +01:00
includeantruntime="false"/>
2007-04-27 19:26:57 +02:00
</target>
2008-10-05 12:13:06 +02:00
<target name= "validate" description= "Validates the specification." >
2009-03-28 17:07:54 +01:00
<echo message= "Validating freecol/specification.xml." />
2008-10-05 12:13:06 +02:00
<schemavalidate
noNamespaceFile="schema/specification-schema.xsd"
2010-09-12 10:14:30 +02:00
file="${freecol.rules.dir}/freecol/specification.xml">
2008-10-05 12:13:06 +02:00
</schemavalidate>
2009-03-28 17:07:54 +01:00
<echo message= "Validating classic/specification.xml." />
2008-11-25 16:22:05 +01:00
<schemavalidate
noNamespaceFile="schema/specification-schema.xsd"
2010-09-12 10:14:30 +02:00
file="${freecol.rules.dir}/classic/specification.xml">
2008-11-25 16:22:05 +01:00
</schemavalidate>
2009-03-28 17:07:54 +01:00
<echo message= "Validating testing/specification.xml." />
2008-11-29 10:47:44 +01:00
<schemavalidate
noNamespaceFile="schema/specification-schema.xsd"
2010-09-12 10:14:30 +02:00
file="${freecol.rules.dir}/testing/specification.xml">
2008-11-29 10:47:44 +01:00
</schemavalidate>
2008-10-05 12:13:06 +02:00
</target>
2013-02-10 14:57:47 +01:00
<target name= "print-manual" unless= "print.manual.is.up.to.date"
2007-04-27 19:26:57 +02:00
description="Creates the printable user guide.">
<delete file= "doc/FreeCol.ind" />
<exec executable= "pdflatex" dir= "doc" >
<arg file= "doc/FreeCol.tex" />
</exec>
<exec executable= "makeindex" dir= "doc" >
<arg file= "doc/FreeCol.idx" />
</exec>
<exec executable= "pdflatex" dir= "doc" >
<arg file= "doc/FreeCol.tex" />
</exec>
2013-02-10 14:57:47 +01:00
<property name= "print.manual.is.up.to.date" value= "true" />
2007-04-27 19:26:57 +02:00
</target>
2013-02-10 14:57:47 +01:00
<target name= "online-manual" unless= "online.manual.is.up.to.date"
2007-04-27 19:26:57 +02:00
description="Creates the online user guide.">
<delete file= "doc/FreeCol.ind" />
<exec executable= "htlatex" dir= "doc" >
<arg file= "doc/FreeCol.tex" />
</exec>
<exec executable= "tex" dir= "doc" >
<arg line= "\def\filename{{FreeCol}{idx}{4dx}{ind}} \input idxmake.4ht" />
</exec>
<exec executable= "makeindex" dir= "doc" >
<arg file= "doc/FreeCol.4dx" />
</exec>
<exec executable= "htlatex" dir= "doc" >
<arg file= "doc/FreeCol.tex" />
</exec>
2013-02-10 14:57:47 +01:00
<property name= "online.manual.is.up.to.date" value= "true" />
2007-04-27 19:26:57 +02:00
</target>
2010-10-28 17:47:53 +02:00
<target name= "manual" depends= "print-manual,online-manual"
2007-04-27 19:26:57 +02:00
description="Creates the printable and online user guides.">
</target>
<target name= "fixTabsWindows" >
<fixcrlf srcdir= "${freecol.src.dir}" tab= "remove" tablength= "4"
includes="**/*.java" eol="crlf"
/>
</target>
<target name= "fixTabsUnix" >
<fixcrlf srcdir= "${freecol.src.dir}" tab= "remove" tablength= "4"
includes="**/*.java" eol="lf"
/>
</target>
<!-- Prints a report on certain translations, which you can specify
by setting the localeKey property ("-DlocaleKey=fi", for example),
or all translations. Use "-emacs" in order to suppress extensive
2010-10-28 17:47:53 +02:00
logging. -->
2007-04-27 19:26:57 +02:00
<target name= "translation-report" depends= "build"
description="Creates report on translations.">
<condition property= "localeKey" else= "" >
<isset property= "localeKey" />
</condition>
<java classname= "net.sf.freecol.tools.TranslationReport" classpath= "build/" >
2013-02-06 07:24:29 +01:00
<arg value= "data/strings" />
2007-04-27 19:26:57 +02:00
<arg value= "${localeKey}" />
</java>
</target>
2008-01-12 16:35:57 +01:00
2009-07-16 17:07:20 +02:00
<!-- Merges new translations from trunk. You can specify a
particular language by setting the localeKey property
("-DlocaleKey=fi", for example), or all translations. -->
2013-02-06 07:24:29 +01:00
<!-- Now that translations are hosted at translatewiki, we no longer need this.
2009-07-16 17:07:20 +02:00
<target name= "merge-translations" depends= "build"
description="Merges translations from trunk.">
<condition property= "localeKey" else= "" >
<isset property= "localeKey" />
</condition>
<java classname= "net.sf.freecol.tools.MergeTranslations" classpath= "build/" >
2013-02-06 07:24:29 +01:00
<arg value= "../../trunk/data/strings" />
<arg value= "data/strings" />
2009-07-16 17:07:20 +02:00
<arg value= "${localeKey}" />
</java>
</target>
2013-02-06 07:24:29 +01:00
-->
2009-07-16 17:07:20 +02:00
2010-01-23 09:57:16 +01:00
<!-- Validates a savegame files specified as property file
("-Dsavegame=whatever.fsg", for example). If file is a directory,
all savegame files in that directory will be validated. -->
<target name= "validate-savegame" depends= "build"
description="Validates a savegame, or directory of savegames.">
<condition property= "savegame" else= "" >
<isset property= "savegame" />
</condition>
2010-01-23 18:33:14 +01:00
<java classname= "net.sf.freecol.tools.SaveGameValidator" >
<classpath refid= "test.run.classpath" />
<arg value= "${savegame}" />
2010-01-23 09:57:16 +01:00
</java>
</target>
2009-11-01 11:49:25 +01:00
<!-- Creates installer strings. -->
<target name= "installer-translations" depends= "build"
description="Creates properties files for installer translations.">
2010-06-19 09:43:45 +02:00
<java classname= "net.sf.freecol.tools.InstallerTranslations"
classpath="build/" />
2009-11-01 11:49:25 +01:00
</target>
2013-02-04 08:25:33 +01:00
<!-- Creates 'freecol.desktop' file. -->
2012-01-07 15:22:29 +01:00
<target name= "desktop-entry" depends= "build"
2013-02-04 08:25:33 +01:00
description="Creates 'freecol.desktop' file.">
2013-02-06 07:24:29 +01:00
<mkdir dir= "${freecol.release.dir}/base/freecol" />
2012-01-07 15:22:29 +01:00
<java classname= "net.sf.freecol.tools.DesktopEntry"
2013-02-06 07:24:29 +01:00
classpath="build/">
<arg value= "${freecol.release.dir}/base/freecol/freecol.desktop" />
</java>
2012-01-07 15:22:29 +01:00
</target>
2008-01-12 16:35:57 +01:00
<target name= "pmd" >
<taskdef name= "pmd" classname= "net.sourceforge.pmd.ant.PMDTask"
classpath="./pmd-4.1/lib/pmd-4.1.jar"/>
<pmd shortFilenames= "true" >
<ruleset > basic</ruleset>
<ruleset > imports</ruleset>
2011-05-15 09:14:40 +02:00
<!-- <ruleset>optimizations</ruleset> -->
2008-01-12 16:35:57 +01:00
<ruleset > unusedcode</ruleset>
<formatter type= "html" toFile= "pmd_report.html" linkPrefix= "http://pmd.sourceforge.net/xref/" />
<fileset dir= "src" >
<include name= "**/*.java" />
</fileset>
</pmd>
</target>
2008-11-29 10:47:44 +01:00
<target name= "prepare-commit"
description="Rebuild from scratch and run all tests."
depends="clean,package,validate,testall"/>
2009-07-19 12:21:08 +02:00
<!-- This is a shortcut for NetBeans, and possibly other IDEs. -->
<target name= "run" depends= "package" description= "Runs the game" >
<java jar= "FreeCol.jar" fork= "true" >
<jvmarg value= "-Xmx128m" />
</java>
</target>
2008-11-29 10:47:44 +01:00
2009-11-04 18:11:47 +01:00
<target name= "cobertura" depends= "build" >
<property name= "cobertura.dir" value= "cobertura" />
2010-10-28 17:47:53 +02:00
2009-11-04 18:11:47 +01:00
<path id= "cobertura.classpath" >
<fileset dir= "${cobertura.dir}" >
<include name= "cobertura.jar" />
<include name= "lib/**/*.jar" />
</fileset>
</path>
<taskdef classpathref= "cobertura.classpath" resource= "tasks.properties" />
<cobertura-instrument todir= "build/instrumented-classes" >
<fileset dir= "build/net" >
<include name= "**/*.class" />
</fileset>
</cobertura-instrument>
2010-10-28 17:47:53 +02:00
2009-11-04 18:11:47 +01:00
<delete dir= "${freecol.build.dir}/report" />
<mkdir dir= "${freecol.build.dir}/report" />
<mkdir dir= "${freecol.build.dir}/report/xml" />
2010-10-28 17:47:53 +02:00
2009-11-04 18:11:47 +01:00
<echo message= "if the next task fails then please read the build script" />
<junit printsummary= "on" errorproperty= "error.junit" fork= "yes" maxmemory= "48m" >
<classpath location= "build/instrumented-classes" />
<classpath location= "build/net" />
<classpath refid= "cobertura.classpath" />
<classpath refid= "test.run.classpath" />
<formatter type= "xml" />
2010-10-28 17:47:53 +02:00
2009-11-04 18:11:47 +01:00
<test todir= "${freecol.build.dir}/report/xml" name= "net.sf.freecol.AllTests" fork= "yes" />
<sysproperty key= "java.awt.headless" value= "true" />
</junit>
2010-10-28 17:47:53 +02:00
2009-11-04 18:11:47 +01:00
<cobertura-report srcdir= "${freecol.src.dir}" destdir= "cobertura/report" />
</target>
2007-04-19 18:29:34 +02:00
</project>