forked from planetfederal/wps-gui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
72 lines (66 loc) · 2.57 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
var gulp = require('gulp'),
devServer = require('./dev-server.js'),
connect = require('gulp-connect'),
gp_concat = require('gulp-concat'),
gp_rename = require('gulp-rename'),
gp_bower_files = require('main-bower-files'),
gp_filter = require('gulp-filter'),
gp_minify_css = require('gulp-minify-css'),
gp_uglify = require('gulp-uglify');
gulp.task('connect', function() {
devServer.run();
});
gulp.task('cssbuild', function() {
gulp.src(['src/*.png'])
.pipe(gulp.dest('dist'));
gulp.src(['src/favicon.ico'])
.pipe(gulp.dest('dist'));
gulp.src(['vendor/ol.css', 'vendor/highlight/styles/default.css ', 'src/style.css'])
.pipe(gp_filter('**/*.css'))
.pipe(gp_concat('wps-gui.css'))
.pipe(gulp.dest('dist'))
.pipe(gp_rename('wps-gui.min.css'))
.pipe(gp_minify_css())
.pipe(gulp.dest('dist'));
});
gulp.task('jsbuild', function(){
var bower_files = gp_bower_files();
// remove w3c-schemas/scripts/w3c-schemas.js
// see https://github.com/highsource/w3c-schemas/issues/11
bower_files.pop();
var files = bower_files.concat([
'vendor/highlight/highlight.pack.js',
'components/vkBeautify/vkbeautify.js',
'components/w3c-schemas/scripts/lib/XLink_1_0.js',
'components/ogc-schemas/scripts/lib/Filter_1_1_0.js',
'components/ogc-schemas/scripts/lib/Filter_2_0.js',
'components/ogc-schemas/scripts/lib/GML_2_1_2.js',
'components/ogc-schemas/scripts/lib/GML_3_1_1.js',
'components/ogc-schemas/scripts/lib/OWS_1_0_0.js',
'components/ogc-schemas/scripts/lib/OWS_1_1_0.js',
'components/ogc-schemas/scripts/lib/SMIL_2_0.js',
'components/ogc-schemas/scripts/lib/SMIL_2_0_Language.js',
'components/ogc-schemas/scripts/lib/WCS_1_1.js',
'components/ogc-schemas/scripts/lib/WFS_1_1_0.js',
'components/ogc-schemas/scripts/lib/WPS_1_0_0.js',
'src/wpsclient.js',
'src/wpsui.js'
]);
gulp.src(files)
.pipe(gp_filter('**/*.js'))
.pipe(gp_concat('wps-gui.js'))
.pipe(gulp.dest('dist'))
.pipe(gp_rename('wps-gui.min.js'))
.pipe(gp_uglify())
.pipe(gulp.dest('dist'));
});
gulp.task('watch', function() {
gulp.watch('src/*.js', ['jsbuild']).on('change', function(f) {
gulp.src([f.path]).pipe(connect.reload());
});
gulp.watch(['src/*.css', 'vendor/*.css'], ['cssbuild']).on('change', function(f) {
gulp.src([f.path]).pipe(connect.reload());
});
});
gulp.task('default', ['jsbuild', 'cssbuild'], function(){});
gulp.task('develop', ['connect', 'jsbuild', 'cssbuild', 'watch']);