client/gulpfile.js
author rougeronj
Thu, 11 Jun 2015 16:23:34 +0200
changeset 174 fd166770bcee
parent 172 ffdfe491869c
child 196 e3d3cd7a676a
permissions -rw-r--r--
increment version
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
var gulp = require('gulp');
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
var gutil = require('gulp-util')
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
var plugins = require("gulp-load-plugins")({lazy:false});
88
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
     4
var mainBowerFiles = require('main-bower-files');
78
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
     5
var htmlreplace = require('gulp-html-replace');
0
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
154
d029bf4a0b2b update gulpfile to copy indexAmmico in templates folder
rougeronj
parents: 149
diff changeset
     7
var templatesFolder = './../server/ammicosrv/ammico/templates';
135
27065f8a19d3 correct rename of src
ymh <ymh.work@gmail.com>
parents: 117
diff changeset
     8
var staticFolder = './../server/ammicosrv/ammico/static/ammico';
88
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
     9
var buildFolder = './build';
0
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
var scriptsSrc = ['!./app/**/*_test.js','./app/**/*.js'];
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
88
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    13
gulp.task('templates',function(){
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    14
    //combine all template files of the app into a js file
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    15
    gulp.src(['!./app/index.html',
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    16
        './app/**/*.html'])
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    17
        .pipe(plugins.angularTemplatecache('templates.js',{standalone:true}))
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    18
        .pipe(gulp.dest(buildFolder+'/js'));
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    19
});
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    20
0
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
gulp.task('scripts', function(){
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
    //combine all js files of the app
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
    gulp.src(scriptsSrc)
172
ffdfe491869c uncomment jshint and fix minor bug
rougeronj
parents: 154
diff changeset
    24
        .pipe(plugins.jshint())
ffdfe491869c uncomment jshint and fix minor bug
rougeronj
parents: 154
diff changeset
    25
        .pipe(plugins.jshint.reporter('default'))
ffdfe491869c uncomment jshint and fix minor bug
rougeronj
parents: 154
diff changeset
    26
        .pipe(plugins.jshint.reporter('fail'))
0
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
        .pipe(plugins.concat('app.js'))
88
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    28
        .pipe(gulp.dest(buildFolder+'/js'))
0
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    29
        .pipe(plugins.filesize())
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    30
        .on('error', gutil.log);
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    31
});
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    32
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    33
gulp.task('css', function(){
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    34
    gulp.src('./app/**/*.css')
88
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    35
        .pipe(plugins.csslint({ 'box-sizing': false }))
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    36
        .pipe(plugins.csslint.reporter())
0
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    37
        .pipe(plugins.concat('app.css'))
88
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    38
        .pipe(gulp.dest(buildFolder+'/css'))
0
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    39
        .pipe(plugins.filesize());
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    40
});
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    41
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    42
gulp.task('vendorJS', function(){
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    43
    //concatenate vendor JS files
88
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    44
    return gulp.src(mainBowerFiles('**/*.js', {
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    45
            "overrides":{
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    46
                "angular": {
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    47
                    "dependencies": {
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    48
                        "jquery": "~1.8"
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    49
                    }
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    50
                }
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    51
            }
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    52
        }))
0
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    53
        .pipe(plugins.concat('lib.js'))
88
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    54
        .pipe(gulp.dest(buildFolder+'/js'))
0
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    55
        .pipe(plugins.filesize())
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    56
        .on('error', gutil.log);
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    57
});
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    58
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    59
gulp.task('vendorCSS', function(){
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    60
    //concatenate vendor CSS files
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    61
    gulp.src(['!./bower_components/**/*.min.css',
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    62
        './bower_components/**/*.css'])
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    63
        .pipe(plugins.concat('lib.css'))
88
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    64
        .pipe(gulp.dest(buildFolder+'/css'))
0
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    65
        .pipe(plugins.filesize());
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    66
});
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    67
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    68
gulp.task('vendorFonts', function(){
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    69
    gulp.src(['./bower_components/**/fonts/*'])
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    70
        .pipe(plugins.flatten())
88
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    71
        .pipe(gulp.dest(buildFolder+'/fonts'));
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    72
});
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    73
89
7faa53118457 add order in tasks to be sure 'copy-server' task copy the files after building them
rougeronj
parents: 88
diff changeset
    74
gulp.task('minimify', ['scripts', 'css', 'vendorJS', 'vendorCSS'], function(){
88
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    75
    gulp.src(buildFolder+'/js/lib.js')
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    76
        .pipe(plugins.uglify())
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    77
        .pipe(plugins.rename('lib.min.js'))
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    78
        .pipe(gulp.dest(buildFolder+'/js'))
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    79
        .pipe(plugins.filesize());
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    80
    gulp.src(buildFolder+'/js/app.js')
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    81
        .pipe(plugins.uglify())
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    82
        .pipe(plugins.rename('app.min.js'))
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    83
        .pipe(gulp.dest(buildFolder+'/js'))
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    84
        .pipe(plugins.filesize());
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    85
    gulp.src(buildFolder+'/css/app.css')
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    86
        .pipe(plugins.minifyCss({keepBreaks:true, processImport: false}))
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    87
        .pipe(plugins.rename('app.min.css'))
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    88
        .pipe(gulp.dest(buildFolder+'/css'))
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    89
        .pipe(plugins.filesize());
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    90
    gulp.src(buildFolder+'/css/lib.css')
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    91
        .pipe(plugins.minifyCss({keepBreaks:true, processImport: false}))
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    92
        .pipe(plugins.rename('lib.min.css'))
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    93
        .pipe(gulp.dest(buildFolder+'/css'))
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
    94
        .pipe(plugins.filesize());
0
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    95
});
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    96
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    97
gulp.task('copy-index', function() {
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    98
    gulp.src('./app/index.html')
91
f7a844a9079e merge the changes of Camille
rougeronj
parents: 89
diff changeset
    99
        .pipe(gulp.dest(buildFolder));
0
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   100
});
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   101
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   102
gulp.task('copy-data', function() {
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   103
    gulp.src('./data/**/*')
88
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
   104
        .pipe(gulp.dest(buildFolder+'/data'));
0
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   105
});
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   106
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   107
gulp.task('copy-img', function() {
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   108
    gulp.src('./img/**/*')
88
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
   109
        .pipe(gulp.dest(buildFolder+'/img'));
0
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   110
});
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   111
89
7faa53118457 add order in tasks to be sure 'copy-server' task copy the files after building them
rougeronj
parents: 88
diff changeset
   112
gulp.task('watch',function(){
7faa53118457 add order in tasks to be sure 'copy-server' task copy the files after building them
rougeronj
parents: 88
diff changeset
   113
    gulp.watch([
7faa53118457 add order in tasks to be sure 'copy-server' task copy the files after building them
rougeronj
parents: 88
diff changeset
   114
        buildFolder+'/**/*.html',
7faa53118457 add order in tasks to be sure 'copy-server' task copy the files after building them
rougeronj
parents: 88
diff changeset
   115
        buildFolder+'/**/*.js',
7faa53118457 add order in tasks to be sure 'copy-server' task copy the files after building them
rougeronj
parents: 88
diff changeset
   116
        buildFolder+'/**/*.css'
7faa53118457 add order in tasks to be sure 'copy-server' task copy the files after building them
rougeronj
parents: 88
diff changeset
   117
    ], function(event) {
7faa53118457 add order in tasks to be sure 'copy-server' task copy the files after building them
rougeronj
parents: 88
diff changeset
   118
        return gulp.src(event.path)
7faa53118457 add order in tasks to be sure 'copy-server' task copy the files after building them
rougeronj
parents: 88
diff changeset
   119
            .pipe(plugins.connect.reload());
7faa53118457 add order in tasks to be sure 'copy-server' task copy the files after building them
rougeronj
parents: 88
diff changeset
   120
    });
7faa53118457 add order in tasks to be sure 'copy-server' task copy the files after building them
rougeronj
parents: 88
diff changeset
   121
    gulp.watch(['./app/**/*.js','!./app/**/*test.js'],['scripts']);
7faa53118457 add order in tasks to be sure 'copy-server' task copy the files after building them
rougeronj
parents: 88
diff changeset
   122
    gulp.watch(['!./app/index.html','./app/**/*.html'],['templates']);
7faa53118457 add order in tasks to be sure 'copy-server' task copy the files after building them
rougeronj
parents: 88
diff changeset
   123
    gulp.watch('./app/**/*.css',['css']);
7faa53118457 add order in tasks to be sure 'copy-server' task copy the files after building them
rougeronj
parents: 88
diff changeset
   124
    gulp.watch('./app/index.html',['copy-index']);
7faa53118457 add order in tasks to be sure 'copy-server' task copy the files after building them
rougeronj
parents: 88
diff changeset
   125
    gulp.watch('./data/**/*',['copy-data']);
7faa53118457 add order in tasks to be sure 'copy-server' task copy the files after building them
rougeronj
parents: 88
diff changeset
   126
    gulp.watch('./img/**/*',['copy-img']);
7faa53118457 add order in tasks to be sure 'copy-server' task copy the files after building them
rougeronj
parents: 88
diff changeset
   127
});
7faa53118457 add order in tasks to be sure 'copy-server' task copy the files after building them
rougeronj
parents: 88
diff changeset
   128
7faa53118457 add order in tasks to be sure 'copy-server' task copy the files after building them
rougeronj
parents: 88
diff changeset
   129
7faa53118457 add order in tasks to be sure 'copy-server' task copy the files after building them
rougeronj
parents: 88
diff changeset
   130
gulp.task('connect', function() {
7faa53118457 add order in tasks to be sure 'copy-server' task copy the files after building them
rougeronj
parents: 88
diff changeset
   131
    plugins.connect.server({
7faa53118457 add order in tasks to be sure 'copy-server' task copy the files after building them
rougeronj
parents: 88
diff changeset
   132
        root: buildFolder,
7faa53118457 add order in tasks to be sure 'copy-server' task copy the files after building them
rougeronj
parents: 88
diff changeset
   133
    	port: 9000,
7faa53118457 add order in tasks to be sure 'copy-server' task copy the files after building them
rougeronj
parents: 88
diff changeset
   134
        livereload: true
7faa53118457 add order in tasks to be sure 'copy-server' task copy the files after building them
rougeronj
parents: 88
diff changeset
   135
    });
7faa53118457 add order in tasks to be sure 'copy-server' task copy the files after building them
rougeronj
parents: 88
diff changeset
   136
});
7faa53118457 add order in tasks to be sure 'copy-server' task copy the files after building them
rougeronj
parents: 88
diff changeset
   137
7faa53118457 add order in tasks to be sure 'copy-server' task copy the files after building them
rougeronj
parents: 88
diff changeset
   138
gulp.task('default',['connect','scripts','css', 'templates','copy-index','copy-data','copy-img','vendorJS','vendorCSS','vendorFonts','watch']);
7faa53118457 add order in tasks to be sure 'copy-server' task copy the files after building them
rougeronj
parents: 88
diff changeset
   139
gulp.task('copy-server', ['scripts','css', 'templates','copy-index','copy-data','copy-img','vendorJS','vendorCSS','vendorFonts','minimify'], function() {
88
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
   140
    gulp.src(buildFolder+'/img/**/*')
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
   141
        .pipe(gulp.dest(staticFolder+'/img'));
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
   142
    gulp.src(buildFolder+'/fonts/**/*')
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
   143
        .pipe(gulp.dest(staticFolder+'/fonts'));
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
   144
    gulp.src(buildFolder+'/js/*.js')
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
   145
        .pipe(gulp.dest(staticFolder+'/js'));
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
   146
    gulp.src(buildFolder+'/css/*.css')
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
   147
        .pipe(gulp.dest(staticFolder+'/css'));
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
   148
    gulp.src(buildFolder+'/index.html')
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
   149
        .pipe(htmlreplace({
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
   150
            django: '{% load static %}',
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
   151
            js:{
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
   152
                src: ['lib.js', 'templates.js', 'app.js'],
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
   153
                tpl: '<script src="{% static \'ammico/js/%s\' %}"></script>'
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
   154
            },
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
   155
            css: {
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
   156
                src: ['lib.css', 'app.css'],
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
   157
                tpl: '<link rel="stylesheet" type="text/css" href="{% static \'ammico/css/%s\' %}"/>'
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
   158
            },
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
   159
            imgLogo: {
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
   160
                src: 'ammico_logo_small.png',
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
   161
                tpl: '<img src="{% static \'ammico/img/%s\' %}">'
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
   162
            },
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
   163
            imgFooter: {
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
   164
                src: 'logo_IRI_footer.png',
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
   165
                tpl: '<img src="{% static \'ammico/img/%s\' %}" alt="Logo IRI" />'
114
e4ffc4e13a8e add a token field to the initialisation of the ammico app so the server can pass it and auto login with jwt
rougeronj
parents: 100
diff changeset
   166
            },
147
89f19425c580 add 4 parameters to init ammico app. These parameter are set from the ammico server thanks to the "context"
rougeronj
parents: 117
diff changeset
   167
            idExpo: 'idExpo: "{{ context.idExpo }}",',
89f19425c580 add 4 parameters to init ammico app. These parameter are set from the ammico server thanks to the "context"
rougeronj
parents: 117
diff changeset
   168
            ammicoUrl: 'ammicoUrl: "{{ context.ammicoUrl }}",',
89f19425c580 add 4 parameters to init ammico app. These parameter are set from the ammico server thanks to the "context"
rougeronj
parents: 117
diff changeset
   169
            searchUrl: 'searchUrl: "{{ context.searchUrl }}",',
89f19425c580 add 4 parameters to init ammico app. These parameter are set from the ammico server thanks to the "context"
rougeronj
parents: 117
diff changeset
   170
            token: '{% if context.token %} token: "{{ context.token }}", {% endif %}'
88
2db951a4a04c updates dependencies and add main-bower-file to gulpfile to concatenate the vendorJs
rougeronj
parents: 83
diff changeset
   171
        }))
147
89f19425c580 add 4 parameters to init ammico app. These parameter are set from the ammico server thanks to the "context"
rougeronj
parents: 117
diff changeset
   172
        .pipe(plugins.rename('indexAmmico.html'))
89f19425c580 add 4 parameters to init ammico app. These parameter are set from the ammico server thanks to the "context"
rougeronj
parents: 117
diff changeset
   173
        .pipe(gulp.dest(templatesFolder));
78
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   174
});