You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by in...@gmx.net on 2007/10/12 18:16:48 UTC

Passing property from subproject back to parent project

Hi,

I use ANT to build a number of subprojects all controlled from one master parent ANT build file. I use the <ant antfile="subproject1/build.xml" target="test"/> task to call various targets in subprojects.

In the subproject-targets I set properties, but they are not available in the parent project. The manual for the "ant" task says that a new project is created for each ant call, so I assume that's why the properties are not set in the parent project.

Here my question:

Is there a way how I can access properties set in a subproject in the parent project?

Here is one use case:

In subprojects I use the junit failureproperty option to indicate a test failure, I don't fail the build on a test failure, because I want to run tests for all subprojects and generate reports, etc. In my parent project I want to check for these properties and generate an HTML summary page with links to the detailed results.

Any advice is appreciated.

Thanks,
Rico





-- 
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser

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


Re: Passing property from subproject back to parent project

Posted by Gilbert Rebhan <an...@schillbaer.de>.
Hi,



David Weintraub wrote:
> Simple answer: No.

Not with Ant Core but with antcontrib <antfetch> task

> More complex answer: You could create a file using echo tasks that
> would write a *.properties file that would then be read in by the
> calling build script. Very intelligent, but I think this would be the
> only way of doing it.
> 
> On 10/12/07, info-rico@gmx.net <in...@gmx.net> wrote:
>> Hi,
>>
>> I use ANT to build a number of subprojects all controlled from one master parent ANT build file. I use the <ant antfile="subproject1/build.xml" target="test"/> task to call various targets in subprojects.
>>
>> In the subproject-targets I set properties, but they are not available in the parent project. The manual for the "ant" task says that a new project is created for each ant call, so I assume that's why the properties are not set in the parent project.
>>
>> Here my question:
>>
>> Is there a way how I can access properties set in a subproject in the parent project?
>>
>> Here is one use case:
>>
>> In subprojects I use the junit failureproperty option to indicate a test failure, I don't fail the build on a test failure, because I want to run tests for all subprojects and generate reports, etc. In my parent project I want to check for these properties and generate an HTML summary page with links to the detailed results.
>>
>> Any advice is appreciated.

nearly the same question has been asked lately, see =

http://marc.info/?l=ant-user&m=119147700912116&w=2

Regards, Gilbert

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


Re: Passing property from subproject back to parent project

Posted by David Weintraub <qa...@gmail.com>.
Simple answer: No.

More complex answer: You could create a file using echo tasks that
would write a *.properties file that would then be read in by the
calling build script. Very intelligent, but I think this would be the
only way of doing it.

On 10/12/07, info-rico@gmx.net <in...@gmx.net> wrote:
> Hi,
>
> I use ANT to build a number of subprojects all controlled from one master parent ANT build file. I use the <ant antfile="subproject1/build.xml" target="test"/> task to call various targets in subprojects.
>
> In the subproject-targets I set properties, but they are not available in the parent project. The manual for the "ant" task says that a new project is created for each ant call, so I assume that's why the properties are not set in the parent project.
>
> Here my question:
>
> Is there a way how I can access properties set in a subproject in the parent project?
>
> Here is one use case:
>
> In subprojects I use the junit failureproperty option to indicate a test failure, I don't fail the build on a test failure, because I want to run tests for all subprojects and generate reports, etc. In my parent project I want to check for these properties and generate an HTML summary page with links to the detailed results.
>
> Any advice is appreciated.
>
> Thanks,
> Rico
>
>
>
>
>
>
> --
> Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten
> Browser-Versionen downloaden: http://www.gmx.net/de/go/browser
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>


-- 
--
David Weintraub
qazwart@gmail.com

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