forked from onursumer/mutation-mapper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
106 lines (94 loc) · 2.55 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
98
99
100
101
102
103
104
105
106
var gulp = require('gulp');
var del = require('del');
var vinylPaths = require('vinyl-paths');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var replace = require('gulp-replace');
var cssmin = require('gulp-cssmin');
var htmlmin = require('gulp-htmlmin');
var template = require('gulp-template-compile');
var paths = {
sources: [
"src/js/util/DataTableUtil.js",
"src/js/util/MutationViewsUtil.js",
"src/js/util/MutationDetailsTableFormatter.js",
"src/js/util/PileupUtil.js",
"src/js/util/*.js",
"src/js/model/*.js",
"src/js/view/*.js",
"src/js/data/*.js",
"src/js/component/*.js",
"src/js/controller/*.js",
"src/js/MutationMapper.js"
],
css: [
"src/css/mutation_3d.css",
"src/css/mutation_details.css",
"src/css/mutation_diagram.css",
"src/css/mutation_pdb_panel.css",
"src/css/mutation_pdb_table.css",
"src/css/mutation_table.css"
],
templates: [
"src/html/mutation_3d_view.html",
"src/html/mutation_details_table_view.html",
"src/html/mutation_details_view.html",
"src/html/mutation_diagram_view.html",
"src/html/mutation_pdb_panel_view.html",
"src/html/mutation_pdb_table_view.html"
],
frames: [
"src/html/jsmol_frame.html"
]
};
var version;
gulp.task('default', function() {
});
gulp.task('version', function() {
//var now = new Date();
//version = process.env['VERSION'];
version = '1.0';
});
gulp.task('build', ['version'], function() {
return gulp.src( paths.sources )
//.pipe( replace('{{VERSION}}', version) )
.pipe( concat('mutationMapper.js') )
.pipe( gulp.dest('build') )
.pipe( uglify({
mangle: true,
preserveComments: 'some'
}) )
.pipe( concat('mutationMapper.min.js') )
.pipe( gulp.dest('build') );
});
gulp.task('clean', function() {
return gulp.src(['build/*'])
.pipe(vinylPaths(del));
});
gulp.task('template', function() {
return gulp.src(paths.templates)
.pipe( concat('mutationMapperTemplates.html') )
.pipe( gulp.dest('build') )
.pipe( template({
name: function(file) {
return "mutationViews";
},
namespace: "backbone-template"
}) )
.pipe( concat('mutationMapperTemplates.js') )
.pipe( gulp.dest('build') );
});
gulp.task('copy', function() {
return gulp.src(paths.frames)
.pipe( gulp.dest('build') );
});
gulp.task('cssmin', function() {
return gulp.src( paths.css )
.pipe( concat('mutationMapper.css') )
.pipe( gulp.dest('build') )
.pipe( cssmin() )
.pipe( concat('mutationMapper.min.css') )
.pipe( gulp.dest('build') );
});
// TODO inject: js into debug.html
gulp.task('make', ['clean', 'build', 'cssmin', 'template']);