chore(windows): fix the build.dart task

This commit is contained in:
Marc Laval 2015-06-23 17:18:04 +02:00
parent 7e8a2b9cec
commit ecb2bd0cbe
3 changed files with 7 additions and 3 deletions

View File

@ -17,7 +17,7 @@ class Codegen {
{String prefix}) {String prefix})
: this.prefix = prefix == null ? _PREFIX_BASE : prefix, : this.prefix = prefix == null ? _PREFIX_BASE : prefix,
importUris = newEntryPointPaths.map((p) => importUris = newEntryPointPaths.map((p) =>
path.relative(p, from: path.dirname(reflectionEntryPointPath))) { path.relative(p, from: path.dirname(reflectionEntryPointPath)).replaceAll('\\', '/')) {
if (this.prefix.isEmpty) throw new ArgumentError.value('(empty)', 'prefix'); if (this.prefix.isEmpty) throw new ArgumentError.value('(empty)', 'prefix');
} }

View File

@ -24,7 +24,7 @@ module.exports = function(gulp, plugins, config) {
libFiles.concat(testFiles).concat(webFiles).forEach(function(fileName, index) { libFiles.concat(testFiles).concat(webFiles).forEach(function(fileName, index) {
if (fileName !== tempFile && fileName.indexOf("/packages/") === -1) { if (fileName !== tempFile && fileName.indexOf("/packages/") === -1) {
if (fileName.indexOf('lib') == 0) { if (fileName.indexOf('lib') == 0) {
fileName = 'package:' + packageName + '/' + path.relative('lib', fileName); fileName = 'package:' + packageName + '/' + path.relative('lib', fileName).replace(/\\/g, '/');
} }
analyzeFile.push('import "' + fileName + '" as mod' + index + ';'); analyzeFile.push('import "' + fileName + '" as mod' + index + ';');
} }
@ -54,6 +54,10 @@ module.exports = function(gulp, plugins, config) {
var errorCount = 0; var errorCount = 0;
var warningCount = 0; var warningCount = 0;
rl.on('line', function(line) { rl.on('line', function(line) {
if (line == "find: > bin [: No such file or directory") {
//Skip bad output from Dart SDK .bat files on Windows
return;
}
var parsedLine = _AnalyzerOutputLine.parse(line); var parsedLine = _AnalyzerOutputLine.parse(line);
if (!parsedLine) { if (!parsedLine) {
errorCount++; errorCount++;

View File

@ -48,7 +48,7 @@ function replaceDartWithJsScripts(gulp, folder) {
function removeWebFolder(gulp, folder) { function removeWebFolder(gulp, folder) {
var folders = [].slice.call(glob.sync(path.join(folder, 'web', '*'))); var folders = [].slice.call(glob.sync(path.join(folder, 'web', '*')));
folders.forEach(function(subFolder) { folders.forEach(function(subFolder) {
fs.renameSync(subFolder, subFolder.replace(path.sep + 'web' + path.sep, path.sep)); fs.renameSync(subFolder, subFolder.replace('/web/', '/'));
}); });
fs.rmdirSync(path.join(folder, 'web')); fs.rmdirSync(path.join(folder, 'web'));
return Q.resolve(); return Q.resolve();