ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Noam Postavsky <npost...@gmail.com>
Subject Passing list of classes to exclude from build as macrodef attribute
Date Fri, 09 Mar 2012 02:27:36 GMT
I have a build.xml with some targets that are identical except for
some excluded classes. Currently I'm passing each class name as an
argument to macrodef like so:

  <macrodef name="jpp-javac-convert">

    <attribute name="exclude1" default="" description="class name (no
extension) to exclude from cap"/>
    <attribute name="exclude2" default="" description="class name (no
extension) to exclude from cap"/>
    <attribute name="exclude3" default="" description="class name (no
extension) to exclude from cap"/>
    <attribute name="exclude4" default="" description="class name (no
extension) to exclude from cap"/>
    <sequential>

      <javac srcdir="${src}"
             destdir="${class}"
             >
        <exclude name="**/@{exclude1}.java"/>
        <exclude name="**/@{exclude2}.java"/>
        <exclude name="**/@{exclude3}.java"/>
        <exclude name="**/@{exclude4}.java"/>
      </javac>

      <delete file="${class}/package/path/@{exclude1}.class" />
      <delete file="${class}/package/path/@{exclude2}.class" />
      <delete file="${class}/package/path/@{exclude3}.class" />
      <delete file="${class}/package/path/@{exclude4}.class" />


Is there a way to pass a list of excluded classes as a single
parameter to macrodef? It seems like it should be possible with
fileset, or filelist, or patternset, or ... something? I'm just not
sure how it all fits together.

thanks, Noam

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message