server/src/gulpfile.js
author Chloe Laisne <chloe.laisne@gmail.com>
Mon, 29 Aug 2016 20:01:13 +0200
changeset 273 a719b2dcea34
parent 140 f851ec12812f
child 319 78990a8a069b
permissions -rw-r--r--
Cartography on 3 levels (continents/countries/france) and backToContinents button
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
20
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
     1
var gulp = require('gulp'),
28
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
     2
    elixir = require('laravel-elixir')
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
     3
    del = require('del');
1
01a844d292ac dev environment + first skeleton for bo
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
20
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
     5
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
     6
var exec = require('child_process').execSync;
1
01a844d292ac dev environment + first skeleton for bo
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
/*
01a844d292ac dev environment + first skeleton for bo
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
 |--------------------------------------------------------------------------
01a844d292ac dev environment + first skeleton for bo
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
 | Elixir Asset Management
01a844d292ac dev environment + first skeleton for bo
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
 |--------------------------------------------------------------------------
01a844d292ac dev environment + first skeleton for bo
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
 |
01a844d292ac dev environment + first skeleton for bo
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
 | Elixir provides a clean, fluent API for defining some basic Gulp tasks
01a844d292ac dev environment + first skeleton for bo
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
 | for your Laravel application. By default, we are compiling the Less
01a844d292ac dev environment + first skeleton for bo
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
 | file for our application, as well as publishing vendor resources.
01a844d292ac dev environment + first skeleton for bo
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
 |
01a844d292ac dev environment + first skeleton for bo
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
 */
01a844d292ac dev environment + first skeleton for bo
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 1
diff changeset
    18
 var paths = {
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 1
diff changeset
    19
 'bower_base_path': './vendor/bower_components/',
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 1
diff changeset
    20
 'bootstrap': './vendor/bower_components/bootstrap-sass/assets/'
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 1
diff changeset
    21
 };
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 1
diff changeset
    22
20
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    23
gulp.task('build-ember', function(cb) {
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    24
    exec('node_modules/.bin/ember build -prod', {
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    25
        cwd: '../bo_client',
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    26
        stdio:[0,1,2]
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    27
    });
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    28
});
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    29
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    30
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    31
gulp.task('copy-bo-ember', function() {
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    32
    gulp.src('../bo_client/dist/assets/*.js')
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    33
        .pipe(gulp.dest('public/js/vendor/'));
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    34
    gulp.src('../bo_client/dist/assets/*.css')
28
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
    35
        .pipe(gulp.dest('public/css/'));
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
    36
    gulp.src('../bo_client/dist/fonts/**/*')
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
    37
        .pipe(gulp.dest('public/fonts/'));
140
f851ec12812f upgrade bo client
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    38
    gulp.src('../bo_client/dist/assets/img/**/*')
f851ec12812f upgrade bo client
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    39
        .pipe(gulp.dest('public/css/img'));
f851ec12812f upgrade bo client
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    40
28
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
    41
});
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
    42
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
    43
gulp.task('copy-to-build', function() {
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
    44
    del(['../../build/root'], {force: true}, function(err, files) {
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
    45
        if(err) {
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
    46
            return;
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
    47
        }
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
    48
        gulp.src(['**/*','!vendor', '!vendor/**', '!node_modules', '!node_modules/**', '!.env', '!.git*'])
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
    49
            .pipe(gulp.dest('../../build/root/var/www/corpusdelaparole/corpus/'))
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
    50
    });
20
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    51
});
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 1
diff changeset
    52
1
01a844d292ac dev environment + first skeleton for bo
ymh <ymh.work@gmail.com>
parents:
diff changeset
    53
elixir(function(mix) {
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 1
diff changeset
    54
    mix.sass('app.scss', 'public/css/app.css', {includePaths: [paths['bootstrap']+'stylesheets/']})
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 1
diff changeset
    55
        .copy(paths.bootstrap + 'fonts/bootstrap', 'public/fonts')
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 1
diff changeset
    56
        .copy(paths.bootstrap + 'javascripts/bootstrap.js', 'public/js/vendor/bootstrap.js')
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 1
diff changeset
    57
        .copy(paths.bower_base_path + 'jquery/dist/jquery.min.js', 'public/js/vendor/jquery.js')
20
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    58
        .copy(paths.bower_base_path + 'font-awesome/css/font-awesome.min.css', 'public/css/vendor/font-awesome.css')
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    59
        .task('build-ember')
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    60
        .task('copy-bo-ember');
1
01a844d292ac dev environment + first skeleton for bo
ymh <ymh.work@gmail.com>
parents:
diff changeset
    61
});