Hi all,

I successfully include XPathObjectNavigator from Bamboo.Prevalence.

Script like this:

 <exec program="foo.exe" commandline="1 2 3" failonerror="false">
    <result taskoutput="/ExecTask/ResultCode" property="resultcode"/>
    </exec>
 <echo message="${resultcode}"/>

now correctly writes:
     [exec] foo.exe 1 2 3
E:\src\extern\nant\test2\test.build(21,3): External Program Failed: foo.exe
(return code was 2)
     [echo] 2

What is not so nice is:

1/ Bamboo makes object names from hierarichy based on their names. In NAnt
we use custom attributes to customize names
2/ We could want to hide some names from result (or all public is ok?)
3/ Badly formed xpath do not throws exception but rather returns string
"NAnt.Core.Tasks.ExecTask".
4/ Collections returned via xpath (e.g. "/ExecTask/Environment") returns as
"NAnt.Core.Types.OptionCollection". Not very useful...

Maybe, I'm doing something wrong with Bamboo...

Attached are patched to NAnt sources + zip with needed Bamboo.Prevalence
sources.
Sources are alot simlyfied now (e.g. only one result element) and no fail
checks yet. It is meant just to test this approach.

Martin

----- Original Message ----- 
From: "Martin Aliger" <[EMAIL PROTECTED]>
To: "Ian MacLean" <[EMAIL PROTECTED]>; "Matthew Mastracci"
<[EMAIL PROTECTED]>
Cc: "Scott Hernandez" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Thursday, January 08, 2004 10:29 AM
Subject: Re: [nant-dev] Re: Inter-Task XML Communication (WAS: new xml type)


> > It might be worth investigating what is possible with items in msbuild
> > and what use cases we can apply using this XPathObjectNavigator
solution.
> > John Lam posted some of his experiences using output items with msbuild
> at:
> > http://www.iunknown.com/000379.html
> > Ian
>
> I read that article and what I like about MSBuild (never tried it yet) is:
> <Task Name="MSBuild"   Projects="..\lib\lib.proj">
>    <OutputItem TaskParameter="TargetOutputs" Type="ReferencePath"/>
> </Task>
>
> transcribed into NAnt syntax something like (I use <exec> instead of
<nant>
> task here):
>       <exec program="foo.exe" commandline="1 2 3">
>          <resultitem taskoutput="output/resultcode"
property="resultcode"/>
>       </exec>
>
> so <exec> task returns some semi-xml result (not xml in any form, just
> XPathNavigatable objects) which you could reference in resultitem (or
> outputitem) subelement (common for all tasks) and copy its value into
> property.
>
> This could be very simple to use in many cases. Still I want to keep
> possibility to fetch all semi-xml document from task to for example
iterate
> with <xmlforeach> within failed projects:
>
>     <solution configuration="Release" outputdir="${output.dir}"
> includevsfolders="false">
>         <projects>
>             <includes name="${build.dir}/**/*.csproj"/>
>         </projects>
>
>          <resultitem id="solresult"/>
>     </solution>
>     <xml-foreach refid="solresult" xpath="failed/projects">
>         ...
>     </xml-foreach>
>
> How you like this?
>
>
> > > +1 for XPathObjectNavigator.  I was thinking about this myself.  W
>
> Could we use XPathObjectNavigator.cs file from bamboo? Does our and their
> licence allow that?
> I'll do test implementation now to see how it'll be.
>
> Martin
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Perforce Software.
> Perforce is the Fast Software Configuration Management System offering
> advanced branching capabilities and atomic changes on 50+ platforms.
> Free Eval! http://www.perforce.com/perforce/loadprog.html
> _______________________________________________
> nant-developers mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/nant-developers
>

Attachment: ExternalProgramBase.cs.patch
Description: Binary data

Attachment: NAnt.Core.Bamboo.zip
Description: Zip compressed data

Attachment: Task.cs.patch
Description: Binary data

Reply via email to