From e1c84e02f8728f80ad53e9334b6e94bef98dd9a9 Mon Sep 17 00:00:00 2001 From: Marc Laval Date: Mon, 27 Oct 2014 17:32:55 +0100 Subject: [PATCH] chore: adds Windows support for build Closes #104 --- gulpfile.js | 6 ++++-- tools/transpiler/index.js | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index a61376c54e..2fc0a65931 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -103,7 +103,8 @@ gulp.task('modules/build.dart/pubspec', function(done) { .pipe(through2.obj(function(file, enc, done) { if (file.previousContents.toString() !== file.contents.toString()) { console.log(file.path + ' changed, calling pub get'); - var stream = spawn('pub', ['get'], { + var pubCmd = (process.platform === "win32" ? "pub.bat" : "pub"); + var stream = spawn(pubCmd, ['get'], { stdio: [process.stdin, process.stdout, process.stderr], cwd: path.dirname(file.path) }); @@ -186,7 +187,8 @@ gulp.task('analyze/dartanalyzer', function(done) { })); function analyze(dirName, done) { - var stream = spawn('dartanalyzer', ['--fatal-warnings', tempFile], { + var dartanalyzerCmd = (process.platform === "win32" ? "dartanalyzer.bat" : "dartanalyzer"); + var stream = spawn(dartanalyzerCmd, ['--fatal-warnings', tempFile], { // inherit stdin and stderr, but filter stdout stdio: [process.stdin, 'pipe', process.stderr], cwd: dirName diff --git a/tools/transpiler/index.js b/tools/transpiler/index.js index 0f28b7c391..577facc33a 100644 --- a/tools/transpiler/index.js +++ b/tools/transpiler/index.js @@ -61,8 +61,9 @@ function loadModule(filepath, transpile) { } if (transpile) { - var moduleName = filepath + var moduleName = path.normalize(filepath) .replace(__dirname, 'transpiler') + .replace(/\\/g, '/') .replace(/\.\w*$/, ''); data = (new traceur.NodeCompiler( extend(SELF_COMPILE_OPTIONS, { moduleName: moduleName } )