tscoverage/ts/npmts.options.ts

48 lines
1.4 KiB
TypeScript
Raw Normal View History

2016-02-19 23:53:23 +00:00
/// <reference path="./typings/main.d.ts" />
import plugins = require("./npmts.plugins");
export let isRelease = function():boolean {
2016-03-23 14:47:28 +00:00
return plugins.smartci.check.isCi()
&& plugins.smartci.check.isTaggedCommit();
};
export let doPublish = function():boolean {
return isRelease()
&& plugins.smartci.get.subJobNumber() != 1;
};
2016-02-19 23:53:23 +00:00
export var 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;
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 = {
["./ts/**/*.ts"]: "./dist/",
["./test/test.ts"]: "./test/"
};
config.test = ["./index.js"];
}
// handle state of current build
2016-03-23 14:47:28 +00:00
isRelease() ? plugins.beautylog.info("All right: This is a RELEASE build!")
: plugins.beautylog.info("NOT A RELEASE build! We are not publishing anything!");
// handle coveralls
2016-03-23 14:47:28 +00:00
config.coveralls ? void(0) : config.coveralls = false;
doPublish() ? void(0) : config.coveralls = false;
// handle docs
config.docs ? void(0) : config.docs = {};
config.docs.publish ? void(0) : config.docs.publish = false;
doPublish() ? void(0) : config.docs.publish = false;
done.resolve(config);
2016-02-19 23:53:23 +00:00
return done.promise;
};