Note that there are some explanatory texts on larger screens.

plurals
  1. POAnt: fileset "dir" attribute with a runtime expanded full path
    text
    copied!<p>Let's say I have a file-system that looks a little something like this:</p> <ul> <li>C:\stuff\build.xml</li> <li>C:\stuff\myfolder\library1.jar</li> <li>C:\stuff\myfolder\library2.jar</li> </ul> <p>Inside build.xml, I want to define a path that looks like this:</p> <pre><code>&lt;path id="some.id"&gt; &lt;fileset dir="myfolder"&gt; &lt;include name="**/*.jar"/&gt; &lt;/fileset&gt; &lt;/path&gt; </code></pre> <p>Normally that works fine. However, I am calling my own custom Ant Task that will inherit any references (including the path "some.id") and that custom Ant Task will call a build.xml that lives in a different basedir. Therefore, the "dir" attribute in the fileset is no longer valid.</p> <p>Is there a way to define a "dir" such that it remains valid no matter where the second build.xml lives?</p> <p>I essentially want to do something like this:</p> <pre><code>&lt;fileset dir="${expand.current.directory}/myfolder"&gt; </code></pre> <p>So when I call the second build.xml it will understand that the "dir" attribute is the location of:</p> <pre><code>&lt;fileset dir="c:\stuff\myfolder"&gt; </code></pre> <p><b>Edit:</b> Furthermore, I want a solution that allows me to copy the "stuff" project from one machine to another without requiring a change to the build. For example, if the "stuff" project is on the C: drive and I copy the project over to a D: drive on another machine, I want the build to continue to work without me having to go into the build and change the letter C to the letter D.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload