samples/libs/build.xml
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 09:51:04 +0200
changeset 18 1e82ffa1391b
child 21 0aee50e597da
permissions -rw-r--r--
Script for downloading libraries
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@18
     9
            <param name="library" value="junit-4.1"/>
jtulach@18
    10
            <param name="url" value="junit"/>
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@18
    20
        <echo message="Checking for dist/${library}.jar"/>
jtulach@18
    21
        <available file="dist/${library}.jar" property="library.available"/>
jtulach@18
    22
    </target>
jtulach@18
    23
    <target name="-library" depends="-library-check" unless="library.available">
jtulach@18
    24
        <mkdir dir="dist"/>
jtulach@18
    25
        <get dest="dist/${library}" src="${url}"/>
jtulach@18
    26
        
jtulach@18
    27
        <fail message="Now the library ${library} should be downloaded">
jtulach@18
    28
            <condition>
jtulach@18
    29
                <available file="dist/${library}.jar"/>
jtulach@18
    30
            </condition>
jtulach@18
    31
        </fail>
jtulach@18
    32
    </target>
jtulach@18
    33
</project>