Fix test identities
[groupbasedpolicy.git] / groupbasedpolicy-ui / module / src / main / resources / gbp / gulpfile.js
1 var gulp = require('gulp'),
2     del = require('del'),
3     gutil = require('gulp-util'),
4     concat = require('gulp-concat'),
5     runSequence = require('run-sequence'),
6     install = require("gulp-install");
7
8 var config = require( './build.config.js' );
9
10 /**
11  * Task for cleaning build directory
12  */
13 gulp.task('clean', function() {
14     // You can use multiple globbing patterns as you would with `gulp.src`
15     return del([config.build_dir]);
16 });
17
18 /**
19  * Copy assets
20  */
21 gulp.task('copyCss', function () {
22     return gulp.src(config.assets_files.css)
23         .pipe(gulp.dest(config.build_dir + '/common'));
24 });
25
26 /**
27  * Copy app files
28  */
29 gulp.task('copyTemplates', function () {
30     gutil.log(gutil.colors.cyan('INFO :: copying APP Template files'));
31     // Copy html
32     return gulp.src(config.app_files.templates)
33         .pipe(gulp.dest(config.build_dir));
34 });
35
36 gulp.task('copyAppJs', function () {
37     gutil.log(gutil.colors.cyan('INFO :: copying APP Controller JS files'));
38     return gulp.src(config.app_files.js)
39         .pipe(gulp.dest(config.build_dir));
40 });
41
42 gulp.task('copyRootJs', function () {
43     gutil.log(gutil.colors.cyan('INFO :: copying APP Root JS files'));
44     return gulp.src(config.app_files.root_js)
45         .pipe(gulp.dest(config.build_dir));
46 });
47
48 /**
49   * Copy vendor files
50  */
51 gulp.task('copyVendorCss', function () {
52     gutil.log(gutil.colors.cyan('INFO :: copying VENDOR css'));
53     return gulp.src(config.vendor_files.css, { cwd : 'vendor/**' })
54         .pipe(gulp.dest(config.build_dir + '/vendor'))
55 });
56
57 gulp.task('copyVendorFonts', function () {
58     gutil.log(gutil.colors.cyan('INFO :: copying VENDOR fonts'));
59     return gulp.src(config.vendor_files.fonts, { cwd : 'vendor/**' })
60         .pipe(gulp.dest(config.build_dir + '/vendor'))
61 });
62
63 gulp.task('copyVendorJs', function () {
64     gutil.log(gutil.colors.cyan('INFO :: copying VENDOR js files'));
65     return gulp.src(config.vendor_files.js, { cwd : 'vendor/**' })
66         .pipe(gulp.dest(config.build_dir + '/vendor'))
67 });
68
69
70 /**
71  * Copy task aggregated
72  */
73 gulp.task('copy', function() {
74     runSequence([
75         'copyCss',
76         'copyTemplates',
77         'copyAppJs',
78         'copyRootJs',
79         'copyVendorCss',
80         'copyVendorFonts'
81     ], 'copyVendorJs');
82 });
83
84 /**
85  * Build task
86  */
87 gulp.task('build', function(){
88     runSequence('clean', 'copy');
89 });