Skip to content

Commit bd7764a

Browse files
author
vp
committed
More tasks
1 parent 59575c7 commit bd7764a

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

.vscode/tasks-dotnet.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ function Invoke-Dotnet([string[]]$Arguments){
1616
$logArgs = @('--nologo','/property:GenerateFullPaths=true','/consoleloggerparameters:NoSummary')
1717

1818
switch ($Command.ToLowerInvariant()) {
19+
'restore' { if (-not (Test-Path $SolutionPath)) { throw "Solution not found: $SolutionPath" }; Invoke-Dotnet (@('restore',$SolutionPath) + $logArgs) }
1920
'build' { $SolutionPath = (Resolve-Path $SolutionPath).Path; if (-not (Test-Path $SolutionPath)) { throw "Solution not found: $SolutionPath" }; Invoke-Dotnet (@('build',$SolutionPath) + $logArgs) }
21+
'build-release'{ $SolutionPath = (Resolve-Path $SolutionPath).Path; if (-not (Test-Path $SolutionPath)) { throw "Solution not found: $SolutionPath" }; Invoke-Dotnet (@('build',$SolutionPath,'-c','Release') + $logArgs) }
22+
'build-nr' { $SolutionPath = (Resolve-Path $SolutionPath).Path; if (-not (Test-Path $SolutionPath)) { throw "Solution not found: $SolutionPath" }; Invoke-Dotnet (@('build',$SolutionPath,'--no-restore') + $logArgs) }
23+
'pack' { $SolutionPath = (Resolve-Path $SolutionPath).Path; if (-not (Test-Path $SolutionPath)) { throw "Solution not found: $SolutionPath" }; Invoke-Dotnet (@('pack',$SolutionPath,'-c','Release') + $logArgs) }
2024
'clean' { if (-not (Test-Path $SolutionPath)) { throw "Solution not found: $SolutionPath" }; Invoke-Dotnet (@('clean',$SolutionPath) + $logArgs) }
2125
'tool-restore' { Invoke-Dotnet @('tool','restore') }
2226
'format-check' { Invoke-Dotnet @('format',$SolutionPath,'--verify-no-changes') }

tasks.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ function Invoke-Test([string]$kind,[switch]$All){
7070

7171
$tasks = [ordered]@{
7272
'build' = @{ Label='Build Solution'; Script={ Invoke-DotnetScript 'build' } }
73+
'build-release' = @{ Label='Build Solution (Release)'; Script={ Invoke-DotnetScript 'build-release' } }
74+
'build-nr' = @{ Label='Build Solution (No Restore)'; Script={ Invoke-DotnetScript 'build-nr' } }
75+
'pack' = @{ Label='Pack Solution (Release)'; Script={ Invoke-DotnetScript 'pack' } }
76+
'restore' = @{ Label='Restore Solution Packages'; Script={ Invoke-DotnetScript 'restore' } }
7377
'clean' = @{ Label='Clean Solution'; Script={ Invoke-DotnetScript 'clean' } }
7478
'tool-restore' = @{ Label='Restore Dotnet Tools'; Script={ Invoke-DotnetScript 'tool-restore' } }
7579
'test-unit' = @{ Label='Tests Unit (select)'; Script={ Invoke-Test 'unit' } }
@@ -112,7 +116,7 @@ $tasks = [ordered]@{
112116
}
113117

114118
$categories = [ordered]@{
115-
'Solution' = @('build','clean','tool-restore','format-check','format-apply','analyzers','server-build','server-publish','server-watch')
119+
'Solution' = @('restore','build','build-release','build-nr','pack','clean','tool-restore','format-check','format-apply','analyzers','server-build','server-publish','server-watch')
116120
'Tests' = @('test-unit','test-int','test-unit-all','test-int-all','coverage','coverage-html')
117121
'Entity Framework' = @('ef-info','ef-list','ef-add','ef-remove','ef-removeall','ef-apply','ef-undo','ef-status','ef-reset','ef-script')
118122
'Docker' = @('docker-build-run','docker-build','docker-run','docker-stop','docker-remove','compose-up','compose-up-pull','compose-down','compose-down-clean')

0 commit comments

Comments
 (0)