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

optimize activation time of Arduino #864

Closed
wants to merge 6 commits into from
Closed
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
6 changes: 5 additions & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ tslint.json
.travis.yml
gulpfile.js
*.vsix
.github/**
.github/**
*.log
webpack.config.js
node_modules/**
vendor/**
25 changes: 24 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const runSequence = require('run-sequence');
const del = require('del');

const fs = require("fs");
const fsp = require('fs-plus');
const path = require("path");
const childProcess = require("child_process");

Expand Down Expand Up @@ -43,6 +44,23 @@ gulp.task("html-webpack", (done) => {
});
});

gulp.task("node_modules-webpack", (done) => {
const config = require("./webpack.config.js");
config.context = `${__dirname}`;
return webpack(config, (err, stats) => {
const statsJson = stats.toJson();
if (err || (statsJson.errors && statsJson.errors.length)) {
statsJson.errors.forEach(webpackError => {
gutil.log(gutil.colors.red(`Error (webpack): ${webpackError}`));
});

throw new gutil.PluginError('webpack', JSON.stringify(err || statsJson.errors));
}
gutil.log('[webpack]', stats.toString());
done();
});
});

gulp.task("ts-compile", () => {
const tsProject = ts.createProject("./tsconfig.json");
return tsProject.src()
Expand Down Expand Up @@ -78,6 +96,11 @@ gulp.task("genAikey", (done) => {
}
});

gulp.task("copyVendor", (done) => {
fsp.copySync('vendor', 'out/vendor');
done();
});

gulp.task("test", (done) => {
function removeExtensionDependencies() {
const packageJson = JSON.parse(fs.readFileSync("package.json"));
Expand Down Expand Up @@ -123,7 +146,7 @@ gulp.task("test", (done) => {
});

gulp.task("build", (done) => {
return runSequence("clean", "ts-compile", "html-webpack", done);
return runSequence("clean", "ts-compile", "html-webpack", "node_modules-webpack", "copyVendor", done);
});

gulp.task("build_without_view", (done) => {
Expand Down
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vscode-arduino",
"displayName": "Arduino",
"description": "Arduino for Visual Studio Code",
"version": "0.2.27",
"version": "0.2.28",
"publisher": "vsciot-vscode",
"aiKey": "83dd2c27-6594-41d3-85a9-bdb22070eb42",
"preview": true,
Expand Down Expand Up @@ -575,6 +575,7 @@
"express": "^4.14.1",
"glob": "^7.1.1",
"iconv-lite": "^0.4.18",
"impor": "^0.1.1",
"properties": "^1.2.1",
"uuid": "^3.0.1",
"vscode-extension-telemetry": "0.0.18",
Expand Down
2 changes: 1 addition & 1 deletion src/debug/debuggerManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class DebuggerManager {
}
}
}
this._usbDetector = require("../../../vendor/node-usb-native").detector;
this._usbDetector = require("../../vendor/node-usb-native").detector;
this._debugServerPath = platform.findFile(platform.getExecutableFileName("openocd"),
path.join(this._arduinoSettings.packagePath, "packages"));
if (!util.fileExistsSync(this._debugServerPath)) {
Expand Down
Loading