ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Danny Zapata <>
Subject RE: apply task without srcfile?
Date Wed, 05 Mar 2003 23:19:21 GMT
I have done the same thig.

I require the user to define in the build.xml file a classes parameter,
which is the extensionless list of file names and then I convert them into
the .java form using the following target:

<!-- =================================================================== -->
<!-- Utility function to append .java to the value of the tokens for the
classes parameter.  -->
<!-- Saves the new values in the jFiles parameter
<!-- =================================================================== -->
<target name="appendJava" if="classes">
	<script language="javascript"><![CDATA[
	      jFiles = project.getProperty("classes");
	      pkgPath = jFiles.replaceAll(" ",".java ");
		jFiles =	pkgPath.concat(".java");

Very simple, yet a little hacky.


-----Original Message-----
From: Dominique Devienne []
Sent: Wednesday, March 05, 2003 3:15 PM
To: 'Ant Users List'
Subject: RE: apply task without srcfile?

Unfortunately, it doesn't appear possible, at least from reading the doc.
You could write a little <script> that instantiates an ExecTask and runs it
for each file, or use <foreach> from ant-contrib (on You could also
patch <apply> of course ;-) Sorry, --DD

-----Original Message-----
From: daniel rocco [] 
Sent: Wednesday, March 05, 2003 5:02 PM
Subject: apply task without srcfile?


I'm trying to create a task that uses only the filename part (not the 
extension) of matched files.  My current approach is to use the apply 
task, but I haven't been completely successful.  The task I'm using 
below is supposed to pass a file argument to bibtex without the 
extension, e.g. "file.aux" should be "file" on the command line.  What I 
have is:

  <target name="bibtex" >
	<apply executable="${bibtex}" dir="${builddir}" dest="." >
	  <env key="BIBINPUTS" path="${bibdir}:." />
	  <fileset dir="${builddir}">
		  <include name="**/*.aux" />
	  <mapper type="glob" from="*.aux" to="*" />

which _almost_ works; the effective command line is:

	bibtex file file.aux

Is there any way to suppress the implied use of the srcfile element? 
Alternatively, is there a better way to do what I'm attempting here?

I apologize if this question has already been answered; I've checked the 
documentation, the Web, and the list archives  without luck.

thanks for your help,

daniel j. rocco  -|-  -|-  II cor. 4:7

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message