ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hill, Richard" <>
Subject RE: How to get subproject file name from within the subproject?
Date Tue, 20 Jul 2004 21:39:20 GMT
The following gets me the full path to the subproject file.

    <property name="FullTestFilePath" value="${ant.file}"/> 

For example, if my path to the test file is
c:\project\suite\TestFile.xml, I would like to extract only the
"TestFile" part of the path (the file name without the extension) and
set it into a property. Currently, are there any Ant tasks would allow
me to parse this information to a property?

ANT: 1.5.4
JDK: 1.4.2_05

Thanks again,

-----Original Message-----
From: Hill, Richard [] 
Sent: Tuesday, July 20, 2004 12:33 PM
Subject: How to get subproject file name from within the subproject?

ANT: 1.5.4
JDK: 1.4.2_05
I have a project that calls a subproject. For example:
<project name="TestProject" default="test">
    <target name="test">
      <ant antfile="TestFile.xml"/>
I would like to get the name of the subproject file (i.e. TestFile.xml)
from a target within the subproject itself. I've accomplished this
before using the optional 'script' task using something like: 
<target name="setupDirectories"> 
  <script language="javascript">
          file = new
MyTestFileProjectName.getProperty("ant.file") );
...but I am have heck of a time with the subproject finding the bsf.jar
and js.jar due to resource conflicts. 
Is there another, easier way to get the subproject file name from within
the subproject itself. 

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

View raw message