2002-04-25 08:05:09 -04:00
<!-- =================================================================== -->
<!-- Prepares the source code -->
<!-- =================================================================== -->
<target name="-prepare-src">
<mkdir dir="${xlayout.build.java.dir}"/>
<mkdir dir="${xlayout.build.classes.dir}"/>
<copy todir="${xlayout.build.java.dir}" filtering="off">
<fileset dir="${xlayout.source.java.dir}"/>
</copy>
<mkdir dir="${xlayout.build.scratchpad.java.dir}"/>
<mkdir dir="${xlayout.build.scratchpad.classes.dir}"/>
<copy todir="${xlayout.build.scratchpad.java.dir}" filtering="off">
<fileset dir="${xlayout.source.scratchpad.java.dir}"/>
</copy>
<mkdir dir="${xlayout.build.examples.java.dir}"/>
<mkdir dir="${xlayout.build.examples.classes.dir}"/>
<copy todir="${xlayout.build.examples.java.dir}" filtering="off">
<fileset dir="${xlayout.source.examples.java.dir}"/>
</copy>
<mkdir dir="${xlayout.build.contributions.java.dir}"/>
<mkdir dir="${xlayout.build.contributions.classes.dir}"/>
<copy todir="${xlayout.build.contributions.java.dir}" filtering="off">
<fileset dir="${xlayout.source.contributions.java.dir}"/>
</copy>
</target>
2002-04-24 12:22:03 -04:00
<target name="-init" unless="${antipede.init.already.called}">
2002-04-03 12:51:49 -05:00
<tstamp>
<format property="YEAR" pattern="yyyy" locale="en"/>
</tstamp>
<buildnumber/>
2002-04-24 12:22:03 -04:00
<property name="antipede.init.already.called" value="true"/>
2002-04-11 13:49:25 -04:00
<echo>
--------------------------------------------------------------
2002-04-03 12:51:49 -05:00
2002-04-11 13:49:25 -04:00
Using ${ant.version}
Build file ${ant.file}
Build number ${build.number}
Project Name ${ant.project.name}
Java Version ${ant.java.version}
Timestamp ${DSTAMP}${TSTAMP}
--------------------------------------------------------------
</echo>
2002-04-03 12:51:49 -05:00
<!--
The location of tools.jar, relative to the JAVA_HOME home.
If tools.jar is not present, exit with an error, since it
means that a JDK is not installed.
-->
<property name="tools.jar" value="${java.home}/../lib/tools.jar"/>
<available file="${tools.jar}" property="tools.jar.present"/>
2002-04-24 12:22:03 -04:00
<fail unless="tools.jar.present" message="tools.jar not found. Probably you are using the JRE and the JDK is not installed. Please download the JDK from the Java Sun website www.javasoft.com ."/>
2002-04-03 12:51:49 -05:00
2002-04-22 07:00:18 -04:00
<!-- fixed centipede dirs -->
2002-04-03 12:51:49 -05:00
<property name="tools.dir" value="tools"/>
2002-04-22 07:00:18 -04:00
2002-04-03 12:51:49 -05:00
<property name="temp.dir" value="tools/tmp"/>
2002-04-22 07:00:18 -04:00
<mkdir dir="${temp.dir}"/>
2002-04-03 12:51:49 -05:00
<property name="cents.dir" value="tools/cents"/>
2002-04-22 07:00:18 -04:00
<mkdir dir="${cents.dir}"/>
2002-04-03 12:51:49 -05:00
<property name="antipede.dir" value="tools/antipede"/>
<property name="antipede.lib.dir" value="tools/antipede/lib"/>
2002-04-22 07:00:18 -04:00
2002-04-03 12:51:49 -05:00
<property name="cent.lib.dir.name" value="lib"/>
<property name="task.properties.name" value="tasks.properties"/>
<property name="cent.jar.suffix" value="cent.jar"/>
<property name="cent.dir.suffix" value="cent"/>
2002-04-22 07:00:18 -04:00
2002-04-03 12:51:49 -05:00
<!-- define all ant tasks in antipede -->
<taskdef file="${antipede.dir}/${task.properties.name}">
<classpath>
<path>
<fileset dir="${antipede.lib.dir}" casesensitive="yes">
<include name="*.jar"/>
<include name="*.zip"/>
</fileset>
</path>
</classpath>
</taskdef>
2002-04-16 12:49:38 -04:00
<!--
Load project information
-->
2002-04-22 07:00:18 -04:00
<xmlproperty file="module.xml" prefix="xgump" keeproot="true" collapseAttributes="true" />
<xmlproperty file="status.xml" prefix="xstatus" keeproot="false" collapseAttributes="true" />
<xmlproperty file="layout.xml" prefix="xlayout" keeproot="false" collapseAttributes="true" />
<xmlproperty file="properties.xml" keeproot="false" collapseAttributes="true" />
2002-04-16 12:49:38 -04:00
2002-04-22 07:00:18 -04:00
<antcall target="get-needed-cents"/>
2002-04-08 13:32:31 -04:00
2002-04-03 12:51:49 -05:00
<delete file="${temp.dir}/${task.properties.name}"/>
2002-04-08 13:32:31 -04:00
2002-04-03 12:51:49 -05:00
<!-- put all ant task definitions in cents in a single file -->
2002-04-08 13:32:31 -04:00
<antipede-trycatch><try>
2002-04-03 12:51:49 -05:00
<concat destfile="${temp.dir}/${task.properties.name}" append="no">
<fileset dir=".">
<patternset>
<include name="${cents.dir}/*.${cent.dir.suffix}/${task.properties.name}"/>
</patternset>
</fileset>
</concat>
2002-04-08 13:32:31 -04:00
2002-04-03 12:51:49 -05:00
<!-- define the tasks found in cents -->
<taskdef file="${temp.dir}/${task.properties.name}">
2002-04-06 04:35:38 -05:00
<classpath>
2002-04-06 12:43:02 -05:00
<fileset dir="./tools">
2002-04-06 04:35:38 -05:00
<include name="**/*.jar"/>
</fileset>
2002-04-03 12:51:49 -05:00
</classpath>
</taskdef>
2002-04-08 13:32:31 -04:00
</try>
<catch><echo message="Unable to load tasks... could be already loaded." /></catch>
</antipede-trycatch>
2002-04-25 08:05:09 -04:00
<antcall target="-prepare-src"/>
2002-04-03 12:51:49 -05:00
</target>
2002-04-22 07:00:18 -04:00
<!-- ================================ -->
<!-- Used only by the -init target -->
<!-- =================================-->
<target name="get-needed-cents">
<style basedir="."
destdir="${temp.dir}"
includes="properties.xml"
extension=".build.xml"
style="${antipede.dir}/resources/stylesheets/getcent.xsl"/>
<ant antfile="${temp.dir}/properties.build.xml"
inheritall="true"
dir="."
target="getcents" />
<style basedir="."
destdir="${temp.dir}"
includes="module.xml"
extension=".build.xml"
style="${antipede.dir}/resources/stylesheets/getcorelibs.xsl"/>
<!--
<ant antfile="${temp.dir}/module.build.xml"
inheritall="true"
dir="."
target="getcorelibs" />
-->
<!-- Unpack jarred cents -->
<antipede-foreach target="-cent-unjar" param="current.cent.jar">
<fileset dir="." casesensitive="yes">
<patternset>
<include name="${cents.dir}/*.${cent.jar.suffix}"/>
</patternset>
</fileset>
</antipede-foreach>
<delete dir="${cents.dir}/META-INF"/>
</target>
2002-04-03 12:51:49 -05:00
<!-- ================================ -->
<!-- Used only by the -init target -->
<!-- =================================-->
2002-04-08 13:32:31 -04:00
<target name="-cent-unjar" depends="-cent-unjar-expand,-cent-unjar-keep"/>
<!-- ================================ -->
<!-- Used only by the -init target -->
<!-- =================================-->
<target name="-cent-unjar-check">
2002-04-08 03:21:16 -04:00
2002-12-17 11:46:26 -05:00
<basename property="current.cent.jar.name" file="${current.cent.jar}" suffix=".cent.jar"/>
2002-04-08 03:21:16 -04:00
<condition property="cent-unjar.not.required">
<and>
2002-04-09 13:02:20 -04:00
<uptodate targetfile="${cents.dir}/${current.cent.jar.name}.${cent.dir.suffix}/${task.properties.name}"
srcfile="${current.cent.jar}"/>
<available type="file" file="${cents.dir}/${current.cent.jar.name}.${cent.dir.suffix}/${task.properties.name}"/>
2002-04-08 03:21:16 -04:00
</and>
</condition>
2002-04-08 13:32:31 -04:00
</target>
<!-- ====================================== -->
<!-- Used only by the -cent-unjar target -->
<!-- ====================================== -->
<target name="-cent-unjar-expand" unless="cent-unjar.not.required"
depends="-cent-unjar-check">
2002-04-08 03:21:16 -04:00
<echo message="Expanding ${current.cent.jar}..." />
<unjar src="${current.cent.jar}" dest="${cents.dir}"/>
2002-04-09 13:02:20 -04:00
<touch>
<fileset dir="${cents.dir}/${current.cent.jar.name}.${cent.dir.suffix}"/>
</touch>
2002-04-08 03:21:16 -04:00
<echo message="... ${current.cent.jar} expanded in ${current.cent.jar.name}." />
2002-04-08 13:32:31 -04:00
</target>
2002-04-08 03:21:16 -04:00
2002-04-08 13:32:31 -04:00
<!-- ====================================== -->
<!-- Used only by the -cent-unjar target -->
<!-- =======================================-->
<target name="-cent-unjar-keep" if="cent-unjar.not.required"
depends="-cent-unjar-check">
<echo message="${current.cent.jar} is uptodate with respect to ${current.cent.jar.name}." />
<echo message="No need to expand it." />
</target>
2002-04-03 12:51:49 -05:00
<!-- ============================================= -->
<!-- Simple utility target to call a cent target -->
<!-- ==============================================-->
<target name="call-cent">
<ant antfile="tools/cents/${cent-name}.cent/xbuild.xml"
2002-04-22 07:00:18 -04:00
inheritall="true"
2002-04-03 12:51:49 -05:00
dir="."
target="${cent-target}" />
2002-04-18 11:42:37 -04:00
</target>
2002-04-24 12:22:03 -04:00
<!-- ============================================= -->
<!-- Simple utility target to call a cent target -->
<!-- ==============================================-->
<target name="cent-target" depends="-init">
<ant antfile="tools/cents/${cent-name}.cent/xbuild.xml"
inheritall="true"
dir="."
target="${cent-target}" />
</target>
2002-04-22 07:00:18 -04:00
<!-- ================================== -->
2002-04-18 11:42:37 -04:00
<!-- Create a cent.jar package -->
<!-- using an already deployed cent -->
<!-- ================================== -->
2002-04-22 07:00:18 -04:00
<target name="jar-cent" depends="-init">
2002-04-18 11:42:37 -04:00
<antcall target="call-cent">
<param name="cent-name" value="centipede"/>
<param name="cent-target" value="jar-cent"/>
</antcall>
2002-04-22 07:00:18 -04:00
</target>
<!-- ================================== -->
<!-- Create a cent.jar package -->
<!-- using an already deployed cent -->
<!-- ================================== -->
<target name="update-cent">
<centipede-user-input name="cent-name">Please select a cent to update: </centipede-user-input>
<delete file="${cents.dir}/${cent-name}.${cent.jar.suffix}"/>
<delete dir="${cents.dir}/${cent-name}.${cent.dir.suffix}"/>
<antcall target="get-needed-cents"/>
</target>
<!-- ================================== -->
<!-- Create a cent.jar package -->
<!-- using an already deployed cent -->
<!-- ================================== -->
<target name="update-all-cents">
<property name="yn" value="n"/>
<centipede-user-input name="yn">This will delete and download all cents. Are you sure? [y/n]: </centipede-user-input>
<condition property="stopit">
<not>
<equals arg1="${yn}" arg2="y"/>
</not>
</condition>
<fail if="stopit"/>
<delete dir="${cents.dir}"/>
<mkdir dir="${cents.dir}"/>
<antcall target="get-needed-cents"/>
</target>
<!-- ================================== -->
<!-- Create a cent.jar package -->
<!-- using an already deployed cent -->
<!-- ================================== -->
<target name="create-dtd" depends="-init">
<antstructure output="${xlayout.build.dir}/build.dtd"/>
2002-12-17 11:46:26 -05:00
</target>