ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gao Lin <aoi...@gmail.com>
Subject How to define a path according to a property
Date Mon, 04 Jul 2011 02:59:51 GMT
Hi:

I have a requirement to define a path according to a property.

the command line: ant compile
will use the path :
  <path id="test.lib.path.id">
    <fileset dir="${lib.dir}/test1">
      <include name="**/*.jar"/>
    </fileset>
    <fileset dir="${lib.dir}/test2">
      <include name="**/*.jar"/>
    </fileset>
   </path>

and the command line: ant -Dtest=true compile
will use the following path:
  <path id="test.lib.path.id">
    <fileset dir="${lib.dir}/test3">
      <include name="**/*.jar"/>
    </fileset>
    <fileset dir="${lib.dir}/test4">
      <include name="**/*.jar"/>
    </fileset>
   </path>

There are many compile targets will use the path: test.lib.path.id, so
it would be better to define the path a little dynamically, like:

<path id="test.lib.path.id" if="test">
...
</path>

<path id="test.lib.path.id" unless="test">
...
</path>

but I think path does not support this attribute, right?

-- 
Thanks and Best Regards

aoingl@gmail.com

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


Mime
View raw message