now correctly determining release builds
This commit is contained in:
parent
e7e228c900
commit
c8f29dc146
5
dist/index.js
vendored
5
dist/index.js
vendored
@ -4,4 +4,9 @@ console.log("**** starting NPMTS ****");
|
||||
var plugins = require("./npmts.plugins");
|
||||
var promisechain = require("./npmts.promisechain");
|
||||
plugins.beautylog.figletSync("NPMTS");
|
||||
try {
|
||||
promisechain.run();
|
||||
}
|
||||
catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
|
24
dist/npmts.options.js
vendored
24
dist/npmts.options.js
vendored
@ -1,12 +1,19 @@
|
||||
"use strict";
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
var plugins = require("./npmts.plugins");
|
||||
exports.isRelease = function () {
|
||||
if (plugins.smartci.check.isCi() && plugins.smartci.isTaggedCommit()) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
exports.run = function (configArg) {
|
||||
var done = plugins.Q.defer();
|
||||
var config = configArg;
|
||||
if (typeof config.coveralls === "undefined") {
|
||||
config.coveralls = false;
|
||||
}
|
||||
plugins.beautylog.log("now determining build options");
|
||||
//handle default mode
|
||||
if (config.mode == "default") {
|
||||
config.typings = [
|
||||
"./ts/typings.json"
|
||||
@ -17,11 +24,16 @@ exports.run = function (configArg) {
|
||||
_a
|
||||
);
|
||||
config.test = ["./index.js"];
|
||||
done.resolve(config);
|
||||
}
|
||||
else {
|
||||
done.resolve(config);
|
||||
// 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;
|
||||
}
|
||||
done.resolve(config);
|
||||
return done.promise;
|
||||
var _a;
|
||||
};
|
||||
|
32
dist/npmts.plugins.js
vendored
32
dist/npmts.plugins.js
vendored
@ -1,10 +1,9 @@
|
||||
"use strict";
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
var plugins = {
|
||||
beautylog: require("beautylog"),
|
||||
fs: require("fs-extra"),
|
||||
gulp: require("gulp"),
|
||||
g: {
|
||||
exports.beautylog = require("beautylog");
|
||||
exports.fs = require("fs-extra");
|
||||
exports.gulp = require("gulp");
|
||||
exports.g = {
|
||||
coveralls: require("gulp-coveralls"),
|
||||
gFunction: require("gulp-function"),
|
||||
istanbul: require("gulp-istanbul"),
|
||||
@ -13,16 +12,15 @@ var plugins = {
|
||||
sourcemaps: require("gulp-sourcemaps"),
|
||||
typescript: require("gulp-typescript"),
|
||||
typings: require("gulp-typings")
|
||||
},
|
||||
merge2: require("merge2"),
|
||||
projectinfo: require("projectinfo"),
|
||||
sourceMapSupport: require("source-map-support").install(),
|
||||
path: require("path"),
|
||||
Q: require("q"),
|
||||
shelljs: require("shelljs"),
|
||||
smartcli: require("smartcli"),
|
||||
smartenv: require("smartenv"),
|
||||
smartfile: require("smartfile"),
|
||||
smartpath: require("smartpath")
|
||||
};
|
||||
module.exports = plugins;
|
||||
exports.merge2 = require("merge2");
|
||||
exports.projectinfo = require("projectinfo");
|
||||
exports.sourceMapSupport = require("source-map-support").install();
|
||||
exports.path = require("path");
|
||||
exports.Q = require("q");
|
||||
exports.shelljs = require("shelljs");
|
||||
exports.smartci = require("smartci");
|
||||
exports.smartcli = require("smartcli");
|
||||
exports.smartenv = require("smartenv");
|
||||
exports.smartfile = require("smartfile");
|
||||
exports.smartpath = require("smartpath");
|
||||
|
@ -42,6 +42,7 @@
|
||||
"projectinfo": "1.0.1",
|
||||
"q": "^1.4.1",
|
||||
"shelljs": "^0.6.0",
|
||||
"smartci": "0.0.1",
|
||||
"smartcli": "0.0.11",
|
||||
"smartenv": "1.2.0",
|
||||
"smartfile": "2.2.0",
|
||||
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"ambientDependencies": {
|
||||
"node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts#78d36dd49b6b55b9fdfe61776a12bf05c8b07777",
|
||||
"node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts",
|
||||
"mocha": "github:Bartvds/tsd-deftools/typings/DefinitelyTyped/mocha/mocha.d.ts",
|
||||
"colors": "github:DefinitelyTyped/DefinitelyTyped/colors/colors.d.ts#09e37435ffb2c56a6f908081194a74756f24f99d",
|
||||
"vinyl": "github:DefinitelyTyped/DefinitelyTyped/vinyl/vinyl.d.ts#78d36dd49b6b55b9fdfe61776a12bf05c8b07777"
|
||||
"colors": "github:DefinitelyTyped/DefinitelyTyped/colors/colors.d.ts",
|
||||
"vinyl": "github:DefinitelyTyped/DefinitelyTyped/vinyl/vinyl.d.ts"
|
||||
}
|
||||
}
|
||||
|
@ -3,4 +3,11 @@ console.log("**** starting NPMTS ****");
|
||||
import plugins = require("./npmts.plugins");
|
||||
import promisechain = require("./npmts.promisechain");
|
||||
plugins.beautylog.figletSync("NPMTS");
|
||||
|
||||
try {
|
||||
promisechain.run();
|
||||
}
|
||||
catch(err){
|
||||
console.log(err);
|
||||
}
|
||||
|
||||
|
@ -1,11 +1,21 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
import plugins = require("./npmts.plugins");
|
||||
|
||||
export let isRelease = function():boolean {
|
||||
if (plugins.smartci.check.isCi() && plugins.smartci.isTaggedCommit()){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
export var run = function(configArg){
|
||||
var done = plugins.Q.defer();
|
||||
var config = configArg;
|
||||
if (typeof config.coveralls === "undefined"){
|
||||
config.coveralls = false;
|
||||
}
|
||||
|
||||
plugins.beautylog.log("now determining build options");
|
||||
|
||||
//handle default mode
|
||||
if (config.mode == "default"){
|
||||
config.typings = [
|
||||
"./ts/typings.json"
|
||||
@ -15,9 +25,21 @@ export var run = function(configArg){
|
||||
["./test/test.ts"]: "./test/"
|
||||
};
|
||||
config.test = ["./index.js"];
|
||||
done.resolve(config);
|
||||
} else {
|
||||
done.resolve(config);
|
||||
}
|
||||
|
||||
// handle state of current build
|
||||
|
||||
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" || !isRelease())
|
||||
&& plugins.smartci.get.subJobNumber == 1
|
||||
){
|
||||
config.coveralls = false;
|
||||
}
|
||||
|
||||
done.resolve(config);
|
||||
return done.promise;
|
||||
};
|
@ -1,9 +1,8 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
var plugins = {
|
||||
beautylog: require("beautylog"),
|
||||
fs: require("fs-extra"),
|
||||
gulp: require("gulp"),
|
||||
g: {
|
||||
export let beautylog = require("beautylog");
|
||||
export let fs = require("fs-extra");
|
||||
export let gulp = require("gulp");
|
||||
export let g = {
|
||||
coveralls: require("gulp-coveralls"),
|
||||
gFunction: require("gulp-function"),
|
||||
istanbul: require("gulp-istanbul"),
|
||||
@ -13,16 +12,15 @@ var plugins = {
|
||||
typescript: require("gulp-typescript"),
|
||||
typings: require("gulp-typings")
|
||||
|
||||
},
|
||||
merge2: require("merge2"),
|
||||
projectinfo: require("projectinfo"),
|
||||
sourceMapSupport:require("source-map-support").install(),
|
||||
path: require("path"),
|
||||
Q:require("q"),
|
||||
shelljs: require("shelljs"),
|
||||
smartcli: require("smartcli"),
|
||||
smartenv: require("smartenv"),
|
||||
smartfile: require("smartfile"),
|
||||
smartpath: require("smartpath")
|
||||
};
|
||||
export = plugins;
|
||||
export let merge2 = require("merge2");
|
||||
export let projectinfo = require("projectinfo");
|
||||
export let sourceMapSupport = require("source-map-support").install();
|
||||
export let path = require("path");
|
||||
export let Q = require("q");
|
||||
export let shelljs = require("shelljs");
|
||||
export let smartci = require("smartci");
|
||||
export let smartcli = require("smartcli");
|
||||
export let smartenv = require("smartenv");
|
||||
export let smartfile = require("smartfile");
|
||||
export let smartpath = require("smartpath");
|
Loading…
Reference in New Issue
Block a user