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

Reduce time #874

Merged
merged 15 commits into from
Sep 26, 2019
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ node_js:
os:
- linux
- osx
# dist: trusty # using Ubuntu 14.04.5 LTS
dist: trusty # using Ubuntu 14.04.5 LTS

# fixing https://github.com/Microsoft/vscode/issues/33998
addons:
Expand Down
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/**
28 changes: 26 additions & 2 deletions 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 @@ -117,13 +140,14 @@ gulp.task("test", (done) => {
if (code === 0) {
done();
} else {
gutil.log("exit code: " + code);
done(code);
}
});
});

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 All @@ -133,4 +157,4 @@ gulp.task("build_without_view", (done) => {
gulp.task("watch", () => {
gulp.watch(["./src/**/*", "./test/**/*", "!./src/views/**/*"], ["ts-compile"]);
gulp.watch(["./src/views/**/*", "!./src/views/node_modules/**"], ["html-webpack"]);
});
});
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.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -465,9 +465,9 @@
"verbose"
]
},
"arduino.openPDEFiletype":{
"type":"boolean",
"default":false,
"arduino.openPDEFiletype": {
"type": "boolean",
"default": false,
"description": "Allow VSCode Arduino to open PDE sketches, from pre-1.0.0 versions of Arduino"
},
"arduino.enableUSBDetection": {
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