You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gm...@apache.org on 2018/10/24 16:21:50 UTC
[6/6] qpid-dispatch git commit: DISPATCH-1151 Revert to gulp version
3.x for console build
DISPATCH-1151 Revert to gulp version 3.x for console build
(cherry picked from commit 0a66246e58df2758eb12abd7aa4e983bcbbee8c9)
Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/5b02bea3
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/5b02bea3
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/5b02bea3
Branch: refs/heads/1.4.x
Commit: 5b02bea38c221684a5b8b03e18af888efe0f90ed
Parents: b6df962
Author: Ernest Allen <ea...@redhat.com>
Authored: Tue Oct 23 09:30:17 2018 -0400
Committer: Ganesh Murthy <gm...@redhat.com>
Committed: Tue Oct 23 09:53:57 2018 -0400
----------------------------------------------------------------------
console/stand-alone/gulpfile.js | 69 +-
console/stand-alone/package-lock.json | 2759 +++++--------------
console/stand-alone/package.json | 3 +-
console/stand-alone/plugin/js/amqp/topology.js | 1 -
4 files changed, 739 insertions(+), 2093 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/5b02bea3/console/stand-alone/gulpfile.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/gulpfile.js b/console/stand-alone/gulpfile.js
index d996135..0951522 100644
--- a/console/stand-alone/gulpfile.js
+++ b/console/stand-alone/gulpfile.js
@@ -38,7 +38,8 @@ const gulp = require('gulp'),
fs = require('fs'),
tsc = require('gulp-typescript'),
tslint = require('gulp-tslint'),
- through = require('through2');
+ through = require('through2'),
+ runSequence = require('run-sequence');
// temp directory for converted typescript files
const built_ts = 'built_ts';
@@ -86,13 +87,15 @@ var touch = through.obj(function(file, enc, done) {
fs.utimes(file.path, now, now, done);
});
-function clean() {
+gulp.task('clean', function () {
return del(['dist',built_ts ]);
-}
-function cleanup() {
+});
+
+gulp.task('cleanup', function () {
return del([built_ts]);
-}
-function styles() {
+});
+
+gulp.task('styles', function () {
return gulp.src(paths.styles.src)
.pipe(maps.init())
.pipe(cleanCSS())
@@ -103,8 +106,9 @@ function styles() {
.pipe(insert.prepend(license))
.pipe(maps.write('./'))
.pipe(gulp.dest(paths.styles.dest));
-}
-function vendor_styles() {
+});
+
+gulp.task('vendor_styles', function () {
var vendor_lines = fs.readFileSync('vendor-css.txt').toString().split('\n');
var vendor_files = vendor_lines.filter( function (line) {
return (!line.startsWith('-') && line.length > 0);
@@ -119,9 +123,10 @@ function vendor_styles() {
}))
.pipe(maps.write('./'))
.pipe(gulp.dest(paths.styles.dest));
-}
+});
+
-function vendor_scripts() {
+gulp.task('vendor_scripts', function () {
var vendor_lines = fs.readFileSync('vendor-js.txt').toString().split('\n');
var vendor_files = vendor_lines.filter( function (line) {
return (!line.startsWith('-') && line.length > 0);
@@ -133,17 +138,21 @@ function vendor_scripts() {
.pipe(maps.write('./'))
.pipe(gulp.dest(paths.scripts.dest))
.pipe(touch);
-}
+});
+
+/*
function watch() {
gulp.watch(paths.scripts.src, scripts);
gulp.watch(paths.styles.src, styles);
}
-function lint() {
+*/
+
+gulp.task('lint', function () {
return gulp.src('plugin/**/*.js')
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
-}
+});
//function _typescript() {
// return tsProject.src({files: src + 'plugin/**/*.ts'})
@@ -151,21 +160,21 @@ function lint() {
// .js.pipe(gulp.dest('build/dist'));
//}
-function typescript() {
+gulp.task('typescript', function() {
var tsResult = gulp.src(paths.typescript.src)
.pipe(tsc());
return tsResult.js.pipe(gulp.dest(paths.typescript.dest));
-}
+});
-function ts_lint() {
+gulp.task('ts_lint', function() {
return gulp.src('plugin/js/**/*.ts')
.pipe(tslint({
formatter: 'verbose'
}))
.pipe(tslint.report());
-}
+});
-function scripts() {
+gulp.task('scripts', function() {
return rollup({
input: src + './main.js',
sourcemap: true,
@@ -216,23 +225,33 @@ function scripts() {
// and output to ./dist/main.js as normal.
.pipe(gulp.dest(paths.scripts.dest));
-}
+});
-function test () {
+gulp.task('test', function() {
return gulp.src(['test/**/*.js'], {read: false})
.pipe(mocha({require: ['babel-core/register'], exit: true}))
.on('error', console.error);
-}
+});
+gulp.task('build', function(callback) {
+ runSequence('clean',
+ 'lint',
+ ['vendor_styles', 'vendor_scripts', 'styles'],
+ 'cleanup',
+ callback);
+});
+/*
+For use with gulp 4.0 when that is supported
var build = gulp.series(
clean, // removes the dist/ dir
lint, // lints the .js
gulp.parallel(vendor_styles, vendor_scripts, styles), // uglify and concat
cleanup // remove .js that were converted from .ts
);
+*/
+/* var vendor = gulp.parallel(vendor_styles, vendor_scripts); */
-var vendor = gulp.parallel(vendor_styles, vendor_scripts);
-
+/*
exports.clean = clean;
exports.watch = watch;
exports.build = build;
@@ -243,5 +262,5 @@ exports.scripts = scripts;
exports.styles = styles;
exports.vendor = vendor;
exports.test = test;
-
-gulp.task('default', build);
+*/
+gulp.task('default', ['build']);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org