Rev 227 | Blame | Compare with Previous | Last modification | View Log | RSS feed
<project name="PACKAGE" default="make_package" basedir="."><!--Import files that specify versions of this and other packages--><import file="auto.xml" optional="true"/> <!-- Created by the ABT --><import file="${ant.project.name}depends.xml"/> <!-- Non ABT use --><!--Common properties using within the build--><description>Example of Building with ant</description><property name="env" environment="env" value="not used"/><property name="src.dir" value="${basedir}/src"/><property name="build.dir" value="${basedir}/build"/><property name="classes.dir" value="${build.dir}/classes"/><property name="jar.dir" value="${build.dir}/jar"/><property name="pkg.dir" value="${build.dir}/pkg"/><!--Provide access to components in dependent packagesThe package versions are specified as properties in the'depends' file and are used here by the 'using' task.--><import file="${env.GBE_DPKG}/ant-using/${ant-using}/ant-using.xml"/><usingall/><!--B U I L DThis target is required by the Automated Build EnvironmentThe target should setup the 'sandbox'In many cases this will be empty--><target name="build"depends=""description="Setup build sandbox"></target><!--M A K E _ P A C K A G EThis target is required by the Automated Build EnvironmentIt should:1) Compile / Build stuff2) Package up the build artefacts that are being exported3) Create the 'descpkg' fileIn this example the process is broken into three other targets forthe purpose of illustrating the steps.--><target name="make_package"depends="clean,compile,package"></target><!--R U N _ T E S T SThis target is optional in the Automated Build EnvironmentIf the Release Manager entry advertises that the package has unittests, then this target must existIt should run automated unit tests which conform to the Unit TestAutomation PaperIt does not have to be dependent on the build process as this willalready have been performed.--><target name="run_tests"depends="test_1"description="Run automated unit tests"></target><!-- End of Mandatory Target ======================================= --><!-- The following targets are used by the mandatory targets --><target name="compile"depends="" description="Compile stuff"><mkdir dir="${classes.dir}"/><javac srcdir="${src.dir}" destdir="${classes.dir}"/><mkdir dir="${jar.dir}"/><jar destfile="${jar.dir}/${packagename}.jar"basedir="${classes.dir}"><manifest><attribute name="Main-Class" value="HelloWorld"/></manifest></jar></target><!--Create the package imageThis must be in the directory ${basedir}/build/pkg, as otherbuild tools will assume that directory as the location ofthe package.Note: The structure of the package is not free-form.Jar files should go into a 'jar' subdirectoryNo files should be places in the package root directory--><target name="package"depends=""description="Package build artifacts"><mkdir dir="${pkg.dir}/jar"/><copy todir="${pkg.dir}/jar"><fileset dir="${jar.dir}" includes="**/*"/></copy><summarise-manifest/></target><!--- This target executes all unit tests in MyPackageTestSuite- It depends on the junit framework.- Further details regarding how to unit test under ANT are- present in the ANT manual--><target name = "test_1"><junit printsummary="yes" fork="yes" haltonfailure="no"><classpath><pathelement location="${build.dir}/classes" /></classpath><formatter type="xml"/><test name="com.vixtechnology.MyPackage.tests.MyPackageTestSuite"/></junit></target></project>