now correctly determining release builds

This commit is contained in:
Philipp Kunz 2016-03-23 14:12:58 +01:00
parent e7e228c900
commit c8f29dc146
8 changed files with 110 additions and 67 deletions

7
dist/index.js vendored
View File

@ -4,4 +4,9 @@ console.log("**** starting NPMTS ****");
var plugins = require("./npmts.plugins"); var plugins = require("./npmts.plugins");
var promisechain = require("./npmts.promisechain"); var promisechain = require("./npmts.promisechain");
plugins.beautylog.figletSync("NPMTS"); plugins.beautylog.figletSync("NPMTS");
promisechain.run(); try {
promisechain.run();
}
catch (err) {
console.log(err);
}

24
dist/npmts.options.js vendored
View File

@ -1,12 +1,19 @@
"use strict"; "use strict";
/// <reference path="./typings/main.d.ts" /> /// <reference path="./typings/main.d.ts" />
var plugins = require("./npmts.plugins"); 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) { exports.run = function (configArg) {
var done = plugins.Q.defer(); var done = plugins.Q.defer();
var config = configArg; var config = configArg;
if (typeof config.coveralls === "undefined") { plugins.beautylog.log("now determining build options");
config.coveralls = false; //handle default mode
}
if (config.mode == "default") { if (config.mode == "default") {
config.typings = [ config.typings = [
"./ts/typings.json" "./ts/typings.json"
@ -17,11 +24,16 @@ exports.run = function (configArg) {
_a _a
); );
config.test = ["./index.js"]; config.test = ["./index.js"];
done.resolve(config);
} }
else { // handle state of current build
done.resolve(config); 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; return done.promise;
var _a; var _a;
}; };

32
dist/npmts.plugins.js vendored
View File

@ -1,10 +1,9 @@
"use strict"; "use strict";
/// <reference path="./typings/main.d.ts" /> /// <reference path="./typings/main.d.ts" />
var plugins = { exports.beautylog = require("beautylog");
beautylog: require("beautylog"), exports.fs = require("fs-extra");
fs: require("fs-extra"), exports.gulp = require("gulp");
gulp: require("gulp"), exports.g = {
g: {
coveralls: require("gulp-coveralls"), coveralls: require("gulp-coveralls"),
gFunction: require("gulp-function"), gFunction: require("gulp-function"),
istanbul: require("gulp-istanbul"), istanbul: require("gulp-istanbul"),
@ -13,16 +12,15 @@ var plugins = {
sourcemaps: require("gulp-sourcemaps"), sourcemaps: require("gulp-sourcemaps"),
typescript: require("gulp-typescript"), typescript: require("gulp-typescript"),
typings: require("gulp-typings") 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");

View File

@ -42,6 +42,7 @@
"projectinfo": "1.0.1", "projectinfo": "1.0.1",
"q": "^1.4.1", "q": "^1.4.1",
"shelljs": "^0.6.0", "shelljs": "^0.6.0",
"smartci": "0.0.1",
"smartcli": "0.0.11", "smartcli": "0.0.11",
"smartenv": "1.2.0", "smartenv": "1.2.0",
"smartfile": "2.2.0", "smartfile": "2.2.0",

View File

@ -1,8 +1,8 @@
{ {
"ambientDependencies": { "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", "mocha": "github:Bartvds/tsd-deftools/typings/DefinitelyTyped/mocha/mocha.d.ts",
"colors": "github:DefinitelyTyped/DefinitelyTyped/colors/colors.d.ts#09e37435ffb2c56a6f908081194a74756f24f99d", "colors": "github:DefinitelyTyped/DefinitelyTyped/colors/colors.d.ts",
"vinyl": "github:DefinitelyTyped/DefinitelyTyped/vinyl/vinyl.d.ts#78d36dd49b6b55b9fdfe61776a12bf05c8b07777" "vinyl": "github:DefinitelyTyped/DefinitelyTyped/vinyl/vinyl.d.ts"
} }
} }

View File

@ -3,4 +3,11 @@ console.log("**** starting NPMTS ****");
import plugins = require("./npmts.plugins"); import plugins = require("./npmts.plugins");
import promisechain = require("./npmts.promisechain"); import promisechain = require("./npmts.promisechain");
plugins.beautylog.figletSync("NPMTS"); plugins.beautylog.figletSync("NPMTS");
promisechain.run();
try {
promisechain.run();
}
catch(err){
console.log(err);
}

View File

@ -1,11 +1,21 @@
/// <reference path="./typings/main.d.ts" /> /// <reference path="./typings/main.d.ts" />
import plugins = require("./npmts.plugins"); 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){ export var run = function(configArg){
var done = plugins.Q.defer(); var done = plugins.Q.defer();
var config = configArg; 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"){ if (config.mode == "default"){
config.typings = [ config.typings = [
"./ts/typings.json" "./ts/typings.json"
@ -15,9 +25,21 @@ export var run = function(configArg){
["./test/test.ts"]: "./test/" ["./test/test.ts"]: "./test/"
}; };
config.test = ["./index.js"]; 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; return done.promise;
}; };

View File

@ -1,9 +1,8 @@
/// <reference path="./typings/main.d.ts" /> /// <reference path="./typings/main.d.ts" />
var plugins = { export let beautylog = require("beautylog");
beautylog: require("beautylog"), export let fs = require("fs-extra");
fs: require("fs-extra"), export let gulp = require("gulp");
gulp: require("gulp"), export let g = {
g: {
coveralls: require("gulp-coveralls"), coveralls: require("gulp-coveralls"),
gFunction: require("gulp-function"), gFunction: require("gulp-function"),
istanbul: require("gulp-istanbul"), istanbul: require("gulp-istanbul"),
@ -13,16 +12,15 @@ var plugins = {
typescript: require("gulp-typescript"), typescript: require("gulp-typescript"),
typings: require("gulp-typings") 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");