ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Lévy-Lambert <anto...@antbuild.com>
Subject Re: new task 'ants' required or not.
Date Mon, 22 Dec 2003 15:26:07 GMT
Sathyanarayana V. wrote:

>Problem with 'subant' is: it doesnt communicate/contribute to overall build status. subprojects
may fail, but  the overall process will be successful. Wouldnt it contribute in over all build
status.
>
>Thanks,
>Sathya
>
>
>  
>
My view is that ant is not designed to build several projects, with some 
projects failing and other being successful.
gump is really the tool that would be OK for this purpose.

Concerning your ants task, there was a proposal for something a bit 
similar called <antreturn/> which is a flavour of <ant/> which can 
return properties.

What you can do in ant 1.6 would be to use macrodef to describe the 
build of a generic subproject, and foreach or for from ant-contrib plus 
try/catch to get the status of each subproject


for instance (untested pseudocode)

macrodef build_one_subproject

try
build the subproject


catch
    <property name="${@{sub-project-name}-failure}" value="true"/>

endmacrodef

<build_one_subproject sub-project-name="subproj_1"/>

<build_one_subproject sub-project-name="subproj_2"/>

<build_one_subproject sub-project-name="subproj_3"/>

<echo >${subroj_1-failure}</echo>
<echo >${subroj_2-failure}</echo>
<echo >${subroj_3-failure}</echo>

this would be doing what you would like.
You can probably iterate among your subprojects using for or foreach from ant-contrib.

Cheers,
Antoine

>
>
>  
>
>>Sathyanarayana V. wrote:
>>
>>    
>>
>>>Hi All,
>>>
>>>    Recently,  as part of automating my project builds, I have used 
>>>CruiseControl along with Ant.  Surprisingly, I didn't find any task 
>>>to build/compile all the subprojects    of a project.  My purpose was 
>>>to have  the compile time errors of all the subprojects as part of 
>>>automated build report. The 'ant' task will stop building as soon as 
>>>one subproject fails. I tried using java/exec tasks with 'failonerror 
>>>'  attribute as false, but the problem with  this approach is that 
>>>build status of subprojects is not available to the main build 
>>>process and resulting Total build successful though subprojects are 
>>>failing in-between.
>>>      
>>>
>>OK
>>
>>    
>>
>>>   So, I have written new task  called 'ants' and used for my 
>>>automated builds. This task internally uses 'ant' only.  What I would 
>>>like to know is: Can I post this task of mine to apache or Is there 
>>>any existing task/workaround available for the above required behavior.
>>>      
>>>
>>Ant 1.6 has '<subant> that wil bulk compile a project ... does this do 
>>what you want or are there changes you'd recommend?
>>    
>>
>
>Also ant 1.6 has a -keep-going which will continue exectuting targets 
>that do not rely on the task that failed.
>Peter
>
>  
>
>>>Thanks in advance
>>>Sathya
>>>
>>>      
>>>
>>    
>>


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


Mime
View raw message