From: Stian G. <sti...@us...> - 2006-09-22 13:35:36
|
Update of /cvsroot/freecol/freecol In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv403 Modified Files: build.xml Log Message: The ant-target "dist" now creates all the files we need for a release. The installer is also created as a part of this ant-target (specification files have been put in the "build" directory. Added descriptions for the main ant-targets so that "ant -p" can be used to create a list of available targets. Index: build.xml =================================================================== RCS file: /cvsroot/freecol/freecol/build.xml,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** build.xml 18 Sep 2006 14:30:44 -0000 1.21 --- build.xml 22 Sep 2006 13:35:03 -0000 1.22 *************** *** 4,8 **** <property name="freecol.name" value="freecol"/> ! <property name="freecol.version" value="0.5.1"/> <property environment="env"/> --- 4,8 ---- <property name="freecol.name" value="freecol"/> ! <property name="freecol.version" value="0.5.1_cvs"/> <property environment="env"/> *************** *** 12,24 **** <property name="freecol.build.dir" value="${basedir}/build"/> <property name="freecol.packaging.dir" value="${basedir}/packaging"/> ! <property name="freecol.release.dir" value="${basedir}/release"/> ! <property name="freecol.javadoc.dir" value="${basedir}/javadoc"/> <property name="freecol.jar.file" value="${basedir}/FreeCol.jar"/> <property name="freecol.overview.file" value="${freecol.src.dir}/overview.html"/> - <path id="test.class.path"> <fileset dir="test/lib" includes="*.jar" /> </path> <target name="init" unless="TSTAMP"> --- 12,35 ---- <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.javadoc.dir" value="${basedir}/doc/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"/> <path id="test.class.path"> <fileset dir="test/lib" includes="*.jar" /> </path> + + + <!-- TASK DEFINITIONS --> + <taskdef name="jsmoothgen" + classname="net.charabia.jsmoothgen.ant.JSmoothGen" + classpath="${freecol.build.dir}/jars/jsmoothgen-ant.jar" + /> + <taskdef name="izpack" + classname="com.izforge.izpack.ant.IzPackTask" + classpath="${freecol.build.dir}/jars/standalone-compiler.jar" + /> <target name="init" unless="TSTAMP"> *************** *** 26,31 **** --- 37,49 ---- </target> + + <!-- Compiles the java source files and updates the version numbers. --> <target name="compile" depends="init"> <mkdir dir="${freecol.build.dir}"/> + + <replaceregexp file="${freecol.src.dir}/net/sf/freecol/FreeCol.java" + match="FREECOL_VERSION\s*=\s*"(.*?)"\;" + replace="FREECOL_VERSION = "${freecol.version}"\;" + /> <javac srcdir="${freecol.src.dir}" destdir="${freecol.build.dir}" *************** *** 35,41 **** deprecation="off" source="1.4" ! /> </target> <target name="compile-test" depends="init"> <mkdir dir="${freecol.build.dir}"/> --- 53,60 ---- deprecation="off" source="1.4" ! /> </target> + <target name="compile-test" depends="init"> <mkdir dir="${freecol.build.dir}"/> *************** *** 50,95 **** </target> ! <target name="copy-sound-files" depends="init" unless="nosound"> ! <copy todir="${freecol.build.dir}/net/sf/freecol/data/audio"> ! <fileset dir="${freecol.data.dir}/audio"> ! <exclude name="**/CVS/**"/> ! </fileset> ! </copy> ! </target> ! ! <target name="copy-jar-files" depends="init" unless="nojars"> ! <mkdir dir="${freecol.build.dir}/jars"/> ! <copy todir="${freecol.build.dir}/jars"> ! <fileset dir="${basedir}/jars"> ! <exclude name="**/CVS/**"/> ! </fileset> ! </copy> ! </target> ! ! <target name="copy-data-files" depends="init" unless="nodata"> ! <!-- Copy the image files --> ! <copy todir="${freecol.build.dir}/net/sf/freecol/data/images"> ! <fileset dir="${freecol.data.dir}/images"> ! <exclude name="**/CVS/**"/> ! </fileset> ! </copy> ! ! <copy todir="${freecol.build.dir}/net/sf/freecol/data/fonts"> ! <fileset dir="${freecol.data.dir}/fonts"> ! <exclude name="**/CVS/**"/> ! </fileset> ! </copy> ! ! <!-- Copy the sound files unless the "nosound" property has been defined --> ! <antcall target="copy-sound-files"/> ! </target> ! ! <target name="build" depends="init,compile"> ! <!-- Copy the data files unless the "nodata" property has been defined --> ! <antcall target="copy-data-files"/> ! ! <!-- Copy the jar files unless the "nojars" property has been defined --> ! <antcall target="copy-jar-files"/> ! <copy todir="${freecol.build.dir}"> <fileset dir="${freecol.src.dir}" includes="**/*.xml" /> --- 69,74 ---- </target> ! ! <target name="build" depends="init,compile" description="Compiles the source files."> <copy todir="${freecol.build.dir}"> <fileset dir="${freecol.src.dir}" includes="**/*.xml" /> *************** *** 102,127 **** </target> ! <target name="package" depends="init,build"> <jar jarfile="${freecol.jar.file}" basedir="${freecol.build.dir}" manifest="${basedir}/src/MANIFEST.MF" excludes="**/CVS/**, **/metaserver/**" /> </target> ! <target name="fullpackage" depends="init,build"> ! <jar jarfile="${freecol.jar.file}" basedir="${freecol.build.dir}" manifest="${basedir}/src/MANIFEST.MF" excludes="**/CVS/**" /> </target> ! <target name="release" depends="clean"> ! <property name="nodata" value="true"/> ! <property name="nosound" value="true"/> ! <property name="nojars" value="true"/> ! <antcall target="package"/> ! <mkdir dir="${freecol.release.dir}"/> <mkdir dir="${freecol.release.dir}/${freecol.name}"/> --- 81,112 ---- </target> ! ! <!-- Compiles the source files and creates a JAR-file. --> ! <target name="package" depends="init,build" description="Compiles the source files and creates a JAR-file."> <jar jarfile="${freecol.jar.file}" basedir="${freecol.build.dir}" manifest="${basedir}/src/MANIFEST.MF" + includes="net/**, org/**" excludes="**/CVS/**, **/metaserver/**" /> </target> ! ! <!-- Compiles the metaserver and creates a JAR-file. --> ! <target name="metaserver" depends="init,build" description="Compiles the metaserver and creates a JAR-file."> ! <jar jarfile="${freecol.metaserver.jar.file}" basedir="${freecol.build.dir}" manifest="${basedir}/src/MANIFEST.MF" + includes="net/**, org/**" excludes="**/CVS/**" /> </target> ! ! <!-- ! Creates archives and installers for distribution and places these in the ! "dist" directory. ! --> ! <target name="dist" depends="clean, package" description="Creates archives and installers for distribution."> <mkdir dir="${freecol.release.dir}"/> <mkdir dir="${freecol.release.dir}/${freecol.name}"/> *************** *** 130,135 **** <fileset dir="${basedir}" includes="FreeCol.jar"/> <fileset dir="${freecol.packaging.dir}/common" excludes="**/CVS/**"/> ! <fileset dir="${basedir}" includes="**/data/**" excludes="**/CVS/**"/> ! <fileset dir="${basedir}" includes="**/jars/**" excludes="/CVS/**"/> </copy> --- 115,120 ---- <fileset dir="${basedir}" includes="FreeCol.jar"/> <fileset dir="${freecol.packaging.dir}/common" excludes="**/CVS/**"/> ! <fileset dir="${basedir}" includes="data/**" excludes="**/CVS/**"/> ! <fileset dir="${basedir}" includes="jars/**" excludes="**/CVS/**"/> </copy> *************** *** 152,160 **** <tarfileset dir="${freecol.release.dir}" includes="${freecol.name}/**"/> </tar> <delete quiet="true" dir="${freecol.release.dir}/${freecol.name}"/> </target> ! ! <target name="clean" depends="init"> <delete quiet="true" includeEmptyDirs="true"> <fileset dir="${freecol.build.dir}" includes="net/**" /> --- 137,193 ---- <tarfileset dir="${freecol.release.dir}" includes="${freecol.name}/**"/> </tar> + + <copy tofile="${freecol.build.dir}/installer-tmp.xml"> + <fileset file="${freecol.build.dir}/installer.xml" /> + </copy> + <replace file="${freecol.build.dir}/installer-tmp.xml" + token="%ant:freecol.version%" + value="${freecol.version}" + /> + <jsmoothgen project="${freecol.build.dir}/startup.jsmooth" skeletonroot="${freecol.build.dir}/skeletons"/> + <move todir="${freecol.release.dir}/${freecol.name}"> + <fileset dir="${freecol.build.dir}" includes="freecol.exe"/> + </move> + + <mkdir dir="${freecol.release.dir}/${freecol.name}/Uninstaller"/> + <jsmoothgen project="${freecol.build.dir}/uninstaller.jsmooth" skeletonroot="${freecol.build.dir}/skeletons"/> + <move todir="${freecol.release.dir}/${freecol.name}/Uninstaller"> + <fileset dir="${freecol.build.dir}" includes="uninstaller.exe"/> + </move> + + <izpack input="${freecol.build.dir}/installer-tmp.xml" + output="${freecol.release.dir}/${freecol.release.name}-installer.jar" installerType="standard" + basedir="${freecol.release.dir}/${freecol.name}" + izpackdir="${freecol.build.dir}" + /> + <delete quiet="true" file="${freecol.build.dir}/installer-tmp.xml"/> + + <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"/> + <delete quiet="true" dir="${freecol.release.dir}/${freecol.name}"/> + <delete quiet="true" file="${freecol.release.dir}/installer.jsmooth"/> + + <echo message="" /> + <echo message="-------------------------------------------------"/> + <echo message="Distribution files created:"/> + <echo message="${freecol.release.dir}"/> + <echo message="-------------------------------------------------"/> </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/**" /> *************** *** 164,168 **** <delete quiet="true" file="${freecol.jar.file}"/> <delete quiet="true" dir="${freecol.javadoc.dir}"/> - <delete quiet="true" dir="${freecol.build.dir}"/> </target> --- 197,200 ---- *************** *** 178,182 **** </target> ! <target name="javadoc" depends="init"> <mkdir dir="${freecol.javadoc.dir}"/> <javadoc sourcepath="${freecol.src.dir}" --- 210,216 ---- </target> ! ! <!-- Generate JavaDoc documentation. --> ! <target name="javadoc" depends="init" description="Generate JavaDoc documentation."> <mkdir dir="${freecol.javadoc.dir}"/> <javadoc sourcepath="${freecol.src.dir}" *************** *** 188,191 **** --- 222,230 ---- Windowtitle="FreeCol Code Documentation" /> + <echo message="" /> + <echo message="-------------------------------------------------"/> + <echo message="JavaDoc-generated documentation created:"/> + <echo message="${freecol.javadoc.dir}"/> + <echo message="-------------------------------------------------"/> </target> *************** *** 195,199 **** --> <target name="test" depends="build, build-unit-tests" ! description="runs a particular unit test" > <echo message="if the next task fails then please read the build script" /> --- 234,238 ---- --> <target name="test" depends="build, build-unit-tests" ! description="Runs a particular unit test" > <echo message="if the next task fails then please read the build script" /> *************** *** 220,224 **** <target name="testall" depends="build-unit-tests" ! description="runs all unit tests" > <echo message="if the next task fails then please read the build script" /> --- 259,263 ---- <target name="testall" depends="build-unit-tests" ! description="Runs all unit tests" > <echo message="if the next task fails then please read the build script" /> *************** *** 275,280 **** <target name="manual" depends="print-manual,online-manual"> </target> - - - </project> --- 314,316 ---- |