-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
97 lines (87 loc) · 2.85 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
var gulp = require('gulp');
var concat = require('gulp-concat');
var sass = require('gulp-sass');
var watch = require('gulp-watch');
var karma = require('gulp-karma');
var jasmine = require('gulp-jasmine');
var protractor = require("gulp-protractor").protractor;
var testFiles = [
'./bower_components/angular/angular.js',
'./bower_components/angular-route/angular-route.js',
'./bower_components/angular-mocks/angular-mocks.js',
'./bower_components/sweetalert/dist/sweetalert.min.js',
'./src/angular/app.js',
'./src/angular/controllers/*.js',
'./src/angular/directives/*.js',
'./src/angular/models/*.js',
'./spec/angular/controllers/*.js',
'./spec/angular/models/*.js',
];
gulp.task('test-node', function() {
gulp.src('./spec/**[^angular]/*.js')
.pipe(jasmine());
});
gulp.task('test-angular', function() {
gulp.src(testFiles)
.pipe(karma({
configFile: 'karma.conf.js',
action: 'run'
}))
.on('error', function(err) {
throw err;
});
gulp.src(["./e2e-test/*.js"])
.pipe(protractor({
configFile: "e2e-test/protractor.conf.js",
args: ['--baseUrl', 'http://127.0.0.1:8080']
}))
.on('error', function(e) { throw e })
});
gulp.task('test', function() {
gulp.start('test-node', 'test-angular');
});
gulp.task('default', function() {
gulp.start('combine-angular', 'sass', 'copy-sample-requests');
});
gulp.task('combine-angular', function() {
return gulp.src([
'./bower_components/jquery/dist/jquery.min.js',
'./bower_components/foundation/js/vendor/modernizr.js',
'./bower_components/foundation/js/foundation.min.js',
'./bower_components/sweetalert/dist/sweetalert.min.js',
'./bower_components/angular/angular.min.js',
'./bower_components/angular-route/angular-route.min.js',
'./src/angular/app.js',
'./src/angular/models/*.js',
'./src/angular/controllers/*.js',
'./src/angular/directives/*.js',
])
.pipe(concat('app.js'))
.pipe(gulp.dest('./public/javascripts'));
});
gulp.task('sass', function () {
gulp.src([
'./bower_components/foundation/scss/normalize.scss',
'./bower_components/foundation/scss/foundation.scss',
'./bower_components/sweetalert/dist/sweetalert.css',
'./src/assets/stylesheets/style.scss'
])
.pipe(sass())
.pipe(concat('style.css'))
.pipe(gulp.dest('./public/stylesheets'));
});
gulp.task('copy-sample-requests', function() {
gulp.src(['./src/assets/sample_requests/*.*', './src/assets/sample_requests/**/*.*'])
.pipe(gulp.dest('./public/data'));
});
gulp.task('watch-test', function() {
gulp.src(testFiles)
.pipe(karma({
configFile: 'karma.conf.js',
action: 'watch'
}));
});
gulp.task('watch', function() {
gulp.watch('./src/assets/stylesheets/*.scss', ['sass']);
gulp.watch(['./src/angular/*.js', './src/angular/*/*.js'], ['combine-angular']);
});