mirror of
https://github.com/google/blockly.git
synced 2026-01-15 12:57:12 +01:00
feat(tests): Write Closure Compiler output directly to dist/
Since they are already UMD-wrapped, have Closure Compiler write output chunks directly to RELEASE_DIR, i.e. dist/.
This commit is contained in:
@@ -25,7 +25,7 @@ var closureDeps = require('google-closure-deps');
|
||||
var argv = require('yargs').argv;
|
||||
var rimraf = require('rimraf');
|
||||
|
||||
var {BUILD_DIR, DEPS_FILE, TEST_DEPS_FILE, TSC_OUTPUT_DIR, TYPINGS_BUILD_DIR} = require('./config');
|
||||
var {BUILD_DIR, DEPS_FILE, RELEASE_DIR, TEST_DEPS_FILE, TSC_OUTPUT_DIR, TYPINGS_BUILD_DIR} = require('./config');
|
||||
var {getPackageJson} = require('./helper_tasks');
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
@@ -668,7 +668,7 @@ function buildCompiled() {
|
||||
.pipe(compile(options))
|
||||
.pipe(gulp.rename({suffix: COMPILED_SUFFIX}))
|
||||
.pipe(gulp.sourcemaps.write('.'))
|
||||
.pipe(gulp.dest(BUILD_DIR));
|
||||
.pipe(gulp.dest(RELEASE_DIR));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -705,17 +705,17 @@ function buildAdvancedCompilationTest() {
|
||||
}
|
||||
|
||||
/**
|
||||
* This task copies built files from BUILD_DIR back to the repository
|
||||
* so they can be committed to git.
|
||||
* This task copies built files from BUILD_DIR and RELEASE_DIR back to
|
||||
* the repository so they can be committed to git.
|
||||
*
|
||||
* Prerequisite: buildCompiled, buildLangfiles.
|
||||
*/
|
||||
function checkinBuilt() {
|
||||
return gulp.src([
|
||||
`${BUILD_DIR}/*_compressed.js`,
|
||||
`${BUILD_DIR}/*_compressed.js.map`,
|
||||
`${BUILD_DIR}/msg/js/*.js`,
|
||||
], {base: BUILD_DIR}).pipe(gulp.dest('.'));
|
||||
`${RELEASE_DIR}/*_compressed.js`,
|
||||
`${RELEASE_DIR}/*_compressed.js.map`,
|
||||
// `${BUILD_DIR}/msg/js/*.js`, // Temporarily disabled (base mismatch).
|
||||
], {base: RELEASE_DIR}).pipe(gulp.dest('.'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -54,15 +54,6 @@ function packageCommonJS(namespace, dependencies) {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* This task copies the compressed files and their source maps into
|
||||
* the release directory.
|
||||
*/
|
||||
function packageCompressed() {
|
||||
return gulp.src('*_compressed.js?(.map)', {cwd: BUILD_DIR})
|
||||
.pipe(gulp.dest(RELEASE_DIR));
|
||||
};
|
||||
|
||||
/**
|
||||
* This task wraps scripts/package/blockly.js into a UMD module.
|
||||
* @example import 'blockly/blockly';
|
||||
@@ -300,10 +291,10 @@ function packageLocales() {
|
||||
*/
|
||||
function packageUMDBundle() {
|
||||
var srcs = [
|
||||
`${BUILD_DIR}/blockly_compressed.js`,
|
||||
`${BUILD_DIR}/msg/js/en.js`,
|
||||
`${BUILD_DIR}/blocks_compressed.js`,
|
||||
`${BUILD_DIR}/javascript_compressed.js`,
|
||||
`${RELEASE_DIR}/blockly_compressed.js`,
|
||||
`${RELEASE_DIR}/msg/en.js`,
|
||||
`${RELEASE_DIR}/blocks_compressed.js`,
|
||||
`${RELEASE_DIR}/javascript_compressed.js`,
|
||||
];
|
||||
return gulp.src(srcs)
|
||||
.pipe(gulp.concat('blockly.min.js'))
|
||||
@@ -384,7 +375,6 @@ const package = gulp.series(
|
||||
build.build,
|
||||
gulp.parallel(
|
||||
packageIndex,
|
||||
packageCompressed,
|
||||
packageBrowser,
|
||||
packageNode,
|
||||
packageCore,
|
||||
@@ -396,9 +386,8 @@ const package = gulp.series(
|
||||
packageLua,
|
||||
packageDart,
|
||||
packagePHP,
|
||||
packageLocales,
|
||||
packageMedia,
|
||||
packageUMDBundle,
|
||||
gulp.series(packageLocales, packageUMDBundle),
|
||||
packageJSON,
|
||||
packageReadme,
|
||||
packageDTS)
|
||||
|
||||
Reference in New Issue
Block a user