Skip to content

Commit e1c84e0

Browse files
marclavalmhevery
authored andcommitted
chore: adds Windows support for build
Closes angular#104
1 parent 87b0d3f commit e1c84e0

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

gulpfile.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ gulp.task('modules/build.dart/pubspec', function(done) {
103103
.pipe(through2.obj(function(file, enc, done) {
104104
if (file.previousContents.toString() !== file.contents.toString()) {
105105
console.log(file.path + ' changed, calling pub get');
106-
var stream = spawn('pub', ['get'], {
106+
var pubCmd = (process.platform === "win32" ? "pub.bat" : "pub");
107+
var stream = spawn(pubCmd, ['get'], {
107108
stdio: [process.stdin, process.stdout, process.stderr],
108109
cwd: path.dirname(file.path)
109110
});
@@ -186,7 +187,8 @@ gulp.task('analyze/dartanalyzer', function(done) {
186187
}));
187188

188189
function analyze(dirName, done) {
189-
var stream = spawn('dartanalyzer', ['--fatal-warnings', tempFile], {
190+
var dartanalyzerCmd = (process.platform === "win32" ? "dartanalyzer.bat" : "dartanalyzer");
191+
var stream = spawn(dartanalyzerCmd, ['--fatal-warnings', tempFile], {
190192
// inherit stdin and stderr, but filter stdout
191193
stdio: [process.stdin, 'pipe', process.stderr],
192194
cwd: dirName

tools/transpiler/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@ function loadModule(filepath, transpile) {
6161
}
6262

6363
if (transpile) {
64-
var moduleName = filepath
64+
var moduleName = path.normalize(filepath)
6565
.replace(__dirname, 'transpiler')
66+
.replace(/\\/g, '/')
6667
.replace(/\.\w*$/, '');
6768
data = (new traceur.NodeCompiler(
6869
extend(SELF_COMPILE_OPTIONS, { moduleName: moduleName } )

0 commit comments

Comments
 (0)