Use shake to define a rule for a set of files unknown at build time.

I am developing a complex build of the script using Shake, but (for now) I am using Visual Studio solutions to create all the binaries. Because of this, I need to define a rule that builds dozens of files in one scan. I don’t know what the results of the assembly will be until it ends.

So, for example, I want to write these rules:

"test-bins-x86" ~> do
    vsBuild unitTestSln X86 Release -- produces dozens of outputs to .\x86\Release

"x86/Release/*.test-results" *> \out -> do
    let testExe = out -<.> exe
    need [testExe]
    Stdout results <- cmd testExe
    writeFile' out results

But, since this means, the rule for *.test-resultsdoes not know how to build testExe, because no rules formally determine how to do it. How can I get around this?

+4
source share
1 answer

. : , , , testExe ? , ? , , ? , , ?

- "test-bins-x86" , need need . , , , VS .

, , FilePattern %>, :

"x86/Release/*" %> \ _ -> need ["test-bins-x86"]

, , , , , , - , .

, , &%>, , .

+3

All Articles