You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by shreedhar natarajan <sh...@ami.com> on 2006/01/04 17:56:54 UTC

Target dependency

Hi all,

I have couple of questions -

1. Can a target in one project depend on target on another project ?
2. Is there any order in which the sub build is invoked when subant is called ?
For eg. if i invoke 

 <subant target="">
      <fileset dir="." includes="*/build.xml"/>
 </subant>

And I have 3 sub directories A,B and C. Which build.xml will be invoked first ?

3. Already I have raised this questions. Any clue ? Is there a way to execute all sub-builds with a single subant call.

For eg.

 <subant target="">
      <fileset dir="." includes="*/build.xml"/>
 </subant>

The above call builds all sub-builds in current directory. I need to handle nested directories(not only the first level but also subsequent levels).

Thanks
Shreedhar



-----Original Message-----
From: shreedhar natarajan [mailto:shreedharn@ami.com]
Sent: Tuesday, January 03, 2006 4:16 PM
To: Ant Users List
Subject: building with subant


Sorry did n't edit subj. in my previous mail.
Is there a way to execute all sub-builds with a single subant call.

For eg.

 <subant target="">
      <fileset dir="." includes="*/build.xml"/>
 </subant>

The above call builds all sub-builds in current directory. I need to handle nested directories(not only the first level but also subsequent levels).


Thanks,
Shreedhar







-----Original Message-----
From: Kev Jackson [mailto:foamdino@gmail.com]
Sent: Tuesday, January 03, 2006 11:23 AM
To: Ant Developers List
Cc: user@ant.apache.org
Subject: [SPAM] - Re: Problem: Ant's SQL task does not support copy via
indirection - Bayesian Filter detected spam



On 3 Jan 2006, at 12:19, VGupta wrote:

> If the sql file contains data to be loaded in the following format
>
>   COPY bcd  (PolicySymbol, StateCode, SqlTable, CallType, SubType,  
> FieldIdentifier, TagName) FROM stdin;
> PAC $$ AGR_ST_COV RATE/AUDIT  MOD_FACTOR4 PRICING TIER
> PAC $$ AGR_ST_COV RATE/AUDIT  MOD_FACTOR5 CAPPING FACTOR
> .................................
>
>   The above call to sql task would hang as there is ome problem  
> with the sql task.
>   (I think ant tasks expects sql statements and does not support  
> copy via redirection to stdin.)
>
>   Can anybody please suggest me some way of loading this sql file  
> on a database server which is running on a remote machine.
>
>

What syntax is that?  It looks like some product specific thing (like  
SQL Loader or equivalent).  If you want to execute a command on the  
remote server, something like the exec task may be of more use.   
There is also an FTP task for moving files to the remote server.

More information about what you are trying to achieve would help us  
narrow down the options.  Maybe Ant isn't the appropriate tool for  
what you are trying to do.

Kev


--
"Government is begotten of aggression, by aggression" - Herbert Spencer


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


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


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


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


Re: Target dependency

Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 4 Jan 2006, shreedhar natarajan <sh...@ami.com> wrote:

> 1. Can a target in one project depend on target on another project ?

In a way, yes.  You can import that other build file, or you cn use an
ant task as first task in your target that needs to depend on the
other build.

> 2. Is there any order in which the sub build is invoked when subant
> is called ?

Yes, you can use a <path> instead of a fileset, which is sorted.  The
drawback is that you can't use wildcards then.  Ant 1.7 will change
that since you will be able to sort filesets - plugging in your own
sorting algorithms if necessary.

For Ant 1.6 you could write your own task to create path of the
fileset sorting them in the order you need.

> For eg. if i invoke
> 
>  <subant target="">
>       <fileset dir="." includes="*/build.xml"/>
>  </subant>
> 
> And I have 3 sub directories A,B and C. Which build.xml will be
> invoked first ?

Depends on your OS and maybe even on your Java VM.  The build.xml that
is found first by Ant when it traverses the file system - so the
question is what is the first directory returned by
java.io.File.list(), which doesn't have any globally correct answer.
Most likely it will be in alphabetical order.

> 3. Already I have raised this questions. Any clue ? Is there a way
> to execute all sub-builds with a single subant call.

I've already answered it:
<http://marc.theaimsgroup.com/?l=ant-user&m=113632307630297&w=2>

Stefan

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


RE: Target dependency

Posted by Stephen McConnell <mc...@dpml.net>.
 

> -----Original Message-----
> From: shreedhar natarajan [mailto:shreedharn@ami.com] 

>  <subant target="">
>       <fileset dir="." includes="*/build.xml"/>  </subant>
> 
> The above call builds all sub-builds in current directory. I 
> need to handle nested directories(not only the first level 
> but also subsequent levels).

This requires a higher level application driving the build sequence.  The
higher level application could be a custom ant task or a application
embedding ant.  That application would sort projects based on some sort of
dependency model.  Either way - I think your looking for functionality that
is not inside Ant at this time - however there are projects around that deal
with these problems - e.g. the Ivy Project [1] or the DPML Depot Project [2]
amongst others.

[1] www.jayasoft.fr/org/modules/ivy/ 
[2] www.dpml.net/depot/

Cheers, Steve.

--------------------------
Stephen McConnell
mailto:mcconnell@dpml.net
http://www.dpml.net
 




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