2016-03-12 09:21:16 +00:00
|
|
|
"use strict";
|
2016-02-19 23:53:23 +00:00
|
|
|
/// <reference path="./typings/main.d.ts" />
|
|
|
|
var plugins = require("./npmts.plugins");
|
2016-03-23 13:12:58 +00:00
|
|
|
exports.isRelease = function () {
|
2016-03-23 14:23:04 +00:00
|
|
|
if (plugins.smartci.check.isCi() && plugins.smartci.check.isTaggedCommit()) {
|
2016-03-23 13:12:58 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
};
|
2016-02-19 23:53:23 +00:00
|
|
|
exports.run = function (configArg) {
|
2016-02-22 21:22:39 +00:00
|
|
|
var done = plugins.Q.defer();
|
2016-02-19 23:53:23 +00:00
|
|
|
var config = configArg;
|
2016-03-23 13:12:58 +00:00
|
|
|
plugins.beautylog.log("now determining build options");
|
|
|
|
//handle default mode
|
2016-02-19 23:53:23 +00:00
|
|
|
if (config.mode == "default") {
|
|
|
|
config.typings = [
|
2016-03-12 09:21:16 +00:00
|
|
|
"./ts/typings.json"
|
2016-02-19 23:53:23 +00:00
|
|
|
];
|
|
|
|
config.ts = (_a = {},
|
|
|
|
_a["./ts/**/*.ts"] = "./dist/",
|
|
|
|
_a["./test/test.ts"] = "./test/",
|
|
|
|
_a
|
|
|
|
);
|
|
|
|
config.test = ["./index.js"];
|
|
|
|
}
|
2016-03-23 13:12:58 +00:00
|
|
|
// handle state of current build
|
|
|
|
exports.isRelease() ? plugins.beautylog.info("All right this is a release build!")
|
|
|
|
: plugins.beautylog.info("not a release build!");
|
|
|
|
// handle coveralls
|
|
|
|
if ((typeof config.coveralls === "undefined" || !exports.isRelease())
|
|
|
|
&& plugins.smartci.get.subJobNumber == 1) {
|
|
|
|
config.coveralls = false;
|
2016-02-19 23:53:23 +00:00
|
|
|
}
|
2016-03-23 13:12:58 +00:00
|
|
|
done.resolve(config);
|
2016-02-19 23:53:23 +00:00
|
|
|
return done.promise;
|
|
|
|
var _a;
|
|
|
|
};
|