Skip to content

Instantly share code, notes, and snippets.

@jchannon
Last active September 13, 2016 11:44

Revisions

  1. jchannon revised this gist Sep 13, 2016. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions info.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    # Info

    This will require OSX and ZSH installed.

    For tests it will require your directory name to match your namespace for tests as it uses the directory name to pass the namespace to xunit
  2. jchannon revised this gist Sep 13, 2016. No changes.
  3. jchannon created this gist Sep 13, 2016.
    68 changes: 68 additions & 0 deletions tasks.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,68 @@
    {
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "0.1.0",
    "command": "zsh",
    "isShellCommand": true,
    "showOutput": "always",
    "args": [
    "-c"
    ],
    "options": {
    "cwd": "${fileDirname}"
    },
    "tasks": [
    {
    "taskName": "Build Current Project",
    "suppressTaskName": true,
    "isBuildCommand": true,
    "args": [
    "setopt extended_glob && print -l (../)#project.json(:h) | xargs dotnet build 2>&1 | grep -iv warning && echo Build Current Project Completed"
    ],
    "problemMatcher": "$msCompile"
    },
    {
    "taskName": "Build All Projects",
    "suppressTaskName": true,
    "isBuildCommand": true,
    "args": [
    "cd ${workspaceRoot} && dotnet build ./**/**/project.json && echo Build All Completed"
    ],
    "problemMatcher": "$msCompile"
    },
    {
    "taskName": "Restore All Projects",
    "suppressTaskName": true,
    "isBuildCommand": true,
    "args": [
    "cd ${workspaceRoot} && dotnet restore ./**/**/project.json --verbosity Information && echo Restore All Completed"
    ]
    },
    {
    "taskName": "Restore Current Project",
    "suppressTaskName": true,
    "isBuildCommand": true,
    "args": [
    "setopt extended_glob && print -l (../)#project.json(:h) | xargs dotnet restore --verbosity Information && echo Restore Current Project Completed"
    ]
    },
    {
    "taskName": "Run All Tests in Project",
    "suppressTaskName": true,
    "isBuildCommand": true,
    "args": [
    "setopt extended_glob && print -l (../)#project.json(:h) | xargs dotnet test && echo Tests Run Completed"
    ],
    "problemMatcher": "$msCompile"
    },
    {
    "taskName": "Run Tests in Class",
    "suppressTaskName": true,
    "isBuildCommand": true,
    "args": [
    "setopt extended_glob && print -l (../)#project.json(:h) | xargs -I@ dotnet test @ -class $(echo ${fileDirname} | sed 's/.*src\\///g' ).$(basename ${file} .cs) && echo Tests Run Completed"
    ],
    "problemMatcher": "$msCompile"
    }
    ]
    }