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 promisechain = require("./npmts.promisechain");
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";
/// <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;
};

48
dist/npmts.plugins.js vendored
View File

@ -1,28 +1,26 @@
"use strict";
/// <reference path="./typings/main.d.ts" />
var plugins = {
beautylog: require("beautylog"),
fs: require("fs-extra"),
gulp: require("gulp"),
g: {
coveralls: require("gulp-coveralls"),
gFunction: require("gulp-function"),
istanbul: require("gulp-istanbul"),
jsdoc3: require("gulp-jsdoc3"),
mocha: require("gulp-mocha"),
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")
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"),
jsdoc3: require("gulp-jsdoc3"),
mocha: require("gulp-mocha"),
sourcemaps: require("gulp-sourcemaps"),
typescript: require("gulp-typescript"),
typings: require("gulp-typings")
};
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",
"q": "^1.4.1",
"shelljs": "^0.6.0",
"smartci": "0.0.1",
"smartcli": "0.0.11",
"smartenv": "1.2.0",
"smartfile": "2.2.0",

View File

@ -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"
}
}

View File

@ -3,4 +3,11 @@ console.log("**** starting NPMTS ****");
import plugins = require("./npmts.plugins");
import promisechain = require("./npmts.promisechain");
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" />
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;
};

View File

@ -1,28 +1,26 @@
/// <reference path="./typings/main.d.ts" />
var plugins = {
beautylog: require("beautylog"),
fs: require("fs-extra"),
gulp: require("gulp"),
g: {
coveralls: require("gulp-coveralls"),
gFunction: require("gulp-function"),
istanbul: require("gulp-istanbul"),
jsdoc3: require("gulp-jsdoc3"),
mocha: require("gulp-mocha"),
sourcemaps: require("gulp-sourcemaps"),
typescript: require("gulp-typescript"),
typings: require("gulp-typings")
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"),
jsdoc3: require("gulp-jsdoc3"),
mocha: require("gulp-mocha"),
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")
};
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");