samples/componentinjection/anagram-modular/build.xml
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 10:07:00 +0200
changeset 221 a89ad3d1da08
parent 219 3fb53f65db57
child 225 57ae32a47ccd
permissions -rw-r--r--
Solution with properties
jtulach@215
     1
<?xml version="1.0" encoding="UTF-8"?>
jtulach@215
     2
<project name="Build Script" default="test" basedir=".">
jtulach@215
     3
    <target name="clean">
jtulach@215
     4
        <delete dir="build"/>
jtulach@215
     5
    </target>
jtulach@215
     6
    
jtulach@215
     7
    <target name="compile" depends="build"/>
jtulach@215
     8
    <target name="build" depends="-libraries">
jtulach@215
     9
        <antcall target="-build-one">
jtulach@215
    10
            <param name="version" value="api"/>
jtulach@219
    11
            <param name="cp" value=""/>
jtulach@219
    12
        </antcall>
jtulach@219
    13
        <antcall target="-build-one">
jtulach@219
    14
            <param name="version" value="word-static"/>
jtulach@219
    15
        </antcall>
jtulach@219
    16
        <antcall target="-build-one">
jtulach@219
    17
            <param name="version" value="scrambler-simple"/>
jtulach@219
    18
        </antcall>
jtulach@219
    19
        <antcall target="-build-one">
jtulach@219
    20
            <param name="version" value="gui"/>
jtulach@219
    21
        </antcall>
jtulach@219
    22
        <antcall target="-build-one">
jtulach@219
    23
            <param name="version" value="app-register"/>
jtulach@219
    24
            <param name="cp" value="build/api/classes:build/word-static/classes:build/scrambler-simple/classes:build/gui/classes"/>
jtulach@215
    25
        </antcall>
jtulach@221
    26
        <antcall target="-build-one">
jtulach@221
    27
            <param name="version" value="app-property"/>
jtulach@221
    28
            <param name="cp" value="build/api/classes:build/word-static/classes:build/scrambler-simple/classes:build/gui/classes"/>
jtulach@221
    29
        </antcall>
jtulach@215
    30
        
jtulach@215
    31
    </target>
jtulach@215
    32
    
jtulach@219
    33
    <target name="test" depends="build">
jtulach@221
    34
        <echo level="info" message="Running registerXYZ version"/>
jtulach@215
    35
        <antcall target="-run-one">
jtulach@219
    36
            <param name="version" value="app-register"/>
jtulach@219
    37
            <param name="cp" value="build/api/classes:build/word-static/classes:build/scrambler-simple/classes:build/gui/classes"/>
jtulach@219
    38
            <param name="main" value="org.apidesign.anagram.app.register.Main"/>
jtulach@215
    39
        </antcall>
jtulach@221
    40
        <echo level="info" message="Running System.getProperty version"/>
jtulach@221
    41
        <antcall target="-run-one">
jtulach@221
    42
            <param name="version" value="app-property"/>
jtulach@221
    43
            <param name="cp" value="build/api/classes:build/word-static/classes:build/scrambler-simple/classes:build/gui/classes"/>
jtulach@221
    44
            <param name="main" value="org.apidesign.anagram.app.property.Main"/>
jtulach@221
    45
        </antcall>
jtulach@215
    46
    </target>
jtulach@215
    47
    
jtulach@215
    48
    <!-- support methods -->
jtulach@215
    49
    
jtulach@215
    50
    <target name="-libraries">
jtulach@215
    51
        <ant dir="../../libs/"/>
jtulach@215
    52
        
jtulach@215
    53
        <property name="junit.jar" location="../libs/dist/junit-4.4.jar"/>
jtulach@215
    54
    </target>
jtulach@215
    55
jtulach@219
    56
    <target name="-run-one">
jtulach@219
    57
        <java classpath="${cp}:build/${version}/classes" classname="${main}"/>
jtulach@215
    58
    </target>
jtulach@215
    59
    
jtulach@215
    60
    <target name="-build-one">
jtulach@215
    61
        <fail message="You need to specify version number" unless="version"/>
jtulach@215
    62
        
jtulach@215
    63
        <mkdir dir="build/${version}/classes"/>
jtulach@219
    64
        <property name="cp" value="build/api/classes"/>
jtulach@215
    65
        <javac 
jtulach@215
    66
            srcdir="src-${version}" 
jtulach@215
    67
            destdir="build/${version}/classes" 
jtulach@215
    68
            source="1.5" target="1.5"
jtulach@215
    69
            classpath="${cp}"
jtulach@215
    70
            debug="true" debuglevel="lines,vars,source"
jtulach@215
    71
        />
jtulach@215
    72
        <copy todir="build/${version}/classes">
jtulach@215
    73
            <fileset dir="src-${version}">
jtulach@215
    74
                <exclude name="**/*.java"/>
jtulach@215
    75
            </fileset>
jtulach@215
    76
        </copy>
jtulach@215
    77
    </target>
jtulach@215
    78
</project>