From 717a5e70996557b3190c74fa5077b36bb818dcde Mon Sep 17 00:00:00 2001 From: Tyler Leonhardt Date: Wed, 21 Mar 2018 11:23:08 -0700 Subject: [PATCH 1/8] Save PowerShell module deps to module folder on restore --- vscode-powershell.build.ps1 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vscode-powershell.build.ps1 b/vscode-powershell.build.ps1 index 43b4c20693..fc87828f38 100644 --- a/vscode-powershell.build.ps1 +++ b/vscode-powershell.build.ps1 @@ -53,7 +53,9 @@ task ResolveEditorServicesPath -Before CleanEditorServices, BuildEditorServices } } -task Restore -If { "Restore" -in $BuildTask -or !(Test-Path "./node_modules") } -Before Build { +task Restore RestoreNodeModules, RestorePowerShellModules -Before Build + +task RestoreNodeModules -If { "Restore" -in $BuildTask -or !(Test-Path "./node_modules") } { Write-Host "`n### Restoring vscode-powershell dependencies`n" -ForegroundColor Green @@ -63,6 +65,11 @@ task Restore -If { "Restore" -in $BuildTask -or !(Test-Path "./node_modules") } exec { & npm install $logLevelParam } } +task RestorePowerShellModules -If { "Restore" -in $BuildTask -or !(Test-Path "./modules/Plaster") } { + Save-Module -Name Plaster -Path "$PSScriptRoot/modules/" + Save-Module -Name PSScriptAnalyzer -Path "$PSScriptRoot/modules/" +} + task Clean { Write-Host "`n### Cleaning vscode-powershell`n" -ForegroundColor Green Remove-Item .\out -Recurse -Force -ErrorAction Ignore From 29c02cecf684991b37eb48dd3ac5d4e0d623ecf0 Mon Sep 17 00:00:00 2001 From: Tyler Leonhardt Date: Wed, 21 Mar 2018 11:28:52 -0700 Subject: [PATCH 2/8] clean up tasks --- vscode-powershell.build.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-powershell.build.ps1 b/vscode-powershell.build.ps1 index fc87828f38..2a60b5a7e8 100644 --- a/vscode-powershell.build.ps1 +++ b/vscode-powershell.build.ps1 @@ -53,9 +53,9 @@ task ResolveEditorServicesPath -Before CleanEditorServices, BuildEditorServices } } -task Restore RestoreNodeModules, RestorePowerShellModules -Before Build +task Restore -If { "Restore" -in $BuildTask } RestoreNodeModules, RestorePowerShellModules -Before Build -task RestoreNodeModules -If { "Restore" -in $BuildTask -or !(Test-Path "./node_modules") } { +task RestoreNodeModules -If { -not (Test-Path "./node_modules") } { Write-Host "`n### Restoring vscode-powershell dependencies`n" -ForegroundColor Green @@ -65,7 +65,7 @@ task RestoreNodeModules -If { "Restore" -in $BuildTask -or !(Test-Path "./node_m exec { & npm install $logLevelParam } } -task RestorePowerShellModules -If { "Restore" -in $BuildTask -or !(Test-Path "./modules/Plaster") } { +task RestorePowerShellModules -If { -not (Test-Path "./modules/Plaster") } { Save-Module -Name Plaster -Path "$PSScriptRoot/modules/" Save-Module -Name PSScriptAnalyzer -Path "$PSScriptRoot/modules/" } From c482592e6803010b367e8056ba4ddc2d17053b27 Mon Sep 17 00:00:00 2001 From: Tyler Leonhardt Date: Wed, 21 Mar 2018 11:40:57 -0700 Subject: [PATCH 3/8] fix execution logic --- vscode-powershell.build.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode-powershell.build.ps1 b/vscode-powershell.build.ps1 index 2a60b5a7e8..c3d0b1b0df 100644 --- a/vscode-powershell.build.ps1 +++ b/vscode-powershell.build.ps1 @@ -53,9 +53,9 @@ task ResolveEditorServicesPath -Before CleanEditorServices, BuildEditorServices } } -task Restore -If { "Restore" -in $BuildTask } RestoreNodeModules, RestorePowerShellModules -Before Build +task Restore RestoreNodeModules, RestorePowerShellModules -Before Build -task RestoreNodeModules -If { -not (Test-Path "./node_modules") } { +task RestoreNodeModules -If { -not (Test-Path "$PSScriptRoot/node_modules") } { Write-Host "`n### Restoring vscode-powershell dependencies`n" -ForegroundColor Green @@ -65,7 +65,7 @@ task RestoreNodeModules -If { -not (Test-Path "./node_modules") } { exec { & npm install $logLevelParam } } -task RestorePowerShellModules -If { -not (Test-Path "./modules/Plaster") } { +task RestorePowerShellModules -If { -not (Test-Path "$PSScriptRoot/modules/Plaster") } { Save-Module -Name Plaster -Path "$PSScriptRoot/modules/" Save-Module -Name PSScriptAnalyzer -Path "$PSScriptRoot/modules/" } From 9a2722354d813269e603b3e825d58bb83a8af557 Mon Sep 17 00:00:00 2001 From: Tyler Leonhardt Date: Wed, 21 Mar 2018 14:49:56 -0700 Subject: [PATCH 4/8] forgot the PSES.VSCode module --- vscode-powershell.build.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/vscode-powershell.build.ps1 b/vscode-powershell.build.ps1 index c3d0b1b0df..3f6977f416 100644 --- a/vscode-powershell.build.ps1 +++ b/vscode-powershell.build.ps1 @@ -114,6 +114,7 @@ task Package { if ($script:psesBuildScriptPath) { Write-Host "`n### Copying PowerShellEditorServices module files" -ForegroundColor Green Copy-Item -Recurse -Force ..\PowerShellEditorServices\module\PowerShellEditorServices .\modules + Copy-Item -Recurse -Force ..\PowerShellEditorServices\module\PowerShellEditorServices.VSCode .\modules } Write-Host "`n### Packaging PowerShell-insiders.vsix`n" -ForegroundColor Green From f9cc1ecd0d0be08ce318d1bf4ab4e8f3c8b27eef Mon Sep 17 00:00:00 2001 From: Tyler Leonhardt Date: Thu, 22 Mar 2018 11:36:51 -0700 Subject: [PATCH 5/8] add modules.json and grab versions from that --- modules.json | 12 ++++++++++++ vscode-powershell.build.ps1 | 13 +++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 modules.json diff --git a/modules.json b/modules.json new file mode 100644 index 0000000000..c47939e30a --- /dev/null +++ b/modules.json @@ -0,0 +1,12 @@ +{ + "PSScriptAnalyzer":{ + "MinimumVersion":"1.0", + "MaximumVersion":"1.99", + "AllowPrerelease":false + }, + "Plaster":{ + "MinimumVersion":"1.0", + "MaximumVersion":"1.99", + "AllowPrerelease":false + } +} \ No newline at end of file diff --git a/vscode-powershell.build.ps1 b/vscode-powershell.build.ps1 index 3f6977f416..8991c70d0d 100644 --- a/vscode-powershell.build.ps1 +++ b/vscode-powershell.build.ps1 @@ -66,8 +66,17 @@ task RestoreNodeModules -If { -not (Test-Path "$PSScriptRoot/node_modules") } { } task RestorePowerShellModules -If { -not (Test-Path "$PSScriptRoot/modules/Plaster") } { - Save-Module -Name Plaster -Path "$PSScriptRoot/modules/" - Save-Module -Name PSScriptAnalyzer -Path "$PSScriptRoot/modules/" + $modules = Get-Content -Raw "./modules.json" | ConvertFrom-Json + $modules.PSObject.Properties | ForEach-Object { + $params = @{ + Name = $_.Name + MinimumVersion = $_.Value.MinimumVersion + MaximumVersion = $_.Value.MaximumVersion + AllowPrerelease = $_.Value.AllowPrerelease + Path = "$PSScriptRoot/modules/" + } + Save-Module @params + } } task Clean { From ce694b38a7188ca843f51bb49aed0d914fed936a Mon Sep 17 00:00:00 2001 From: Tyler Leonhardt Date: Thu, 22 Mar 2018 12:12:57 -0700 Subject: [PATCH 6/8] fix travis and appveyor to install and use latest PowerShellGet --- .travis.yml | 1 + appveyor.yml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7b69987bbd..8d4ba59119 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,4 +22,5 @@ install: script: - ulimit -n 4096 + - powershell -c "Install-Module PowerShellGet -Force" - powershell -File build/travis.ps1 \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index 4b767554c8..cfee000643 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,9 +19,10 @@ install: Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force | Out-Null Install-Module InvokeBuild -RequiredVersion 3.2.1 -Scope CurrentUser -Force | Out-Null Install-Module platyPS -RequiredVersion 0.7.6 -Scope CurrentUser -Force | Out-Null + - powershell.exe -c "Install-Module PowerShellGet -Force" build_script: - - ps: Invoke-Build + - powershell.exe -c "Invoke-Build" # The build script takes care of the tests test: off From 1504bb08bd4260e4b3007f16559b8660bcc6de23 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Thu, 22 Mar 2018 12:17:59 -0700 Subject: [PATCH 7/8] add sudo --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8d4ba59119..304f1d5667 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,5 +22,5 @@ install: script: - ulimit -n 4096 - - powershell -c "Install-Module PowerShellGet -Force" - - powershell -File build/travis.ps1 \ No newline at end of file + - sudo powershell -c "Install-Module PowerShellGet -Force" + - powershell -File build/travis.ps1 From 0bf2da2f8d41e5ec157e273fb86bbac1edc79069 Mon Sep 17 00:00:00 2001 From: Tyler Leonhardt Date: Fri, 23 Mar 2018 13:56:28 -0700 Subject: [PATCH 8/8] feedback and PSScriptRoot --- .travis.yml | 2 +- appveyor.yml | 4 ++-- vscode-powershell.build.ps1 | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8d4ba59119..9bd86c3c16 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,5 +22,5 @@ install: script: - ulimit -n 4096 - - powershell -c "Install-Module PowerShellGet -Force" + - powershell -Command "Install-Module PowerShellGet -Force" - powershell -File build/travis.ps1 \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index cfee000643..4e78546fef 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,10 +19,10 @@ install: Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force | Out-Null Install-Module InvokeBuild -RequiredVersion 3.2.1 -Scope CurrentUser -Force | Out-Null Install-Module platyPS -RequiredVersion 0.7.6 -Scope CurrentUser -Force | Out-Null - - powershell.exe -c "Install-Module PowerShellGet -Force" + - powershell.exe -Command "Install-Module PowerShellGet -Force" build_script: - - powershell.exe -c "Invoke-Build" + - powershell.exe -Command "Invoke-Build" # The build script takes care of the tests test: off diff --git a/vscode-powershell.build.ps1 b/vscode-powershell.build.ps1 index 8991c70d0d..99250808e8 100644 --- a/vscode-powershell.build.ps1 +++ b/vscode-powershell.build.ps1 @@ -66,7 +66,7 @@ task RestoreNodeModules -If { -not (Test-Path "$PSScriptRoot/node_modules") } { } task RestorePowerShellModules -If { -not (Test-Path "$PSScriptRoot/modules/Plaster") } { - $modules = Get-Content -Raw "./modules.json" | ConvertFrom-Json + $modules = Get-Content -Raw "$PSScriptRoot/modules.json" | ConvertFrom-Json $modules.PSObject.Properties | ForEach-Object { $params = @{ Name = $_.Name