1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project basedir="." default="dist" name="simple-freeform-project">
<target name="init">
<property file="build.properties"/>
<path id="cp">
<pathelement location="${lib.dir}/lib1.jar"/>
<pathelement location="${lib.dir}/lib2.jar"/>
</path>
<path id="run.cp">
<path refid="cp"/>
<pathelement location="${main.jar}"/>
</path>
</target>
<target name="compile" depends="init">
<mkdir dir="${classes.dir}"/>
<javac srcdir="${src.dir}" destdir="${classes.dir}" source="1.4">
<classpath refid="cp"/>
</javac>
</target>
<target name="compile-some-files" depends="init">
<fail unless="files">Must set property 'files'</fail>
<mkdir dir="${classes.dir}"/>
<javac srcdir="${src.dir}" destdir="${classes.dir}" source="1.4" includes="${files}">
<classpath refid="cp"/>
</javac>
</target>
<target name="jar" depends="init,compile">
<dirname file="${main.jar}" property="main.jar.dir"/>
<mkdir dir="${main.jar.dir}"/>
<jar jarfile="${main.jar}">
<fileset dir="${classes.dir}"/>
</jar>
</target>
<target name="start" depends="jar">
<java classname="org.foo.myapp.MyApp">
<classpath refid="run.cp"/>
</java>
</target>
<target name="start-with-specified-class" depends="jar">
<fail unless="class">Must set property 'class'</fail>
<java classname="${class}">
<classpath refid="run.cp"/>
</java>
</target>
<target name="build-javadoc" depends="init">
<mkdir dir="${javadoc.dir}"/>
<javadoc destdir="${javadoc.dir}" sourcepath="${src.dir}">
<fileset dir="${src.dir}"/>
<classpath refid="cp"/>
</javadoc>
</target>
<target name="ant-compile" depends="init">
<mkdir dir="${ant.classes.dir}"/>
<javac srcdir="${ant.src.dir}" destdir="${ant.classes.dir}" source="1.4">
<classpath>
<pathelement location="${ant.home}/lib/ant.jar"/>
</classpath>
</javac>
</target>
<target name="ant-compile-some-files" depends="init">
<fail unless="files">Must set property 'files'</fail>
<mkdir dir="${ant.classes.dir}"/>
<javac srcdir="${ant.src.dir}" destdir="${ant.classes.dir}" source="1.4" includes="${files}">
<classpath>
<pathelement location="${ant.home}/lib/ant.jar"/>
</classpath>
</javac>
</target>
<target name="ant-def" depends="ant-compile,init">
<taskdef name="special-task" classname="org.foo.ant.SpecialTask">
<classpath>
<pathelement location="${ant.classes.dir}"/>
</classpath>
</taskdef>
</target>
<target name="generate-xdocs" depends="init,ant-def">
<special-task/>
<!-- XXX -->
</target>
<target name="dist" depends="init,jar,build-javadoc,generate-xdocs">
<!-- XXX -->
</target>
<target name="clean" depends="init">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
</target>
</project>
|