Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Commit

Permalink
#8 coveralls is now optional
Browse files Browse the repository at this point in the history
  • Loading branch information
wilzbach committed Oct 5, 2014
1 parent 2e34ce9 commit f2b3969
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "slush-biojs",
"version": "0.2.3",
"version": "0.2.4",
"description": "A slush generator for BioJS modules",
"keywords": [
"slushgenerator",
Expand Down
18 changes: 16 additions & 2 deletions slushfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ gulp.task('default', function(done) {
type: "confirm",
default: true,
message: 'A visualization lib?',
}, {
name: 'coverage',
type: "confirm",
default: true,
message: 'Check code coverage?',
},{
type: 'list',
name: 'license',
Expand Down Expand Up @@ -77,19 +82,28 @@ gulp.task('default', function(done) {
var files = [__dirname + '/templates/**'];
if (answers.license === 'MIT') {
files.push('!' + __dirname + '/templates/LICENSE_BSD');
files.push('!' + __dirname + '/templates/LICENSE_APACHE2');
files.push('!' + __dirname + '/templates/LICENSE_APACHE');
}else if (answers.license === 'Apache 2') {
files.push('!' + __dirname + '/templates/LICENSE_BSD');
files.push('!' + __dirname + '/templates/LICENSE_MIT');
} else {
files.push('!' + __dirname + '/templates/LICENSE_MIT');
files.push('!' + __dirname + '/templates/LICENSE_APACHE2');
files.push('!' + __dirname + '/templates/LICENSE_APACHE');
}

if (!answers.vis) {
files.push('!' + __dirname + '/snippets/**');
files.push('!' + __dirname + '/test/index.html');
files.push('!' + __dirname + '/test/dom/**');
}

//TODO
answers.coverage = false;

if (!answers.coverage) {
files.push('!' + __dirname + '/coverage/**');
}

answers.keywords = answers.keywords.split(",");
// toLower
answers.keywords = answers.keywords.join('|').toLowerCase().split('|');
Expand Down
5 changes: 4 additions & 1 deletion templates/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ var packageConfig = require('./package.json');

// a failing test breaks the whole build chain
gulp.task('build', ['build-browser', 'build-browser-gzip']);
gulp.task('default', ['lint', 'test', 'coveralls', 'build']);
gulp.task('default', ['lint', 'test', <% if(coverage){ %>'coveralls',<% } %> 'build']);


gulp.task('lint', function() {
return gulp.src('./lib/*.js')
Expand Down Expand Up @@ -88,10 +89,12 @@ gulp.task('build-test',['init'], function() {

<% } %>

<% if (coverage){ %>
gulp.task('coveralls', function () {
return gulp.src('coverage/lcov.info')
.pipe(coveralls());
});
<% } %>

gulp.task('test-watch', function() {
gulp.watch(['./src/**/*.js','./lib/**/*.js', './test/**/*.js'], function() {
Expand Down
2 changes: 1 addition & 1 deletion templates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
],
"main": "lib/<%= appNameSlug %>",
"scripts": {
"test": "mocha --require blanket --reporter mocha-lcov-reporter > coverage/lcov.info && gulp test && gulp coveralls",
"test": "gulp",
"build": "gulp build",
"build-browser": "gulp build-browser",
"build-browser-min": "gulp build-browser-gzip",
Expand Down

0 comments on commit f2b3969

Please sign in to comment.