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>
2008-05-09 07:42:13 +02:00
<property name= "java.target.version" value= "1.5" />
2007-04-27 19:26:57 +02:00
<property name= "freecol.name" value= "freecol" />
<property environment= "env" />
<property name= "freecol.data.dir" value= "${basedir}/data" />
<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" />
2007-05-15 16:50:58 +02:00
<property name= "test" value= "AllTests" />
2007-04-27 19:26:57 +02:00
2008-01-22 07:44:00 +01:00
<path id= "libraries.classpath" >
<!-- StAX xml parser -->
<pathelement location= "${basedir}/jars/jsr173_1.0_api.jar" />
<!-- Woodstox XML processor -->
<pathelement location= "${basedir}/jars/wstx-lgpl-4.0pr1.jar" />
2009-01-27 17:20:27 +01:00
<!-- MigLayout manager -->
2009-03-07 13:18:32 +01:00
<pathelement location= "${basedir}/jars/miglayout-3.7-swing.jar" />
2009-04-05 14:14:26 +02:00
<!-- Command line processor -->
2009-03-10 18:10:19 +01:00
<pathelement location= "${basedir}/jars/commons-cli-1.1.jar" />
2009-04-04 11:43:00 +02:00
<!-- Cortado Video Applet -->
<pathelement location= "${basedir}/jars/cortado-fc-1.0.jar" />
2007-04-27 19:26:57 +02: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}"
2010-03-12 16:51:35 +01:00
includeantruntime="false"
2007-04-27 19:26:57 +02:00
/>
</target>
2007-05-12 11:01:48 +02:00
<target name= "reencode_messages" description= "Reencodes the message files and outputs them to data/strings" >
2007-05-07 19:06:34 +02:00
<native2ascii src= "${freecol.src.dir}/net/sf/freecol/client/gui/i18n" dest= "${freecol.data.dir}/strings"
2007-04-27 19:26:57 +02:00
encoding="UTF-8"
2007-05-08 16:58:06 +02:00
includes="*.properties"
2008-06-19 13:02:19 +02:00
excludes=""/>
2007-05-07 19:06:34 +02:00
<native2ascii src= "${freecol.src.dir}/net/sf/freecol/client/gui/i18n" dest= "${freecol.data.dir}/strings"
2007-04-27 19:26:57 +02:00
encoding="ISO-8859-1"
2008-06-19 13:02:19 +02:00
includes=""/>
2007-04-27 19:26:57 +02:00
</target>
2007-05-12 11:01:48 +02:00
<target name= "build" depends= "init,compile,reencode_messages" description= "Compiles the source files." >
2007-11-11 12:16:49 +01:00
<copy todir= "${freecol.build.dir}" >
2007-09-24 21:15:32 +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>
2007-11-11 12:16:49 +01:00
<target name= "manifest" description= "Creates the Manifest file." >
2008-06-18 16:51:29 +02:00
<exec executable= "svn" failifexecutionfails= "false"
output="${basedir}/build/svn.properties">
2007-11-11 12:16:49 +01:00
<arg value= "info" />
2008-04-14 17:17:48 +02:00
<arg value= "." />
2007-11-11 12:16:49 +01:00
</exec>
<property prefix= "svn" file= "build/svn.properties" />
<manifest file= "${basedir}/src/MANIFEST.MF" >
<attribute name= "Created-By" value= "FreeCol Team" />
<attribute name= "Main-Class" value= "net.sf.freecol.FreeCol" />
2009-04-05 14:14:26 +02:00
<attribute name= "Class-Path" value= "jars/jsr173_1.0_api.jar jars/wstx-lgpl-4.0pr1.jar jars/jogg-0.0.7.jar jars/jorbis-0.0.15.jar jars/tritonus_share.jar jars/vorbisspi1.0.3.jar jars/miglayout-3.7-swing.jar jars/commons-cli-1.1.jar jars/cortado-fc-1.0.jar" />
2007-11-11 12:16:49 +01:00
<attribute name= "Revision" value= "${svn.Revision}" />
</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.
-->
<target name= "dist" description= "Creates archives and installers for distribution."
depends="init,initDist,tarJavaBundle,zipJavaBundle,tarSourceBundle,zipSourceBundle,javaInstallerBundle,winInstallerBundle,tarMacJavaBundle">
<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>
<target name= "setReleaseVersion" unless= "freecol.version" >
2007-08-19 09:13:23 +02:00
<input message= "Please specify the release version (default: svn-${DSTAMP}): " addproperty= "freecol.version" defaultvalue= "svn-${DSTAMP}" />
2007-04-27 19:26:57 +02:00
<property name= "freecol.release.name" value= "${freecol.name}-${freecol.version}" />
<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>
<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>
<target name= "prepareBaseFiles" depends= "initDist" >
<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" />
<fileset dir= "${freecol.packaging.dir}/common" includes= "freecol" />
<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>
</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= "tarJavaBundle" unless= "skip.dist.java" depends= "initDist,prepareManual,prepareBaseFiles" >
<tar destfile= "${freecol.release.dir}/${freecol.release.name}.tar.gz" compression= "gzip" >
<tarfileset dir= "${freecol.release.dir}/base" includes= "${freecol.name}/**" />
<tarfileset dir= "${freecol.release.dir}/manual" includes= "${freecol.name}/**" />
</tar>
</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= "tarSourceBundle" unless= "skip.dist.source" depends= "initDist,prepareSourceFiles" >
<tar destfile= "${freecol.release.dir}/${freecol.release.name}-src.tar.gz" compression= "gzip" >
<tarfileset dir= "${freecol.release.dir}/base" includes= "${freecol.name}/**" />
<tarfileset dir= "${freecol.release.dir}/source" includes= "${freecol.name}/**" />
</tar>
</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>
2008-11-24 22:40:27 +01:00
<target name= "executeIzpack" >
<condition property= "beginExtraPacks" value= "" else= "<!--" >
<istrue value= "${includeExtraPacks}" />
</condition>
<condition property= "endExtraPacks" value= "" else= "-->" >
<istrue value= "${includeExtraPacks}" />
</condition>
<condition property= "sourcesIncluded" value= "-with-sources" else= "" >
<istrue value= "${includeExtraPacks}" />
</condition>
<izpack output= "${freecol.release.dir}/${freecol.release.name}-installer${sourcesIncluded}.jar"
2007-04-27 19:26:57 +02:00
installerType="standard"
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>
<javaversion > 1.5</javaversion>
</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" />
<langpack iso3= "eus" />
2007-04-27 19:26:57 +02:00
<langpack iso3= "fin" />
<langpack iso3= "fra" />
2010-06-23 08:05:04 +02: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" />
2010-06-23 08:05:04 +02:00
<langpack iso3= "prt" />
<!-- <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>
2008-11-24 22:40:27 +01:00
@{beginExtraPacks}
2007-07-06 14:06:54 +02:00
<pack id= "SourceCode" name= "Source Code" required= "no" preselected= "no" >
<description > The source code used for building this distribution. These files are intended for developers and give no extra functionality to normal users.</description>
2007-04-27 19:26:57 +02:00
<fileset dir= "source/@{freecol.name}" targetdir= "$INSTALL_PATH" />
</pack>
2008-11-24 22:40:27 +01:00
@{endExtraPacks}
2007-04-27 19:26:57 +02:00
</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" />
<antcall target= "executeIzpack" >
<param name= "includeExtraPacks" value= "true" />
</antcall>
</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>
<replace file= "${freecol.release.dir}/installer.jsmooth"
token="%ant:freecol.release.name%"
value="${freecol.release.name}"
/>
<replace file= "${freecol.release.dir}/installer.jsmooth"
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/ -->
<taskdef name= "jarbundler"
classname="net.sourceforge.jarbundler.JarBundler"
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"
icon="${freecol.packaging.dir}/icons/FreeCol.icns">
<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" >
<tarfileset dir= "${freecol.release.dir}" mode= "755"
includes="FreeCol.app/Contents/MacOS/FreeCol"
excludes="**/freecol*"
followsymlinks="false"
/>
<tarfileset followsymlinks= "false" dir= "${freecol.release.dir}" >
<include name= "FreeCol.app/**" />
<exclude name= "**/freecol*" />
<exclude name= "FreeCol.app/Contents/MacOS/FreeCol" />
</tarfileset>
</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" >
<fileset dir= "${freecol.build.dir}" includes= "net/**" />
<fileset dir= "${freecol.build.dir}" includes= "timestamp.inf" />
2007-05-15 16:04:58 +02:00
<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" />
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.
if you have Ant 1.7, the junit.jar can exist on the classpath.
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" >
2008-01-22 07:44:00 +01:00
<classpath refid= "test.run.classpath" />
2007-05-15 16:50:58 +02:00
<formatter type= "brief" usefile= "false" />
<formatter type= "plain" />
<test todir= "${freecol.build.dir}" name= "net.sf.freecol.${test}" />
2008-07-03 07:53:27 +02:00
<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">
<delete dir= "${freecol.build.dir}/report" />
<mkdir dir= "${freecol.build.dir}/report" />
<mkdir dir= "${freecol.build.dir}/report/xml" />
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.
if you have Ant 1.7, the junit.jar can exist on the classpath.
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
-->
2009-09-06 12:54:39 +02:00
<junit printsummary= "on" errorproperty= "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" />
2007-09-24 21:15:32 +02:00
2007-09-26 21:56:20 +02:00
<test todir= "${freecol.build.dir}/report/xml" name= "net.sf.freecol.AllTests" fork= "yes" />
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>
2007-09-24 21:15:32 +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" />
<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-03-12 16:51:35 +01:00
source="${java.target.version}" target="${java.target.version}"
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"
file="data/freecol/specification.xml">
</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"
2009-01-31 12:02:03 +01:00
file="data/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"
2009-01-31 12:02:03 +01:00
file="data/testing/specification.xml">
2008-11-29 10:47:44 +01:00
</schemavalidate>
2008-10-05 12:13:06 +02:00
</target>
2007-04-27 19:26:57 +02:00
<target name= "print-manual"
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>
</target>
<target name= "online-manual"
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>
</target>
<target name= "manual" depends= "print-manual,online-manual"
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
logging. -->
<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/" >
<arg value= "src/net/sf/freecol/client/gui/i18n/" />
<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. -->
<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/" >
<arg value= "../../trunk/src/net/sf/freecol/client/gui/i18n/" />
<arg value= "src/net/sf/freecol/client/gui/i18n/" />
<arg value= "${localeKey}" />
</java>
</target>
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>
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>
<ruleset > optimizations</ruleset>
<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" />
<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>
<delete dir= "${freecol.build.dir}/report" />
<mkdir dir= "${freecol.build.dir}/report" />
<mkdir dir= "${freecol.build.dir}/report/xml" />
<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" />
<test todir= "${freecol.build.dir}/report/xml" name= "net.sf.freecol.AllTests" fork= "yes" />
<sysproperty key= "java.awt.headless" value= "true" />
</junit>
<cobertura-report srcdir= "${freecol.src.dir}" destdir= "cobertura/report" />
</target>
2007-04-19 18:29:34 +02:00
</project>