ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject cvs commit: ant/docs/manual/CoreTasks import.html
Date Tue, 29 Jun 2004 09:01:53 GMT
bodewig     2004/06/29 02:01:53

  Modified:    docs/manual/CoreTasks import.html
  How to resolve files in imported build files by Ivan Ivanov
  Revision  Changes    Path
  1.14      +42 -1     ant/docs/manual/CoreTasks/import.html
  Index: import.html
  RCS file: /home/cvs/ant/docs/manual/CoreTasks/import.html,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- import.html	29 Apr 2004 10:13:17 -0000	1.13
  +++ import.html	29 Jun 2004 09:01:53 -0000	1.14
  @@ -61,7 +61,48 @@
   property of the main buildfile.<br />
   Note that &quot;builddocs&quot; is not the filename, but the name attribute
   present in the imported project tag.<br />
  -<br />
  +<b>Resolving files against the imported file</b>
  +<p>Suppose your main build file called <code>importing.xml</code>
  +imports a build file <code>imported.xml</code>, located anywhere on
  +the file system, and <code>imported.xml</code> reads a set of
  +properties from <code></code>:</p>
  +<pre>&lt;-- importing.xml --&gt;
  +&lt;project name="importing" basedir="." default="..."&gt;
  +&nbsp; &lt;import file="${path_to_imported}/imported.xml"/&gt;
  +&lt;-- imported.xml --&gt;
  +&lt;project name="imported" basedir="." default="..."&gt;
  +&nbsp; &lt;property file=""/&gt;
  +<p>This snippet however will resolve <code></code>
  +against the basedir of <code>importing.xml</code>, because the basedir
  +of <code>imported.xml</code> is ignored by Ant. The right way to use
  +<code></code> is:</p>
  +&lt;-- imported.xml --&gt;
  +&lt;project name="imported" basedir="." default="..."&gt;
  +&nbsp; &lt;dirname property="imported.basedir" file="${ant.file.imported}"/&gt;
  +&nbsp; &lt;property file="${imported.basedir}/"/&gt;
  +<p>As explained above <code>${ant.file.imported}</code> stores the
  +path of the build script, that defines the project called
  +<code>imported</code>, (in short it stores the path to
  +<code>imported.xml</code>) and <a
  +href="dirname.html"><code>&lt;dirname&gt;</code></a> takes
  +directory. This technique also allows <code>imported.xml</code> to be
  +used as a standalone file (without being imported in other
   <table border="1" cellpadding="2" cellspacing="0">

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

View raw message