forked from angular-ui-tree/angular-ui-tree
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(cherry picked from commit 4ae1353)
- Loading branch information
Niels Dequeker
committed
Apr 27, 2015
1 parent
e04dfda
commit 1daa84f
Showing
8 changed files
with
188 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
'use strict'; | ||
|
||
var gulp = require('gulp'), | ||
requireDir = require('require-dir'), | ||
$ = require('gulp-load-plugins')(); | ||
|
||
// Load application tasks | ||
(function () { | ||
var dir = requireDir('./tasks'); | ||
|
||
Object.keys(dir).forEach(function (key) { | ||
dir[key] = dir[key](gulp, $); | ||
}); | ||
}()); | ||
|
||
$.karma = require('karma'); | ||
|
||
gulp.task('build', function () { | ||
return gulp.start('clean', 'jscs', 'jshint', 'concat', 'uglify', 'test', 'styles'); | ||
}); | ||
|
||
gulp.task('serve', ['clean'], function () { | ||
return gulp.start('connect', 'watch', 'open'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
'use strict'; | ||
|
||
module.exports = function (gulp, $) { | ||
gulp.task('clean', function () { | ||
return gulp.src('dist', { read: false }) | ||
.pipe($.clean()); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
'use strict'; | ||
|
||
module.exports = function (gulp, $) { | ||
|
||
gulp.task('jscs', function () { | ||
return gulp.src('source') | ||
.pipe($.jscs()); | ||
}); | ||
|
||
gulp.task('jshint', function () { | ||
return gulp.src([ | ||
'source/**/*.js' | ||
]) | ||
.pipe($.jshint()) | ||
.pipe($.jshint.reporter('jshint-stylish')) | ||
.pipe($.jshint.reporter('fail')); | ||
}); | ||
|
||
gulp.task('concat', function () { | ||
return gulp.src([ | ||
'source/**/*.js', | ||
'!**/*.spec.js' | ||
]) | ||
.pipe($.concat('angular-ui-tree.js')) | ||
.pipe(gulp.dest('dist')); | ||
}); | ||
|
||
gulp.task('uglify', function () { | ||
return gulp.src('dist/angular-ui-tree.js') | ||
.pipe($.uglify({ | ||
preserveComments: 'some' | ||
})) | ||
.pipe($.rename('angular-ui-tree.min.js')) | ||
.pipe(gulp.dest('dist')); | ||
}); | ||
|
||
gulp.task('test', function () { | ||
return $.karma.server.start({ | ||
configFile: __dirname + '/../karma.conf.js', | ||
singleRun: true | ||
}, function (err) { | ||
process.exit(err ? 1 : 0); | ||
}); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
'use strict'; | ||
|
||
module.exports = function (gulp, $) { | ||
|
||
gulp.task('connect', function () { | ||
var livereloadPort = 35729; | ||
|
||
$.connect.server({ | ||
port: 9000, | ||
livereload: { | ||
port: livereloadPort | ||
}, | ||
middleware: function (connect) { | ||
function mountFolder(connect, dir) { | ||
return connect.static(require('path').resolve(dir)); | ||
} | ||
|
||
return [ | ||
require('connect-livereload')({ port: livereloadPort }), | ||
mountFolder(connect, 'dist'), | ||
mountFolder(connect, 'examples') | ||
]; | ||
} | ||
}); | ||
}); | ||
|
||
gulp.task('watch', ['connect'], function () { | ||
gulp.watch([ | ||
'source/**/*.js', | ||
'examples/**/*.html' | ||
], function (event) { | ||
return gulp.src(event.path) | ||
.pipe($.connect.reload()); | ||
}); | ||
|
||
gulp.watch([ | ||
'source/**/*.js' | ||
], ['jshint', 'jscs']); | ||
|
||
gulp.watch([ | ||
'source/**/*.scss' | ||
], ['styles']); | ||
}); | ||
|
||
gulp.task('open', ['connect'], function () { | ||
require('open')('http://localhost:9000'); | ||
}); | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
'use strict'; | ||
|
||
module.exports = function (gulp, $) { | ||
|
||
gulp.task('styles', function () { | ||
return gulp.src('source/angular-ui-tree.scss') | ||
.pipe($.sass({ | ||
errLogToConsole: true, | ||
outputStyle: 'compressed' | ||
})) | ||
.pipe($.rename('angular-ui-tree.min.css')) | ||
.pipe(gulp.dest('dist')); | ||
}); | ||
|
||
}; |