Update - Nested Builds

3 views
Skip to first unread message

Jorge

unread,
Feb 25, 2010, 12:14:02 AM2/25/10
to psake-dev
I've added support for running build scripts that call other psake
build scripts.

Please get the latest version and let me know what you all think or if
you can break it - please let me know!

Example:
======================== nested.ps1 ===============================
Properties {
$x = 1
}

Task default -Depends RunNested1, RunNested2, CheckX

Task RunNested1 {
Invoke-psake .\nested\nested1.ps1
}

Task RunNested2 {
Invoke-psake .\nested\nested2.ps1
}

Task CheckX{
Assert ($x -eq 1) '$x was not 1'
}
======================== nested.ps1 ===============================

======================== nested1.ps1 ===============================
Properties {
$x = 100
}

Task default -Depends Nested1CheckX

Task Nested1CheckX{
Assert ($x -eq 100) '$x was not 100'
}
======================== nested1.ps1 ===============================

======================== nested2.ps1 ===============================
Properties {
$x = 200
}

Task default -Depends Nested2CheckX

Task Nested2CheckX{
Assert ($x -eq 200) '$x was not 200'
}
======================== nested2.ps1 ===============================


Here is the call to the main psake build script:

Invoke-psake .\examples\nested.ps1

======================== output ===============================

Patrick van der Velde

unread,
Mar 1, 2010, 5:01:40 PM3/1/10
to psak...@googlegroups.com
Hi Jorge

I've only just got a chance to try this out and my first tests worked!
I'll go and try this on my full build system at home (which will be
later today). I'm guessing that will be a bit more of a full on test
given that I've got about 6 different nested build scripts running :)

Out of curiosity (I haven't looked at the source yet) have you done
anything special with include files?

Thanks heaps for adding this!

Regards

Patrick

> --
> You received this message because you are subscribed to the Google Groups "psake-dev" group.
> To post to this group, send email to psak...@googlegroups.com.
> To unsubscribe from this group, send email to psake-dev+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/psake-dev?hl=en.
>
>

Jorge Matos

unread,
Mar 1, 2010, 5:24:42 PM3/1/10
to psak...@googlegroups.com
Patrick,
 
You're welcome!
 
I haven't done anything in particular with include files, but the way psake handles include files is similar to how it handles properties, and since properties don't appear to step over themselves when they are repeated in nested build scripts, I submit that include files will behave in the same manner, but I didn't explicitly test that. I'll see about adding a test in the examples\ folder for nested builds that use include files. 
 
Please let me know how your testing goes, and if you find any issues.
--
Jorge Matos
Senior .NET Architect, MCSD.NET, MCSD Visual Studio 6.0
(440) 666-3107
matos...@hotmail.com      
Blog: http://jorgelmatos.blogspot.com
--------------------------------------------------------------------------------
"Any intelligent fool can make things bigger and more complex...
It takes a touch of genius - and a lot of courage to
move in the opposite direction."... - Albert Einstein

Reply all
Reply to author
Forward
0 new messages