ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laran Evans <lc...@cornell.edu>
Subject Re: Duplicate target names
Date Tue, 13 Jul 2004 18:30:52 GMT
Thanks Yuji.

I've been trying to explain my situation over the last few days.  Maybe 
I'll get it right this time.

I have a master build file (build-master.xml) and one build file for 
each project.  I have define all of my targets in build-master.xml.  In 
each project build.xml I define what other projects that project depends 
upon.  Each project build.xml imports build-master.xml.  The "compile" 
target depends on the "dependencies" target (both targets are defined in 
build-master.xml).  The dependencies target checks what other projects 
the current project depends upon.  It then compiles and jars that 
project to make it's jar file available for the current project so that 
it can compile.

This will ONLY work if I can call targets recursively.  Since, however 
the dependencies target is defined only once in the build-master.xml 
file it will always be called recursively.  Each time it's called 
however it's called with different properties that cause it to build 
differently.

I realize that this may sound complicated.  It's basically an inverse 
tree with dependencies among the different leaves.

I've attached the build-master.xml and the project build.xml file to 
perhaps make my effort more clear.

In looking at the build files it might be easier to understand if you 
know my directory structure.

projects/
projects/build-master.xml
projects/build-master.properties
projects/datamodel
projects/datamodel/build.xml
projects/datamodel/build.properties
projects/travel_web
projects/travel_web/build.xml
projects/travel_web/build.properties
projects/travel
projects/travel/build.xml
projects/travel/build.properties
projects/web
projects/web/build.xml
projects/web/build.properties

Thanks.

Yuji Yamano wrote:

>On Tue, 13 Jul 2004 10:58:09 -0400,
>Laran Evans <lc278@cornell.edu> wrote:
>
>  
>
>>Can anyone explain this trace to me?  I'd be happy to provide the build 
>>files involved if needed.
>>    
>>
>
>  
>
>>parsing buildfile C:\dev\home\dfaFinSys\project\travel_web\build.xml 
>>    
>>
>
>  
>
>>Build sequence for target `compile' is [dependencies, compile]
>>Complete build sequence is [dependencies, compile, setup-workspace, 
>>init, clean,
>>jar, war, ]
>>    
>>
>
>  
>
>>dependencies:
>>    [subant] calling target jar in build file
>>C:\dev\home\dfaFinSys\project\travel_web\build.xml
>>parsing buildfile C:\dev\home\dfaFinSys\project\travel_web\build.xml 
>>    
>>
>
>  
>
>>Build sequence for target `jar' is [dependencies, compile, jar]
>>Complete build sequence is [dependencies, compile, jar, setup-workspace, 
>>init,
>>clean, war, ]
>>
>>BUILD FAILED
>>C:\dev\home\dfaFinSys\project\build-master.xml:145: subant task calling 
>>a target
>>that depends on its parent target 'dependencies'.
>>    
>>
>
>1. ant calls "compile" target in travel_web/build.xml.
>2. "compile" target depends on "dependencies" target,
>   so "dependencies" target is called.
>3. "dependencies" target calls "subant" task.
>4. "subant" task calls "jar" target in the same build.xml.
>5. "jar" target depends on "dependencies" target in the same build.xml,
>   then build failed to avoid infinite dependency loop.
>
>Hope this helps.
>
>-- Yuji Yamano <yyamano@kt.rim.or.jp>
>  Loan me your funky mind. So I can play with it,
>  for nothing is good unless you play with it. --George Clinton
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>  
>

Mime
View raw message