File: build.xml

package info (click to toggle)
maven-ant-helper 3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 64 kB
  • ctags: 22
  • sloc: xml: 120; java: 66; makefile: 18
file content (59 lines) | stat: -rw-r--r-- 1,945 bytes parent folder | download | duplicates (5)
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
<?xml version="1.0"?>

<!--
    This build file is used internally to build the maven-ant-helper package. Unlike
    ../maven-build.xml, it is not released as part of the binary package.
-->

<project name="pkg-java" default="package" basedir="..">

    <target name="init">
        <available property="available.resources" file="src/main/resources"/>

        <fail unless="artifactId" message="Missing required property: artifactId"/>
        <fail unless="version" message="Missing required property: version"/>
        <fail unless="basedir" message="Missing required property: basedir"/>

        <echo message="Compile classpath: ${classpath.full.compile}"/>
        <echo message="Test classpath: ${classpath.full.test}"/>
    </target>

    <!--
     | LIFECYCLE: Clean
     |-->

    <target name="clean">
        <delete dir="${build.directory}"/>
    </target>

    <!--
     | LIFECYCLE: jar
     |
     | This mimics the default Maven build life-cycle: http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
     |-->

     <target name="process-resources" depends="init" if="available.resources">
        <mkdir dir="${build.outputDirectory}"/>
        <copy todir="${build.outputDirectory}">
            <fileset dir="src/main/resources"/>
        </copy>
     </target>

    <target name="compile" depends="process-resources">
        <mkdir dir="${build.outputDirectory}"/>
        <mkdir dir="${build.directory}/generated-sources"/>
        <javac
            destdir="${build.outputDirectory}"
            classpath="${classpath.compile}"
            nowarn="true"
            source="1.4" target="1.4"
            debug="on">
            <src path="${build.sourceDirectory}"/>
        </javac>
    </target>

    <target name="package" depends="compile">
        <jar jarfile="${build.directory}/${artifactId}-${version}.jar"
            basedir="${build.outputDirectory}"/>
    </target>
</project>