Skip to content

Commit d810a30

Browse files
authored
Merge pull request #556 from jpogran/buildscript
(maint) Convert gulp script to psake file
2 parents b7e45b9 + 6ab015e commit d810a30

File tree

11 files changed

+980
-6195
lines changed

11 files changed

+980
-6195
lines changed

.github/workflows/vscode-ci.yml

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,44 @@ jobs:
4646
choco install pdk
4747
if: runner.os == 'Windows'
4848

49-
- name: npm install, build, and test
49+
- name: Install psake
50+
shell: pwsh
51+
run: Install-Module psake -Force
52+
53+
- name: npm install
54+
shell: pwsh
55+
run: |
56+
npm install -g vsce --silent;
57+
npm install -g typescript --silent;
58+
npm install --silent;
59+
60+
- name: npm build
61+
shell: pwsh
62+
run: |
63+
invoke-psake -taskList 'build'
64+
65+
- name: npm test
5066
env:
51-
BUILD_VERSION: "0.99.${{ github.event.number }}"
67+
BUILD_VERSION: '0.99.${{ github.event.number }}'
5268
VSCODE_BUILD_VERBOSE: true
5369
DISPLAY: ':99.0'
70+
shell: pwsh
5471
run: |
55-
npm install -g vsce --silent;
56-
npm install --silent;
57-
node node_modules/gulp/bin/gulp.js bump --version $BUILD_VERSION;
58-
node node_modules/gulp/bin/gulp.js initial;
5972
npm test --silent
73+
74+
- name: vsce package
75+
if: runner.os == 'Linux'
76+
env:
77+
BUILD_VERSION: '0.99.${{ github.event.number }}'
78+
shell: pwsh
79+
run: |
80+
invoke-psake -properties @{ packageVersion = $env:BUILD_VERSION } -tasklist bump
6081
mkdir artifacts
61-
vsce package --out artifacts/puppet-vscode-$BUILD_VERSION.vsix
82+
vsce package --out artifacts/puppet-vscode-$env:BUILD_VERSION.vsix
6283
6384
- name: upload vsix
6485
if: runner.os == 'Linux'
6586
uses: actions/upload-artifact@master
6687
with:
67-
name: "puppet-vscode"
88+
name: 'puppet-vscode'
6889
path: artifacts

.travis.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,26 @@ env:
2424
nodejs_arch: "x64"
2525
VSCE_TASK: package
2626

27+
matrix:
28+
include:
29+
- os: linux
30+
dist: trusty
31+
sudo: false
32+
addons:
33+
apt:
34+
sources:
35+
- sourceline: "deb [arch=amd64] https://packages.microsoft.com/ubuntu/14.04/prod trusty main"
36+
key_url: "https://packages.microsoft.com/keys/microsoft.asc"
37+
packages:
38+
- powershell
39+
- os: osx
40+
osx_image: xcode9.1
41+
before_install:
42+
- brew tap caskroom/cask
43+
- brew cask install powershell
44+
fast_finish: true
45+
46+
2747
before_install: true
2848

2949
install:
@@ -59,8 +79,8 @@ install:
5979
npm --version;
6080
npm install -g vsce --silent;
6181
npm install --silent;
62-
node node_modules/gulp/bin/gulp.js bump --version $BUILD_VERSION;
63-
node node_modules/gulp/bin/gulp.js initial;
82+
# node node_modules/gulp/bin/gulp.js bump --version $BUILD_VERSION;
83+
pwsh -command invoke-psake -taskList 'initial';
6484
fi
6585

6686
script:

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
77
## [Unreleased]
88

99
- ([GH-557](https://github.com/lingua-pupuli/puppet-vscode/issues/557)) Remove Docker Connection Handler
10+
- [maint] Convert gulp build script to psake
1011

1112
## [0.20.0] - 2019-08-30
1213

README_BUILD.md

Lines changed: 38 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,24 @@ The following resources are vendored into the extension;
3737

3838
* Puppet Editor Services (`editor-services`)
3939

40-
* Puppet Editor Syntax (`editor-syntax`)
40+
* Puppet Editor Syntax (`editorSyntax`)
4141

42-
By default the extension will use the specified versions in the `editor-components.json` file when vendoring resources.
42+
By default the extension will use the specified versions in the `package.json` file when vendoring resources.
4343

4444
#### Example configuration
4545

46-
The following examples use `editor-services`, however the configuration settings can be used on any resource.
46+
The following examples use `editorServices`, however the configuration settings can be used on any resource.
4747

4848
##### By release tag
4949

5050
To use version `0.10.0` of the Editor Services;
5151

5252
``` json
5353
{
54-
"editor-services": {
55-
"release": "0.10.0"
54+
"editorComponents":{
55+
"editorServices": {
56+
"release": "0.10.0"
57+
}
5658
}
5759
}
5860
```
@@ -63,17 +65,19 @@ To use a specific GitHub repository that contains the Puppet Editor services, us
6365

6466
``` json
6567
{
66-
"editor-services": {
67-
"githubuser": "Alice",
68-
"githubrepo": "puppet-editing",
69-
"githubref": "testing"
68+
"editorComponents":{
69+
"editorServices": {
70+
"githubuser": "Alice",
71+
"githubrepo": "puppet-editing",
72+
"githubref": "testing"
73+
}
7074
}
7175
}
7276
```
7377

74-
Note - For `editor-services` the default the githubuser is `lingua-pupuli` and the githubrepo is `puppet-editor-services`
78+
Note - For `editorServices` the default the githubuser is `lingua-pupuli` and the githubrepo is `puppet-editor-services`
7579

76-
Note - For `editor-syntax` the default the githubuser is `lingua-pupuli` and the githubrepo is `puppet-editor-syntax`
80+
Note - For `editorSyntax` the default the githubuser is `lingua-pupuli` and the githubrepo is `puppet-editor-syntax`
7781

7882
Note - Use the full length commit SHA for `githubref`, not the abbreviated eight character SHA
7983

@@ -93,19 +97,29 @@ Note - Backslashes in the path must be escaped.
9397

9498
### Vendoring the resources into the extension
9599

96-
* Use gulp to vendor the resources
97-
98-
```bash
99-
> node node_modules/gulp/bin/gulp.js --series clean vendor
100-
[15:00:21] Using gulpfile C:\Source\puppet-vscode\gulpfile.js
101-
[15:00:21] Starting 'clean'...
102-
[15:00:21] Finished 'clean' after 7.9 ms
103-
[15:00:21] Starting 'vendor'...
104-
[15:00:21] Starting 'vendor_editor_services'...
105-
[15:00:25] Finished 'vendor_editor_services' after 3.88 s
106-
[15:00:25] Starting 'vendor_editor_syntax'...
107-
[15:00:27] Finished 'vendor_editor_syntax' after 2.24 s
108-
[15:00:27] Finished 'vendor' after 6.13 s
100+
* Use psake to vendor the resources
101+
102+
```powershell
103+
> ./build.ps1 -task clean,vendor
104+
psake version 4.8.0
105+
Copyright (c) 2010-2018 James Kovacs & Contributors
106+
107+
Executing clean
108+
Executing VendorEditorServices
109+
Executing VendorEditorSyntax
110+
111+
psake succeeded executing C:\Users\james\src\lingua\client\psakefile.ps1
112+
113+
----------------------------------------------------------------------
114+
Build Time Report
115+
----------------------------------------------------------------------
116+
Name Duration
117+
---- --------
118+
Clean 00:00:00.075
119+
VendorEditorServices 00:00:01.601
120+
VendorEditorSyntax 00:00:00.338
121+
Vendor 00:00:00.000
122+
Total: 00:00:02.023
109123
```
110124

111125
* Start VS Code

appveyor.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,24 @@ install:
3535
& npm install --silent
3636
3737
Write-Host "Set the package.json version..."
38-
& node node_modules\gulp\bin\gulp.js bump --specific $ENV:APPVEYOR_BUILD_VERSION
38+
invoke-psake -properties @{ packageVersion = $ENV:APPVEYOR_BUILD_VERSION } -tasklist bump
39+
40+
Install-Module -Name psake -Force
3941
4042
Write-Host "Setting up initial configuration..."
41-
& node node_modules\gulp\bin\gulp.js initial
43+
invoke-psake -taskList 'initial'
4244
}
4345
- cmd: choco install pdk
4446
- ps: pdk --version
4547

4648
build_script:
4749
- cmd: npm test --silent
48-
- cmd: IF NOT [%GULP_BUILD_TASK%] == [] node node_modules\gulp\bin\gulp.js %GULP_BUILD_TASK%
50+
- ps: if($env:GULP_BUILD_TASK) { invoke-psake -taskList $env:GULP_BUILD_TASK }
4951
- cmd: IF NOT [%VSCE_TASK%] == [] vsce %VSCE_TASK%
5052

5153
test_script:
5254
- cmd: IF NOT [%NPM_TASK%] == [] npm run %NPM_TASK%
53-
- cmd: IF NOT [%GULP_TASK%] == [] node node_modules\gulp\bin\gulp.js %GULP_TASK%
55+
- ps: if($env:GULP_BUILD_TASK) { invoke-psake -taskList $env:GULP_BUILD_TASK }
5456

5557
artifacts:
5658
- path: .\*.vsix

build.ps1

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[cmdletbinding()]
2+
param(
3+
[string[]]$Task = 'default',
4+
$properties
5+
)
6+
7+
if (!(Get-Module -Name psake -ListAvailable)) {
8+
Install-Module -Name psake -Scope CurrentUser
9+
}
10+
11+
Invoke-psake `
12+
-buildFile "$PSScriptRoot\psakefile.ps1" `
13+
-properties $properties `
14+
-taskList $Task `
15+
-Verbose:$VerbosePreference

editor-components.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)