ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject Re: [HOWTO] from a filename to a <fileset>
Date Mon, 22 Jul 2002 20:49:56 GMT
--- Dominique Devienne <DDevienne@lgc.com> wrote:
> I wanted to run <antdoc> on the current build file (whose absolute
> filename is in ${ant.file}), but <antdoc> doesn't have a 'file'
> attribute, only a <fileset> subelement. 
[snip
> If you know of a better way to do this, thanks to let me know.

  <target name="getBuildFile">
    <script language="javascript"> <![CDATA[
      file = new java.io.File(projname.getProperty("ant.file"));
      projname.setUserProperty("buildfile.name", file.getName());
      ]]>
    </script>
  </target>

If you want to also get the dir, add:
      projname.setUserProperty("buildfile.dir", file.getParent());

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

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


Mime
View raw message