You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.1 KiB
49 lines
1.1 KiB
"use strict";
|
|
|
|
var spawn = require('child_process').spawn;
|
|
|
|
module.exports = function (params, processor) {
|
|
return {
|
|
process: function () {
|
|
var result = "",
|
|
error = "",
|
|
builder = spawn("../DotNetBuilder/bin/Debug/DotNetBuilder.exe");
|
|
|
|
wrapper.stdout.on('data', function (data) {
|
|
result += data;
|
|
});
|
|
wrapper.stderr.on('data', function (data) {
|
|
error += data;
|
|
});
|
|
wrapper.on('exit', function (code) {
|
|
if (code !== 0) {
|
|
error = "Return code is " + code + "\r\n" + error;
|
|
processor.onError(error);
|
|
return done();
|
|
}
|
|
|
|
var report = JSON.parse(result);
|
|
foreach (var i = 0; i < report.length; i++) {
|
|
switch(report[i].Type) {
|
|
case "info":
|
|
processor.onError(report[i].Body);
|
|
break;
|
|
case "warn":
|
|
processor.onError(report[i].Body);
|
|
break;
|
|
default:
|
|
processor.onError(report[i].Body);
|
|
break;
|
|
}
|
|
}
|
|
return done();
|
|
});
|
|
|
|
wrapper.stdin.write({
|
|
"SolutionPath": process.context.exported + "/" + params.solution,
|
|
"OutputPath": process.context.release + "/" + params.solution + "/"
|
|
});
|
|
wrapper.stdin.end();
|
|
}
|
|
};
|
|
};
|
|
|