Skip to content

Instantly share code, notes, and snippets.

@jchannon
Created July 12, 2016 20:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jchannon/d7749a0f55e695f883a273d419b7dcb8 to your computer and use it in GitHub Desktop.
Save jchannon/d7749a0f55e695f883a273d419b7dcb8 to your computer and use it in GitHub Desktop.
Run dotnet build on all projects in your folder hierarchy

CMD+Shift+ in VSCode to run build task. If not configured VSCode will prompt you to choose a build system, choose CoreCLR, then paste the above json in.

This works on the Nancy code base where the folder structure is:

.
./src/Nancy/
./src/Nancy.Validation.FluentValidation/
./samples/Nancy.Demo.Hosting.Kestrel/
./tests/Nancy.Tests/
{
"version": "0.1.0",
"command": "bash",
"isShellCommand": true,
"showOutput": "always",
"args": [
"-c"
],
"options": {
"cwd": "${workspaceRoot}"
},
"tasks": [{
"taskName": "my command",
"suppressTaskName": true,
"isBuildCommand": true,
"args": [
"ls ./**/**/project.json | xargs dotnet build"
]
}]
}
@geirsagberg
Copy link

Since dotnet build supports globs you can just do 'dotnet build **/project.json' :-)

@jchannon
Copy link
Author

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment