Every module must provide a local.build.xml file, which connects the individual module into the larger Hackystat build system. Chapter 13, Anatomy of the Hackystat build system provides an overview of the Hackystat build system in general and Section 13.8, “The local.build.xml file” describes the contents of the local.build.xml file. The current section will assume that material as background, and focus on those aspects of the SimpleSdt local.build.xml file that are specific to SDT definition.
Example 15.10, “The local.build.xml file for SimpleSdt” illustrates the contents of the hackyDoc_SimpleSdt local.build.xml file.
Example 15.10. The local.build.xml file for SimpleSdt
<project name="hackyDoc_SimpleSdt.local" default="hackyDoc_SimpleSdt.default">
<description>
Provides documentation code and packaging for the New Module chapter in the developer guide.
</description>
<dirname property="hackyDoc_SimpleSdt.local.basedir" file="${ant.file.hackyDoc_SimpleSdt.local}"/>
<property name="hackyDoc_SimpleSdt.src.dir" location="${hackyDoc_SimpleSdt.local.basedir}/src"/>
<property name="hackyDoc_SimpleSdt.required.modules" value="hackyCore_Kernel"/>
<path id="hackyDoc_SimpleSdt.classpath">
<pathelement location="${tomcat.servlet.jar}"/>
<fileset dir="${install.war.web-inf.lib.dir}">
<include name="*.jar"/>
</fileset>
</path>
<target name="hackyDoc_SimpleSdt.compile" if="hackyDoc_SimpleSdt.available"
description="Compiles changed classes to WEB-INF/classes directory.">
<hackyCore_Build.javac srcdir="${hackyDoc_SimpleSdt.src.dir}">
<classpath refid="hackyDoc_SimpleSdt.classpath"/>
</hackyCore_Build.javac>
</target>
<target name="hackyDoc_SimpleSdt.install.pre-sensorshell" if="hackyDoc_SimpleSdt.available"
description="Install hackyDoc_SimpleSdt code and files into web application.">
<makeUpdateWebAppContent module.src.dir="${hackyDoc_SimpleSdt.src.dir}"/>
<!-- Copy the test data to the installation test data directory. -->
<copy todir="${install.testdataset.dir}" preservelastmodified="true">
<fileset dir="${hackyDoc_SimpleSdt.src.dir}/org/hackystat/doc/simplesdt/testdataset" />
</copy>
</target>
<target name="hackyDoc_SimpleSdt.junit" if="hackyDoc_SimpleSdt.available" description="Runs JUnit.">
<makeJUnit module.name="hackyDoc_SimpleSdt" module.package.prefix="org.hackystat.doc.simplesdt"/>
<makeEcho message="Completed hackyDoc_SimpleSdt.junit." prefix="hackyDoc_SimpleSdt.junit"/>
</target>
<target name="hackyDoc_SimpleSdt.default" description="Does nothing. Required by Ant."/>
</project>
The only target in this local.build.xml file that contains SDT-specific code is hackyDoc_SimpleSdt.install.pre-sensorshell. The <makeUpdateWebAppContent> macro automates the process of copying SDT-specific code, such as the SDT XML file definitions, to the appropriate places in the build directory for inclusion in the client-side SensorShell and server-side web application. The <copy> task in that same target copies the test data to the "testdataset" user in the hackystat data directory.