mirror of
https://github.com/google/blockly.git
synced 2026-01-06 08:30:13 +01:00
26
gulpfile.js
26
gulpfile.js
@@ -10,9 +10,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
var gulp = require('gulp');
|
var gulp = require('gulp');
|
||||||
var execSync = require('child_process').execSync;
|
|
||||||
|
|
||||||
var packageJson = require('./package.json');
|
|
||||||
|
|
||||||
var typings = require('./scripts/gulpfiles/typings');
|
var typings = require('./scripts/gulpfiles/typings');
|
||||||
var buildTasks = require('./scripts/gulpfiles/build_tasks');
|
var buildTasks = require('./scripts/gulpfiles/build_tasks');
|
||||||
@@ -20,27 +17,6 @@ var packageTasks = require('./scripts/gulpfiles/package_tasks');
|
|||||||
var gitTasks = require('./scripts/gulpfiles/git_tasks');
|
var gitTasks = require('./scripts/gulpfiles/git_tasks');
|
||||||
var licenseTasks = require('./scripts/gulpfiles/license_tasks');
|
var licenseTasks = require('./scripts/gulpfiles/license_tasks');
|
||||||
|
|
||||||
// See https://docs.npmjs.com/cli/version.
|
|
||||||
const preversion = gulp.series(
|
|
||||||
gitTasks.syncMaster,
|
|
||||||
function(done) {
|
|
||||||
// Create a branch named bump_version for the bump and rebuild.
|
|
||||||
execSync('git checkout -b bump_version', { stdio: 'inherit' });
|
|
||||||
done();
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
// See https://docs.npmjs.com/cli/version
|
|
||||||
function postversion(done) {
|
|
||||||
// Push both the branch and tag to google/blockly.
|
|
||||||
execSync('git push ' + upstream_url + ' bump_version',
|
|
||||||
{ stdio: 'inherit' });
|
|
||||||
var tagName = 'v' + packageJson.version;
|
|
||||||
execSync('git push ' + upstream_url + ' ' + tagName,
|
|
||||||
{ stdio: 'inherit' });
|
|
||||||
done();
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
default: buildTasks.build,
|
default: buildTasks.build,
|
||||||
build: buildTasks.build,
|
build: buildTasks.build,
|
||||||
@@ -50,8 +26,6 @@ module.exports = {
|
|||||||
buildUncompressed: buildTasks.uncompressed,
|
buildUncompressed: buildTasks.uncompressed,
|
||||||
buildCompressed: buildTasks.compressed,
|
buildCompressed: buildTasks.compressed,
|
||||||
buildGenerators: buildTasks.generators,
|
buildGenerators: buildTasks.generators,
|
||||||
preversion: preversion,
|
|
||||||
postversion: postversion,
|
|
||||||
gitSyncDevelop: gitTasks.syncDevelop,
|
gitSyncDevelop: gitTasks.syncDevelop,
|
||||||
gitSyncMaster: gitTasks.syncMaster,
|
gitSyncMaster: gitTasks.syncMaster,
|
||||||
gitCreateRC: gitTasks.createRC,
|
gitCreateRC: gitTasks.createRC,
|
||||||
|
|||||||
11
package.json
11
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "blockly",
|
"name": "blockly",
|
||||||
"version": "3.20200402.0-develop",
|
"version": "3.20200402.0",
|
||||||
"description": "Blockly is a library for building visual programming editors.",
|
"description": "Blockly is a library for building visual programming editors.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"blockly"
|
"blockly"
|
||||||
@@ -26,14 +26,12 @@
|
|||||||
"build:generators": "gulp buildGenerators",
|
"build:generators": "gulp buildGenerators",
|
||||||
"build:langfiles": "gulp buildLangfiles",
|
"build:langfiles": "gulp buildLangfiles",
|
||||||
"build:uncompressed": "gulp buildUncompressed",
|
"build:uncompressed": "gulp buildUncompressed",
|
||||||
"bump": "npm version 3.$(date +'%Y%m%d').0",
|
"bump": "npm --no-git-tag-version version 3.$(date +'%Y%m%d').0",
|
||||||
"license": "gulp checkLicenses",
|
"license": "gulp checkLicenses",
|
||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
"package": "gulp package",
|
"package": "gulp package",
|
||||||
"postversion": "gulp postversion",
|
|
||||||
"prepare": "npm run package",
|
"prepare": "npm run package",
|
||||||
"preversion": "gulp preversion",
|
"recompile": "gulp gitRecompile",
|
||||||
"prerelease": "gulp gitRecompile",
|
|
||||||
"release": "gulp gitCreateRC",
|
"release": "gulp gitCreateRC",
|
||||||
"test": "concurrently 'npm run test:prepare' 'sleep 5 && npm run test:run'",
|
"test": "concurrently 'npm run test:prepare' 'sleep 5 && npm run test:run'",
|
||||||
"test:prepare": "npm run test:setupselenium && npm run test:startselenium",
|
"test:prepare": "npm run test:setupselenium && npm run test:startselenium",
|
||||||
@@ -41,8 +39,7 @@
|
|||||||
"test:setupselenium": "selenium-standalone install --config=./tests/scripts/selenium-config.js",
|
"test:setupselenium": "selenium-standalone install --config=./tests/scripts/selenium-config.js",
|
||||||
"test:startselenium": "selenium-standalone start --config=./tests/scripts/selenium-config.js",
|
"test:startselenium": "selenium-standalone start --config=./tests/scripts/selenium-config.js",
|
||||||
"typings": "gulp typings",
|
"typings": "gulp typings",
|
||||||
"updateGithubPages": "gulp gitUpdateGithubPages",
|
"updateGithubPages": "gulp gitUpdateGithubPages"
|
||||||
"version": "gulp build && git add -A"
|
|
||||||
},
|
},
|
||||||
"main": "./index.js",
|
"main": "./index.js",
|
||||||
"umd": "./blockly.min.js",
|
"umd": "./blockly.min.js",
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
var gulp = require('gulp');
|
var gulp = require('gulp');
|
||||||
var execSync = require('child_process').execSync;
|
var execSync = require('child_process').execSync;
|
||||||
|
var exec = require('child_process').exec;
|
||||||
|
|
||||||
var typings = require('./typings');
|
var typings = require('./typings');
|
||||||
var buildTasks = require('./build_tasks');
|
var buildTasks = require('./build_tasks');
|
||||||
@@ -56,7 +57,7 @@ function getRCBranchName() {
|
|||||||
return 'rc_' + yyyy + '_' + mm;
|
return 'rc_' + yyyy + '_' + mm;
|
||||||
};
|
};
|
||||||
|
|
||||||
// If branch does not exist then create the branch.
|
// If branch does not exist then create the branch.
|
||||||
// If branch exists switch to branch.
|
// If branch exists switch to branch.
|
||||||
function checkoutBranch(branchName) {
|
function checkoutBranch(branchName) {
|
||||||
execSync('git checkout ' + branchName + ' || git checkout -b ' + branchName,
|
execSync('git checkout ' + branchName + ' || git checkout -b ' + branchName,
|
||||||
@@ -65,13 +66,17 @@ function checkoutBranch(branchName) {
|
|||||||
|
|
||||||
// Recompile and push to origin.
|
// Recompile and push to origin.
|
||||||
const recompile = gulp.series(
|
const recompile = gulp.series(
|
||||||
syncDevelop,
|
syncDevelop(),
|
||||||
function(done) {
|
function(done) {
|
||||||
var branchName = getRebuildBranchName();
|
var branchName = getRebuildBranchName();
|
||||||
console.log('make-rebuild-branch: creating branch ' + branchName);
|
console.log('make-rebuild-branch: creating branch ' + branchName);
|
||||||
execSync('git checkout -b ' + branchName, { stdio: 'inherit' });
|
execSync('git checkout -b ' + branchName, { stdio: 'inherit' });
|
||||||
done();
|
done();
|
||||||
},
|
},
|
||||||
|
function(done) {
|
||||||
|
exec('npm run bump');
|
||||||
|
done();
|
||||||
|
},
|
||||||
buildTasks.build,
|
buildTasks.build,
|
||||||
typings.typings,
|
typings.typings,
|
||||||
function(done) {
|
function(done) {
|
||||||
@@ -88,7 +93,7 @@ const recompile = gulp.series(
|
|||||||
// Create and push an RC branch.
|
// Create and push an RC branch.
|
||||||
// Note that this pushes to google/blockly.
|
// Note that this pushes to google/blockly.
|
||||||
const createRC = gulp.series(
|
const createRC = gulp.series(
|
||||||
syncDevelop,
|
syncDevelop(),
|
||||||
function(done) {
|
function(done) {
|
||||||
var branchName = getRCBranchName();
|
var branchName = getRCBranchName();
|
||||||
execSync('git checkout -b ' + branchName, { stdio: 'inherit' });
|
execSync('git checkout -b ' + branchName, { stdio: 'inherit' });
|
||||||
|
|||||||
Reference in New Issue
Block a user