samples/libs/build.xml
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 09:51:05 +0200
changeset 21 0aee50e597da
parent 18 1e82ffa1391b
child 79 76b5dfab3745
permissions -rw-r--r--
Really downloading junit from their site
jtulach@18
     1
<?xml version="1.0" encoding="UTF-8"?>
jtulach@18
     2
<project name="Downloads necessary libraries" default="libraries" basedir=".">
jtulach@18
     3
    <target name="clean">
jtulach@18
     4
        <delete dir="dist"/>
jtulach@18
     5
    </target>
jtulach@18
     6
    
jtulach@18
     7
    <target name="libraries">
jtulach@18
     8
        <antcall target="-library">
jtulach@21
     9
            <param name="library" value="junit-4.4"/>
jtulach@21
    10
            <param name="url" value="http://switch.dl.sourceforge.net/sourceforge/junit/junit-4.4.jar"/>
jtulach@18
    11
        </antcall>
jtulach@18
    12
    </target>
jtulach@18
    13
    
jtulach@18
    14
    <!-- support methods -->
jtulach@18
    15
    
jtulach@18
    16
    <target name="-library-check">
jtulach@18
    17
        <fail message="You need to specify library name" unless="library"/>
jtulach@18
    18
        <fail message="You need to specify url" unless="url"/>
jtulach@18
    19
        
jtulach@21
    20
        <property name="library.jar" location="dist/${library}.jar"/>
jtulach@21
    21
        
jtulach@21
    22
        <echo message="Checking for ${library.jar}"/>
jtulach@21
    23
        <available file="${library.jar}" property="library.available"/>
jtulach@18
    24
    </target>
jtulach@18
    25
    <target name="-library" depends="-library-check" unless="library.available">
jtulach@18
    26
        <mkdir dir="dist"/>
jtulach@21
    27
        <get dest="${library.jar}" src="${url}"/>
jtulach@18
    28
        
jtulach@18
    29
        <fail message="Now the library ${library} should be downloaded">
jtulach@18
    30
            <condition>
jtulach@21
    31
                <not><available file="${library.jar}"/></not>
jtulach@18
    32
            </condition>
jtulach@18
    33
        </fail>
jtulach@18
    34
    </target>
jtulach@18
    35
</project>