You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Jon Skeet <Jo...@clearswift.com> on 2005/10/27 09:47:41 UTC

Importing files - at the end of the file or not?

I'm trying to update our build procedures using some of the guidelines
in
http://www.1060.org/blogxter/resources/5/ant-1.7.pdf
 
They claim that an imported file is added to the *end* of the importing
file. That would suggest to me that top-level tasks in the imported file
would get executed *after* the top-level tasks in the importing file.

For instance:

Importing.xml:
<project name="importing" default="noop">
  <import file="imported.xml"/>
  <echo>Importing</echo>
  <target name="noop" />
</project>

Imported.xml:
<project name="imported" default="noop2">
  <echo>Imported</echo>
  <target name="noop2" />
</project>


I would *expect* (but not desire) the result to be:
Importing
Imported

In fact, the result is:
Imported
Importing

That's absolutely what I want, in fact - because the files I want to
import will be defining tasks, setting properties etc. However, I'd
really like to know that the behaviour is going to stay the same, *and*
in what way "imports are imported to the tail".

On a side-note - it's nice to be back on the list :)

Jon


Clearswift monitors, controls and protects all its messaging traffic in compliance with its corporate email policy using Clearswift products.
Find out more about Clearswift, its solutions and services at http://www.clearswift.com

This communication is confidential and may contain privileged information intended solely for the named addressee(s). It may not be used or disclosed except for the purpose for which it has been sent. If you are not the intended recipient, you must not copy, distribute or take any action in reliance on it. Unless expressly stated, opinions in this message are those of the individual sender and not of Clearswift. If you have received this communication in error, please notify Clearswift by emailing support@clearswift.com quoting the sender and delete the message and any attached documents. Clearswift accepts no liability or responsibility for any onward transmission or use of emails and attachments having left the Clearswift domain.

This footnote confirms that this email message has been swept by MIMEsweeper for Content Security threats, including computer viruses.

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


Re: Importing files - at the end of the file or not?

Posted by Steve Loughran <st...@apache.org>.
Jon Skeet wrote:
> I'm trying to update our build procedures using some of the guidelines
> in
> http://www.1060.org/blogxter/resources/5/ant-1.7.pdf
>  
> They claim that an imported file is added to the *end* of the importing
> file. That would suggest to me that top-level tasks in the imported file
> would get executed *after* the top-level tasks in the importing file.

I was wrong. I found out I was wrong last week. I will go back and 
change the document.

In Ant1.6.0 the imports where tacked in at the end, but somewhere 
between then and ant1.6.5 imports were fixed to go in inline.

Sorry jon.

Note also that that doc is about ant1.7. Some bits of it are untrue 
w.r.t Ant1.6 :)
> 
> I would *expect* (but not desire) the result to be:
> Importing
> Imported
> 
> In fact, the result is:
> Imported
> Importing
> 
> That's absolutely what I want, in fact - because the files I want to
> import will be defining tasks, setting properties etc. However, I'd
> really like to know that the behaviour is going to stay the same, *and*
> in what way "imports are imported to the tail".

Imports are now imported where they are.


> On a side-note - it's nice to be back on the list :)

welcome back. I believe you still have write access to the -now SVN- 
repository.

-stegve

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