Skip to content
Merged
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
3 changes: 2 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module.exports = {
buildCompiled: buildTasks.compiled,
buildAdvancedCompilationTest: buildTasks.advancedCompilationTest,
buildJavaScript: buildTasks.javaScript,
buildJavaScriptAndDeps: gulp.series(buildTasks.javaScript, buildTasks.deps),
buildJavaScriptAndDeps: buildTasks.javaScriptAndDeps,
// TODO(5621): Re-enable once typings generation is fixed.
// checkin: gulp.parallel(buildTasks.checkinBuilt, typings.checkinTypings),
checkin: gulp.parallel(buildTasks.checkinBuilt),
Expand All @@ -48,6 +48,7 @@ module.exports = {
// typings: gulp.series(typings.typings, typings.msgTypings),
// checkinTypings: typings.checkinTypings,
package: packageTasks.package,
prepare: buildTasks.prepare,
checkLicenses: licenseTasks.checkLicenses,
recompile: releaseTasks.recompile,
prepareDemos: appengineTasks.prepareDemos,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"license": "gulp checkLicenses",
"lint": "eslint .",
"package": "gulp package",
"prepare": "gulp buildJavaScriptAndDeps",
"prepare": "gulp prepare",
"prepareDemos": "gulp prepareDemos",
"publish": "gulp publish",
"publish:beta": "gulp publishBeta",
Expand Down
22 changes: 22 additions & 0 deletions scripts/gulpfiles/build_tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,26 @@ var JSCOMP_OFF = [
'visibility',
];

/**
* The npm prepare script, run by npm install after installing modules
* and as part of the packaging process.
*
* This does just enough of the build that npm start should work.
*
* Exception: when running in the CI environment, we don't build
* anything. We don't need to, because npm test will build everything
* needed, and we don't want to, because a tsc error would prevent
* other workflows (like lint and format) from completing.
*/
function prepare() {
if (process.env.CI) {
return gulp.src('.'); // Do nothing.
}
return buildJavaScriptAndDeps();
}

const buildJavaScriptAndDeps = gulp.series(buildJavaScript, buildDeps);

/**
* Builds Blockly as a JS program, by running tsc on all the files in
* the core directory. This must be run before buildDeps or
Expand Down Expand Up @@ -697,7 +717,9 @@ function format() {
};

module.exports = {
prepare: prepare,
build: build,
javaScriptAndDeps: buildJavaScriptAndDeps,
javaScript: buildJavaScript,
deps: buildDeps,
generateLangfiles: generateLangfiles,
Expand Down