samples/preventcyclicdependencies/build.xml
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Thu, 30 Oct 2014 21:30:10 +0100
changeset 409 40cabcdcd2be
parent 263 7e8e995065c5
permissions -rw-r--r--
Updating to NBMs from NetBeans 8.0.1 as some of them are required to run on JDK8
jtulach@87
     1
<?xml version="1.0" encoding="UTF-8"?>
jtulach@87
     2
<project name="preventcyclicdependencies" default="run" basedir=".">
jtulach@87
     3
    <target name="clean">
jtulach@87
     4
        <delete dir="build"/>
jtulach@87
     5
    </target>
jtulach@263
     6
    <target name="test" depends="run"/>
jtulach@87
     7
    
jtulach@128
     8
    <target name="compile" depends="build"/>
jtulach@87
     9
    <target name="build">
jtulach@87
    10
        <antcall target="-build-one">
jtulach@87
    11
            <param name="version" value="cyclic"/>
jtulach@87
    12
        </antcall>
jtulach@87
    13
        <antcall target="-build-one">
jtulach@87
    14
            <param name="version" value="test"/>
jtulach@87
    15
            <param name="cp" location="build/cyclic/classes"/>
jtulach@87
    16
        </antcall>
jtulach@87
    17
        <antcall target="-build-one">
jtulach@87
    18
            <param name="version" value="acyclic1"/>
jtulach@87
    19
        </antcall>
jtulach@87
    20
        <antcall target="-build-one">
jtulach@87
    21
            <param name="version" value="acyclic2"/>
jtulach@87
    22
            <param name="cp" location="build/acyclic1/classes"/>
jtulach@87
    23
        </antcall>
jtulach@87
    24
    </target>
jtulach@87
    25
    
jtulach@87
    26
    <target name="run" depends="build">
jtulach@87
    27
        <echo level="info" message="Running old API with cycles between packages:"/>
jtulach@87
    28
        <antcall target="-run-one">
jtulach@87
    29
            <param name="version1" value="cyclic"/>
jtulach@87
    30
        </antcall>
jtulach@87
    31
        <echo level="info" message="Running new API without cycles:"/>
jtulach@87
    32
        <antcall target="-run-one">
jtulach@87
    33
            <param name="version1" value="acyclic1"/>
jtulach@87
    34
            <param name="version2" value="acyclic2"/>
jtulach@87
    35
        </antcall>
jtulach@87
    36
    </target>
jtulach@87
    37
jtulach@87
    38
    
jtulach@87
    39
    <!-- support methods -->
jtulach@87
    40
    
jtulach@87
    41
    <target name="-run-one">
jtulach@87
    42
        <java 
jtulach@340
    43
            classpath="build/${version1}/classes:build/${version2}/classes:build/test/classes:../libs/dist/org-openide-util-lookup.jar"
jtulach@87
    44
            classname="org.apidesign.cycles.array.test.Main"
jtulach@87
    45
            failonerror="true" 
jtulach@87
    46
        >
jtulach@87
    47
            <jvmarg value="-ea"/>
jtulach@87
    48
        </java>
jtulach@87
    49
    </target>
jtulach@87
    50
    
jtulach@87
    51
    <target name="-build-one">
jtulach@87
    52
        <fail message="You need to specify version number" unless="version"/>
jtulach@87
    53
        
jtulach@87
    54
        <mkdir dir="build/${version}/classes"/>
jtulach@87
    55
        <property name="cp" value=""/>
jtulach@87
    56
        <javac 
jtulach@87
    57
            srcdir="src-${version}" 
jtulach@87
    58
            destdir="build/${version}/classes" 
jtulach@87
    59
            source="1.5" target="1.5"
jtulach@87
    60
            debug="true"
jtulach@340
    61
            classpath="${cp}:../libs/dist/org-openide-util-lookup.jar"
jtulach@87
    62
        />
jtulach@87
    63
        <copy todir="build/${version}/classes">
jtulach@87
    64
            <fileset dir="src-${version}">
jtulach@87
    65
                <exclude name="**/*.java"/>
jtulach@87
    66
            </fileset>
jtulach@87
    67
        </copy>
jtulach@87
    68
    </target>
jtulach@87
    69
</project>