diff --git a/gulpfile.js b/gulpfile.js index d1d07c3ef6..bd7e01e158 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -9,6 +9,7 @@ var gulp = require('gulp'); var gulpPlugins = require('gulp-load-plugins')(); var sass = require('gulp-sass'); var shell = require('gulp-shell'); +var spawn = require('child_process').spawn; var runSequence = require('run-sequence'); var madge = require('madge'); var merge = require('merge'); @@ -25,7 +26,6 @@ var pubbuild = require('./tools/build/pubbuild'); var dartanalyzer = require('./tools/build/dartanalyzer'); var jsserve = require('./tools/build/jsserve'); var pubserve = require('./tools/build/pubserve'); -var rundartpackage = require('./tools/build/rundartpackage'); var file2moduleName = require('./tools/build/file2modulename'); var karma = require('karma'); var minimist = require('minimist'); @@ -104,10 +104,6 @@ var CONFIG = { }, dart: 'dist/dart', docs: 'dist/docs' - }, - formatDart: { - packageName: 'dart_style', - args: ['dart_style:format', '-w', 'dist/dart'] } }; @@ -176,11 +172,11 @@ gulp.task('build/pubbuild.dart', pubbuild(gulp, gulpPlugins, { // ------------ // formatting -gulp.task('build/format.dart', rundartpackage(gulp, gulpPlugins, { - pub: DART_SDK.PUB, - packageName: CONFIG.formatDart.packageName, - args: CONFIG.formatDart.args -})); +gulp.task('build/format.dart', function() { + return util.processToPromise(spawn(DART_SDK.DARTFMT, ['-w', CONFIG.dest.dart], { + stdio: 'inherit' + })); +}); function doCheckFormat() { return gulp.src(['Brocfile*.js', 'modules/**/*.ts', 'tools/**/*.ts', '!**/typings/**/*.d.ts', diff --git a/tools/build/dartdetect.js b/tools/build/dartdetect.js index 1c2c8e50a8..9bd22c2f2b 100644 --- a/tools/build/dartdetect.js +++ b/tools/build/dartdetect.js @@ -8,12 +8,14 @@ module.exports = function(gulp) { if (process.platform === 'win32') { DART_SDK = { PUB: 'pub.bat', - ANALYZER: 'dartanalyzer.bat' + ANALYZER: 'dartanalyzer.bat', + DARTFMT: 'dartfmt.bat' }; } else { DART_SDK = { PUB: 'pub', - ANALYZER: 'dartanalyzer' + ANALYZER: 'dartanalyzer', + DARTFMT: 'dartfmt' }; } } catch (e) {