-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
86 lines (79 loc) · 3.9 KB
/
Gruntfile.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
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jsopkg: grunt.file.readJSON('lib/jsorolla/package.json'),
def: {
name: 'potyvirus',
build: 'build/<%= pkg.version %>',
jsorolla: 'lib/jsorolla'
},
concat: {
dist: {
src: [
'src/potyvirus.js'
],
dest: '<%= def.build %>/<%= def.name %>.js'
}
},
uglify: {
options: {
banner: '/*! <%= def.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
},
dist: {
files: {
'<%= def.build %>/<%= def.name %>.min.js': ['<%= concat.dist.dest %>']
}
}
},
copy: {
dist: {
files: [
{ expand: true, cwd: './<%= def.jsorolla %>', src: ['vendor/underscore-min.js'], dest: '<%= def.build %>' },
{ expand: true, cwd: './<%= def.jsorolla %>', src: ['vendor/backbone-min.js'], dest: '<%= def.build %>' },
{ expand: true, cwd: './<%= def.jsorolla %>', src: ['vendor/jquery.min.js'], dest: '<%= def.build %>' },
{ expand: true, cwd: './<%= def.jsorolla %>', src: ['vendor/font-awesome-4.1.0/**'], dest: '<%= def.build %>' },
{ expand: true, cwd: './<%= def.jsorolla %>', src: ['vendor/d3.min.js'], dest: '<%= def.build %>' },
{ expand: true, cwd: './<%= def.jsorolla %>', src: ['vendor/three.min.js'], dest: '<%= def.build %>' },
{ expand: true, cwd: './<%= def.jsorolla %>', src: ['vendor/platform.js'], dest: '<%= def.build %>' },
{ expand: true, cwd: './<%= def.jsorolla %>', src: ['vendor/ext-5/**'], dest: '<%= def.build %>' },
{ expand: true, cwd: './<%= def.jsorolla %>', src: ['vendor/highcharts/**'], dest: '<%= def.build %>' },
{ expand: true, cwd: './<%= def.jsorolla %>', src: ['styles/**'], dest: '<%= def.build %>' }, // includes files in path and its subdirs
{ expand: true, cwd: './<%= def.jsorolla %>', src: ['src/lib/components/jso-color-picker.html'], dest: '<%= def.build %>/components', flatten: true},
{ expand: true, cwd: './', src: ['src/components/**'], dest: '<%= def.build %>/components', flatten: true},
{ expand: true, cwd: './src', src: ['*.sif'], dest: '<%= def.build %>/' },
{ expand: true, cwd: './src', src: ['*.attr'], dest: '<%= def.build %>/' },
{ expand: true, cwd: './<%= def.jsorolla %>/build/<%= jsopkg.version %>/network-viewer', src: ['*.js'], dest: '<%= def.build %>' },
{ expand: true, cwd: './<%= def.jsorolla %>/src/network-viewer-webgl', src: ['network-viewer-webgl.js'], dest: '<%= def.build %>' }
]
}
},
clean: {
dist: ['<%= def.build %>/']
},
processhtml: {
options: {
strip: true
},
dist: {
files: {
'<%= def.build %>/index.html': ['src/<%= def.name %>.html']
}
}
},
hub: {
'cell-maps': {
src: ['<%= def.jsorolla %>/Gruntfile.js'],
tasks: ['nv']
}
}
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-processhtml');
grunt.loadNpmTasks('grunt-hub');
// Default task.
grunt.registerTask('default', ['hub','clean', 'concat', 'uglify', 'copy', 'processhtml']);
};