ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicola Ken Barozzi" <nicola...@apache.org>
Subject [HACK] Antlib-like with new concat task
Date Tue, 02 Apr 2002 16:04:52 GMT
With the new concat task and the foreach task I make my build load all tasks
in jars like this (I call these jars "cents"):

    <!-- Unpack jarred cents -->
    <antipede-foreach target="-cent-unjar" param="current.cent.jar">
     <fileset dir="." casesensitive="yes">
      <patternset>
       <include name="${cents.dir}/*.${cent.jar.suffix}"/>
      </patternset>
     </fileset>
    </antipede-foreach>

    <mkdir dir="${temp.dir}"/>

    <!-- put all ant task definitions in cents in a single file -->
    <concat destfile="${temp.dir}/${task.properties.name}" append="no">
      <fileset dir=".">
       <patternset>
         <include
name="${cents.dir}/*.${cent.dir.suffix}/${task.properties.name}"/>
        </patternset>
      </fileset>
    </concat>

    <!-- define the tasks found in cents -->
    <taskdef file="${temp.dir}/${task.properties.name}">
     <classpath>
      <path>
       <fileset dir="." casesensitive="yes">
        <patternset>
         <include
name="${cents.dir}/*.${cent.dir.suffix}/${cent.lib.dir.name}/*.jar"/>
         <include
name="${cents.dir}/*.${cent.dir.suffix}/${cent.lib.dir.name}/*.zip"/>
        </patternset>
       </fileset>
      </path>
     </classpath>
    </taskdef>

--
Nicola Ken Barozzi                   nicolaken@apache.org
            - verba volant, scripta manent -
   (discussions get forgotten, just code remains)
---------------------------------------------------------------------


--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message