chore: use SDK dartfmt

This commit is contained in:
Kevin Moore 2015-05-08 19:23:49 -07:00
parent 229e770a1d
commit 98e7a38e50
2 changed files with 10 additions and 12 deletions

View File

@ -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',

View File

@ -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) {