Skip to content

Update build and task configurations #3518

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"outFiles": [
"${workspaceFolder}/out/src/**/*.js"
],
"preLaunchTask": "BuildAll"
"preLaunchTask": "Build"
},
{
"name": "Launch Extension (Build client only)",
Expand Down Expand Up @@ -47,6 +47,12 @@
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "Build"
}
},
{
"name": "PowerShell Launch Current File",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using this a lot when testing, high time to put it in the project's config.

"type": "PowerShell",
"request": "launch",
"script": "${file}",
},
]
}
33 changes: 8 additions & 25 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,49 +37,32 @@
},
"tasks": [
{
"label": "Install",
"label": "Restore",
"type": "shell",
"command": "Invoke-Build Restore",
"problemMatcher": []
},
{
"label": "CleanAll",
"type": "shell",
"command": "Invoke-Build CleanAll",
"problemMatcher": []
},
{
"label": "Clean",
"type": "shell",
"command": "Invoke-Build Clean",
"problemMatcher": []
},
{
"label": "BuildAll",
"type": "shell",
"command": "Invoke-Build BuildAll",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": []
},
{
"label": "Build",
"type": "shell",
"command": "Invoke-Build Build",
"group": "build",
"problemMatcher": []
},
{
"label": "Test",
"type": "shell",
"command": "Invoke-Build Test",
"group": {
"kind": "test",
"isDefault": true
},
"problemMatcher": []
"group": "test",
},
{
"label": "Package",
"type": "shell",
"command": "Invoke-Build Package",
"group": "build"
}
]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@
"type": "PowerShell",
"request": "launch",
"script": "^\"\\${file}\"",
"cwd": "^\"\\${file}\""
"cwd": "^\"\\${workspaceFolder}\""
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rkeithhill Do you know why this was file before? It seemed quite wrong to me, as the thing is asking for a directory, and our other task (below) was given workspaceFolder too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found my answer at long last...

if ((currentDocument !== undefined) && (config.cwd === "${file}")) {
config.cwd = currentDocument.fileName;
}

}
},
{
Expand Down
8 changes: 1 addition & 7 deletions vscode-powershell.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ task CleanEditorServices -If (Get-EditorServicesPath) {
Invoke-Build Clean (Get-EditorServicesPath)
}

task CleanAll CleanEditorServices, Clean

#endregion
#region Build tasks

Expand All @@ -69,8 +67,6 @@ task Build CopyEditorServices, Restore, {
exec { & npm run compile }
}

task BuildAll BuildEditorServices, Build

#endregion
#region Test tasks

Expand All @@ -84,8 +80,6 @@ task TestEditorServices -If (Get-EditorServicesPath) {
Invoke-Build Test (Get-EditorServicesPath)
}

task TestAll TestEditorServices, Test

#endregion

#region Package tasks
Expand All @@ -106,7 +100,7 @@ task UpdateReadme -If { $script:IsPreviewExtension } {
}
}

task Package UpdateReadme, {
task Package UpdateReadme, Build, {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Annoying dependency bug if you've cleaned and then want to package, it should just build.

assert { Test-Path ./modules/PowerShellEditorServices }
Write-Host "`n### Packaging $($script:PackageJson.name)-$($script:PackageJson.version).vsix`n" -ForegroundColor Green
exec { & npm run package }
Expand Down