Script for downloading libraries
authorJaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 09:51:04 +0200
changeset 181e82ffa1391b
parent 17 af005434d27f
child 19 56735848fe6c
Script for downloading libraries
samples/libs/build.xml
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/samples/libs/build.xml	Sat Jun 14 09:51:04 2008 +0200
     1.3 @@ -0,0 +1,33 @@
     1.4 +<?xml version="1.0" encoding="UTF-8"?>
     1.5 +<project name="Downloads necessary libraries" default="libraries" basedir=".">
     1.6 +    <target name="clean">
     1.7 +        <delete dir="dist"/>
     1.8 +    </target>
     1.9 +    
    1.10 +    <target name="libraries">
    1.11 +        <antcall target="-library">
    1.12 +            <param name="library" value="junit-4.1"/>
    1.13 +            <param name="url" value="junit"/>
    1.14 +        </antcall>
    1.15 +    </target>
    1.16 +    
    1.17 +    <!-- support methods -->
    1.18 +    
    1.19 +    <target name="-library-check">
    1.20 +        <fail message="You need to specify library name" unless="library"/>
    1.21 +        <fail message="You need to specify url" unless="url"/>
    1.22 +        
    1.23 +        <echo message="Checking for dist/${library}.jar"/>
    1.24 +        <available file="dist/${library}.jar" property="library.available"/>
    1.25 +    </target>
    1.26 +    <target name="-library" depends="-library-check" unless="library.available">
    1.27 +        <mkdir dir="dist"/>
    1.28 +        <get dest="dist/${library}" src="${url}"/>
    1.29 +        
    1.30 +        <fail message="Now the library ${library} should be downloaded">
    1.31 +            <condition>
    1.32 +                <available file="dist/${library}.jar"/>
    1.33 +            </condition>
    1.34 +        </fail>
    1.35 +    </target>
    1.36 +</project>