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
     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.1"/>
    10             <param name="url" value="junit"/>
    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         <echo message="Checking for dist/${library}.jar"/>
    21         <available file="dist/${library}.jar" property="library.available"/>
    22     </target>
    23     <target name="-library" depends="-library-check" unless="library.available">
    24         <mkdir dir="dist"/>
    25         <get dest="dist/${library}" src="${url}"/>
    26         
    27         <fail message="Now the library ${library} should be downloaded">
    28             <condition>
    29                 <available file="dist/${library}.jar"/>
    30             </condition>
    31         </fail>
    32     </target>
    33 </project>