-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
112 lines (92 loc) · 3.03 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
var gulp = require('gulp');
var filter = require('gulp-filter');
var flatten = require('gulp-flatten');
var phpunit = require('gulp-phpunit');
var plumber = require('gulp-plumber');
var clean = require('gulp-clean');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var bower = require('gulp-bower');
var exec = require('child_process').exec;
var sys = require('sys');
var src = './vendor/bower/';
var dest = './public/vendor/';
gulp.task('bower', ['clean'], function(){
var bowerFilesToCopy = [
'angular*/*',
'bootstrap/dist/**/*',
'd3/*',
'fontawesome/css/*',
'highlightjs/*',
'jasny-bootstrap/dist/**/*',
'jcrop/css/*',
'jcrop/js/jquery.Jcrop*',
'jcrop/js/jquery.color',
'jquery-form/*',
'jquery-autosize/*',
'jquery-ui/ui/minified/*',
'jqueryui-timepicker-addon/dist/*',
'ng-file-upload/*',
'select2/*',
'twitter-bootstrap-wizard/jquery*',
'jquery/jquery*',
'jquery/dist/*',
'underscore/*'
];
bowerFilesToCopy.forEach(function(filespec){
gulp.src(src+''+filespec+'.css')
.pipe(flatten())
.pipe(gulp.dest(dest+'css'));
});
bowerFilesToCopy.forEach(function(filespec){
gulp.src(src+''+filespec+'.js')
.pipe(flatten())
.pipe(gulp.dest(dest+'js'));
});
bowerFilesToCopy.forEach(function(filespec){
gulp.src(src+''+filespec+'.map')
.pipe(flatten())
.pipe(gulp.dest(dest+'css'))
.pipe(gulp.dest(dest+'js'));
});
gulp.src(src+'jquery-ui/themes/**/*')
.pipe(gulp.dest(dest+'css/themes'));
gulp.src(src+'bootstrap/dist/fonts/*')
.pipe(gulp.dest(dest+'fonts'));
gulp.src(src+'fontawesome/fonts/*')
.pipe(gulp.dest(dest+'fonts'));
gulp.src(src+'highlightjs/styles/*')
.pipe(gulp.dest(dest+'css/highlightjs'));
gulp.src(src+'jcrop/css/*.gif')
.pipe(gulp.dest(dest+'css'));
gulp.src([src+'select2/*.png', src+'select2/*.gif'])
.pipe(gulp.dest(dest+'css'));
gulp.src([src+'underscore/underscore.js'])
.pipe(rename('underscore.min.js'))
.pipe(uglify())
.pipe(gulp.dest(dest+'js'));
gulp.src([src+'select2-bootstrap-css/select2-bootstrap.css'])
.pipe(gulp.dest(dest+'css'));
gulp.src([src+'multiselect/src/*.js'])
.pipe(gulp.dest(dest+'js'));
gulp.src([src+'multiselect/jquery.multiselect*.css'])
.pipe(gulp.dest(dest+'css'));
});
gulp.task('clean', function(){
return gulp.src(dest)
.pipe(clean({force: true}));
});
gulp.task('load', function(){
return bower();
});
gulp.task('phpunit', function() {
gulp.src('./app/tests/**/*Test.php')
.pipe(plumber())
.pipe(phpunit('phpunit --group=now', {debug:false}))
.pipe(plumber.stop());
});
gulp.task('watch', function () {
gulp.watch('app/**/*.php', ['phpunit']);
});
// What tasks does running gulp trigger?
gulp.task('default', ['phpunit']);