Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Commit dedb15d

Browse files
authored
Merge branch 'master' into use-l4j-encoding
2 parents c103846 + a92752a commit dedb15d

File tree

8 files changed

+877
-120
lines changed

8 files changed

+877
-120
lines changed

.github/workflows/build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ on:
33
push:
44
branches:
55
- master
6-
- develop
6+
- dev
77
tags:
88
- v*
99
pull_request:
1010
branches:
1111
- master
12-
- develop
12+
- dev
1313

1414

1515
jobs:

.vscode/tasks.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"tasks": [
1616
{
1717
"label": "build",
18-
"args": [],
18+
"args": ["build"],
1919
"type": "shell",
2020
"group": "build",
2121
"isBackground": false,
@@ -25,7 +25,7 @@
2525
},
2626
{
2727
"label": "build_without_view",
28-
"args": [],
28+
"args": ["build_without_view"],
2929
"group": "build",
3030
"isBackground": false,
3131
"problemMatcher": [

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
33

4+
## Version 0.4.4
5+
6+
### Changed
7+
- Serial monitor uses a new backend which doesn't break with updates of VSCode. [#1322](https://github.com/microsoft/vscode-arduino/pull/1322)
8+
49
## Version 0.4.3
510

611
### Fixed

gulpfile.js

+41-17
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
const gulp = require("gulp");
2-
const eslint = require('gulp-eslint');
2+
const eslint = require("gulp-eslint");
33
const tslint = require("gulp-tslint");
4-
const PluginError = require('plugin-error');
5-
const log = require('fancy-log');
4+
const PluginError = require("plugin-error");
5+
const log = require("fancy-log");
66
const ts = require("gulp-typescript");
77
const sourcemaps = require("gulp-sourcemaps");
88
const webpack = require("webpack");
9-
const del = require('del');
9+
const del = require("del");
10+
const download = require("download");
11+
const extract = require("extract-zip");
1012
const fs = require("fs");
1113
const path = require("path");
1214
const childProcess = require("child_process");
13-
const argv = require('minimist')(process.argv.slice(2));
15+
const argv = require("minimist")(process.argv.slice(2));
1416

1517
gulp.task("tslint", () => {
1618
return gulp.src(["**/*.ts", "**/*.tsx", "!**/*.d.ts", "!./vendor/**", "!node_modules/**", "!./src/views/node_modules/**", "!out/**"])
@@ -28,39 +30,61 @@ gulp.task("eslint", () => {
2830
gulp.task("html-webpack", (done) => {
2931
const config = require("./src/views/webpack.config.js");
3032
config.context = `${__dirname}/src/views`;
31-
config.mode = argv.mode ? argv.mode : 'production';
33+
config.mode = argv.mode ? argv.mode : "production";
3234
return webpack(config, (err, stats) => {
3335
const statsJson = stats.toJson();
3436
if (err || (statsJson.errors && statsJson.errors.length)) {
3537
statsJson.errors.forEach(webpackError => {
3638
log.error(`Error (webpack): ${webpackError}`);
3739
});
3840

39-
throw new PluginError('webpack', JSON.stringify(err || statsJson.errors));
41+
throw new PluginError("webpack", JSON.stringify(err || statsJson.errors));
4042
}
41-
log('[webpack]', stats.toString());
43+
log("[webpack]", stats.toString());
4244
done();
4345
});
4446
});
4547

4648
gulp.task("node_modules-webpack", (done) => {
4749
const config = require("./webpack.config.js");
4850
config.context = `${__dirname}`;
49-
config.mode = argv.mode ? argv.mode : 'production';
51+
config.mode = argv.mode ? argv.mode : "production";
5052
return webpack(config, (err, stats) => {
5153
const statsJson = stats.toJson();
5254
if (err || (statsJson.errors && statsJson.errors.length)) {
5355
statsJson.errors.forEach(webpackError => {
5456
log.error(`Error (webpack): ${webpackError}`);
5557
});
5658

57-
throw new PluginError('webpack', JSON.stringify(err || statsJson.errors));
59+
throw new PluginError("webpack", JSON.stringify(err || statsJson.errors));
5860
}
59-
log('[webpack]', stats.toString());
61+
log("[webpack]", stats.toString());
6062
done();
6163
});
6264
});
6365

66+
gulp.task("insert-serial-monitor-cli", async (done) => {
67+
const platforms = [
68+
"linux",
69+
"darwin",
70+
"win32",
71+
];
72+
const release = "latest";
73+
const destDir = path.resolve("out", "serial-monitor-cli");
74+
75+
async function downloadAndUnzip(platform) {
76+
const fileName = `${platform}.zip`;
77+
const zipPath = path.join(destDir, fileName);
78+
await download(`https://github.com/microsoft/serial-monitor-cli/releases/${release}/download/${fileName}`,
79+
destDir,
80+
);
81+
await extract(zipPath, { dir: path.join(destDir, platform) });
82+
fs.rmSync(zipPath);
83+
}
84+
85+
Promise.all(platforms.map(downloadAndUnzip)).then(done);
86+
});
87+
6488
gulp.task("ts-compile", () => {
6589
const tsProject = ts.createProject("./tsconfig.json");
6690
return tsProject.src()
@@ -71,13 +95,13 @@ gulp.task("ts-compile", () => {
7195
// Correct source map path.
7296
const relativeSourcePath = path.relative(path.dirname(file.path), path.join(file.base, sourcePath));
7397
return relativeSourcePath;
74-
}
98+
},
7599
}))
76100
.pipe(gulp.dest("out"));
77101
});
78102

79103
gulp.task("clean", (done) => {
80-
return del('out', done);
104+
return del("out", done);
81105
});
82106

83107
gulp.task("genAikey", (done) => {
@@ -100,8 +124,8 @@ gulp.task("test", (done) => {
100124
}
101125

102126
// When using cli command "npm test" to exec test, the depended extensions (cpptools) are not available so that
103-
// the extension cannot be activated. As a workaround, remove extensionDependencies from package.json before running test
104-
// and restore extensionDependencies after test exited.
127+
// the extension cannot be activated. As a workaround, remove extensionDependencies from package.json before
128+
// running test and restore extensionDependencies after test exited.
105129
removeExtensionDependencies();
106130

107131
const child = childProcess.spawn("node", ["./out/test/runTest"], {
@@ -132,11 +156,11 @@ gulp.task("test", (done) => {
132156
});
133157
});
134158

135-
gulp.task("build", gulp.series("clean", "ts-compile", "html-webpack", "node_modules-webpack"));
159+
gulp.task("build", gulp.series("clean", "ts-compile", "html-webpack", "node_modules-webpack", "insert-serial-monitor-cli"));
136160

137161
gulp.task("build_without_view", gulp.series("clean", "ts-compile"));
138162

139163
gulp.task("watch", () => {
140164
gulp.watch(["./src/**/*", "./test/**/*", "!./src/views/**/*"], ["ts-compile"]);
141165
gulp.watch(["./src/views/**/*", "!./src/views/node_modules/**"], ["html-webpack"]);
142-
});
166+
});

0 commit comments

Comments
 (0)