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
     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <project name="Downloads necessary libraries" default="libraries" basedir=".">
     3     <target name="clean">
     4         <delete dir="dist"/>
     5     </target>
     6     
     7     <target name="libraries">
     8         <antcall target="-library">
     9             <param name="library" value="junit-4.4"/>
    10             <param name="url" value="http://switch.dl.sourceforge.net/sourceforge/junit/junit-4.4.jar"/>
    11         </antcall>
    12     </target>
    13     
    14     <!-- support methods -->
    15     
    16     <target name="-library-check">
    17         <fail message="You need to specify library name" unless="library"/>
    18         <fail message="You need to specify url" unless="url"/>
    19         
    20         <property name="library.jar" location="dist/${library}.jar"/>
    21         
    22         <echo message="Checking for ${library.jar}"/>
    23         <available file="${library.jar}" property="library.available"/>
    24     </target>
    25     <target name="-library" depends="-library-check" unless="library.available">
    26         <mkdir dir="dist"/>
    27         <get dest="${library.jar}" src="${url}"/>
    28         
    29         <fail message="Now the library ${library} should be downloaded">
    30             <condition>
    31                 <not><available file="${library.jar}"/></not>
    32             </condition>
    33         </fail>
    34     </target>
    35 </project>