Skip to content
This repository has been archived by the owner on Mar 8, 2021. It is now read-only.

Commit

Permalink
improvement to gulpfile
Browse files Browse the repository at this point in the history
  • Loading branch information
tymondesigns committed Aug 8, 2014
2 parents c1d1bb9 + 6386267 commit ca04ffb
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 54 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-locker",
"version": "0.2.1",
"version": "0.2.2",
"homepage": "https://github.com/tymondesigns/angular-locker",
"authors": [
"Sean Tymon <tymon148@gmail.com>"
Expand Down
105 changes: 53 additions & 52 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,36 @@
var gulp = require('gulp'),
karma = require('gulp-karma'),
jshint = require('gulp-jshint'),
stylish = require('jshint-stylish'),
header = require('gulp-header'),
uglify = require('gulp-uglify'),
plumber = require('gulp-plumber'),
clean = require('gulp-clean'),
rename = require('gulp-rename'),
package = require('./package.json');
karma = require('gulp-karma'),
jshint = require('gulp-jshint'),
stylish = require('jshint-stylish'),
header = require('gulp-header'),
uglify = require('gulp-uglify'),
plumber = require('gulp-plumber'),
clean = require('gulp-clean'),
rename = require('gulp-rename'),
package = require('./package.json');

var paths = {
output : 'dist/',
scripts : [
'src/angular-locker.js'
],
test: [
'vendor/angular/angular.js',
'vendor/angular-mocks/angular-mocks.js',
'src/angular-locker.js',
'test/spec/**/*.js'
]
output : 'dist/',
vendor: [
'vendor/angular/angular.js',
'vendor/angular-mocks/angular-mocks.js'
],
scripts : [
'src/angular-locker.js'
],
test: [
'test/spec/**/*.js'
]
};

var banner = [
'/*! ',
'<%= package.name %> ',
'v<%= package.version %> | ',
'(c) ' + new Date().getFullYear() + ' <%= package.author %> |',
' <%= package.homepage %>',
' */',
'\n'
'/*! ',
'<%= package.name %> ',
'v<%= package.version %> | ',
'(c) ' + new Date().getFullYear() + ' <%= package.author %> |',
' <%= package.homepage %>',
' */',
'\n'
].join('');

/**
Expand All @@ -43,42 +44,42 @@ var banner = [
*/

gulp.task('scripts', ['clean'], function() {
return gulp.src(paths.scripts)
.pipe(plumber())
// .pipe(header(banner, { package : package }))
.pipe(gulp.dest('dist/'))
.pipe(rename({ suffix: '.min' }))
.pipe(uglify())
.pipe(header(banner, { package : package }))
.pipe(gulp.dest('dist/'));
return gulp.src(paths.scripts)
.pipe(plumber())
// .pipe(header(banner, { package : package }))
.pipe(gulp.dest('dist/'))
.pipe(rename({ suffix: '.min' }))
.pipe(uglify())
.pipe(header(banner, { package : package }))
.pipe(gulp.dest('dist/'));
});

gulp.task('lint', function () {
return gulp.src(paths.scripts)
.pipe(plumber())
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
return gulp.src(paths.scripts)
.pipe(plumber())
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
});

gulp.task('clean', function () {
return gulp.src(paths.output, { read: false })
.pipe(plumber())
.pipe(clean());
return gulp.src(paths.output, { read: false })
.pipe(plumber())
.pipe(clean());
});

gulp.task('test', function() {
return gulp.src(paths.test)
.pipe(plumber())
.pipe(karma({
configFile: 'test/karma.conf.js',
action: 'run'
}))
.on('error', function(err) { throw err; });
return gulp.src(paths.vendor.concat(paths.scripts, paths.test))
.pipe(plumber())
.pipe(karma({
configFile: 'test/karma.conf.js',
action: 'run'
}))
.on('error', function(err) { throw err; });
});

gulp.task('default', [
'lint',
'clean',
'scripts',
'test'
'lint',
'clean',
'scripts',
'test'
]);
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-locker",
"version": "0.2.1",
"version": "0.2.2",
"description": "A simple & configurable abstraction for local/session storage in angular projects",
"author": "@tymondesigns",
"license": "MIT",
Expand Down

0 comments on commit ca04ffb

Please sign in to comment.