forked from google/blockly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
71 lines (60 loc) · 2.23 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/**
* @license
* Copyright 2018 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @fileoverview Gulp script to build Blockly for Node & NPM.
* Run this script by calling "npm install" in this directory.
*/
/* eslint-env node */
const gulp = require('gulp');
const buildTasks = require('./scripts/gulpfiles/build_tasks');
const packageTasks = require('./scripts/gulpfiles/package_tasks');
const gitTasks = require('./scripts/gulpfiles/git_tasks');
const appengineTasks = require('./scripts/gulpfiles/appengine_tasks');
const releaseTasks = require('./scripts/gulpfiles/release_tasks');
const docsTasks = require('./scripts/gulpfiles/docs_tasks');
const testTasks = require('./scripts/gulpfiles/test_tasks');
const path = require('path');
function copyDist() {
const args = process.argv.slice(2);
let destPath = 'dist_copied';
args.forEach((arg, i) => {
if (arg.startsWith('--dest')) {
destPath = args[i + 1];
}
});
destPath = path.resolve(destPath);
return gulp.src('dist/**/*').pipe(gulp.dest(destPath));
}
module.exports = {
// Default target if gulp invoked without specifying.
default: buildTasks.build,
// Main sequence targets. They already invoke prerequisites.
langfiles: buildTasks.langfiles, // Build build/msg/*.js from msg/json/*.
tsc: buildTasks.tsc,
deps: buildTasks.deps,
minify: buildTasks.minify,
build: buildTasks.build,
package: packageTasks.package,
publish: releaseTasks.publish,
publishBeta: releaseTasks.publishBeta,
prepareDemos: appengineTasks.prepareDemos,
deployDemos: appengineTasks.deployDemos,
deployDemosBeta: appengineTasks.deployDemosBeta,
gitUpdateGithubPages: gitTasks.updateGithubPages,
// Manually-invokable targets, with prerequisites where required.
messages: buildTasks.messages, // Generate msg/json/en.json et al.
clean: gulp.parallel(buildTasks.cleanBuildDir, packageTasks.cleanReleaseDir),
test: testTasks.test,
testGenerators: testTasks.generators,
buildAdvancedCompilationTest: buildTasks.buildAdvancedCompilationTest,
gitCreateRC: gitTasks.createRC,
docs: docsTasks.docs,
// Legacy targets, to be deleted.
recompile: releaseTasks.recompile,
gitSyncDevelop: gitTasks.syncDevelop,
gitSyncMaster: gitTasks.syncMaster,
copyDist,
};