ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Gordon" <tim.gor...@allustra.com>
Subject RE: ant custom selectors
Date Tue, 22 Apr 2003 13:43:11 GMT
http://ant.apache.org/manual/CoreTypes/selectors.html

and

http://ant.apache.org/manual/CoreTypes/selectors.html#customselect

and

http://ant.apache.org/manual/CoreTypes/selectors-program.html

They're very easy to write - just subclass
org.apache.tools.ant.types.selectors.BaseExtendSelector, override isSelected
and setParameters.

In your case you'd probably want to stream through the file looking through
comments for the sequence "@include" or whatever string you'd like to
determine what goes in what jar.

Then your fileset which you'd use jar would look like

<fileset id="clientjar.fileset" dir="${build.dir}">
  <include name="**/*.class"/>
  <custom classname="com.domain.app.TierFilteringSelector">
    <param name="javabasedir" value="${java.src}"/>
    <param name="include" value="swinggui,client,common"/>
  </custom>
</fileset>

You can then reference the fileset with a refid of clietjar.fileset in your
jar task.

Word of warning, early versions of ANT don't call setProject on the selector
when it's created - I think it's fixed in the latest.

Tim

-----Original Message-----
From: Hanasaki JiJi [mailto:hanasaki@hanaden.com]
Sent: 22 April 2003 14:23
To: Tim Gordon
Subject: ant custom selectors


could you point out a link about these "custom selectors"?  Or, can I
resue your code?
--
=================================================================
= Management is doing things right; leadership is doing the     =
=       right things.    - Peter Drucker                        =
=_______________________________________________________________=
=     http://www.sun.com/service/sunps/jdc/javacenter.pdf       =
=  www.sun.com | www.javasoft.com | http://wwws.sun.com/sunone  =
=================================================================


Mime
View raw message