How do you data drive task dependencies via properties in psake?

Posted by Jordan on Stack Overflow See other posts from Stack Overflow or by Jordan
Published on 2010-04-03T01:09:34Z Indexed on 2010/04/03 1:13 UTC
Read the original article Hit count: 303

Filed under:

In MSBuild you can data drive target dependencies by passing a item group into a target, like so:

<ItemGroup>
    <FullBuildDependsOn Include="Package;CoreFinalize"
                        Condition="@(FullBuildDependsOn) == ''" />
</ItemGroup>

<Target Name="FullBuild"
        DependsOnTargets="@(FullBuildDependsOn)" />

If you don't override the FullBuildDependsOn item group, the FullBuild target defaults to depending on the Package and CoreFinalize targets. However, you can override this by defining your own FullBuildDependsOn item group.

I'd like to do the same in psake - for example:

properties {
    $FullBuildDependsOn = "Package", "CoreFinalize"
}

task default -depends FullBuild

# this won't work because $FullBuildDependsOn hasn't been defined yet - the "Task" function will see this as a null depends array
task FullBuild -depends $FullBuildDependsOn 

What do I need to do to data drive the task dependencies in psake?

© Stack Overflow or respective owner

Related posts about psake