forked from elabftw/elabftw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
69 lines (65 loc) · 2.48 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
/**
* Gruntfile.js
*
* Run 'grunt' in shell to compile javascript and css files
*
*/
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= pkg.version %> <%= pkg.homepage %> */\n',
mangle: false
},
dist: {
files: {
'js/elabftw.min.js': ['js/common.js', 'js/cornify.js', 'js/jquery.rating.js', 'js/keymaster/keymaster.js', 'js/todolist.js', 'js/fancybox/source/jquery.fancybox.pack.js', 'js/colorpicker/jquery.colorpicker.js', 'js/jeditable/jquery.jeditable.js', 'js/jquery.complexify.js/jquery.complexify.js', 'js/jquery.complexify.js/jquery.complexify.banlist.js', 'js/3Dmol-nojquery.js', 'js/3dmol_helpers.js', 'js/dropzone/dist/min/dropzone.min.js'],
'js/chemdoodle/chemdoodle.min.js': ['js/chemdoodle/chemdoodle-unpacked.js', 'js/chemdoodle/chemdoodle-uis-unpacked.js']
}
}
},
watch: {
files: ['<%= uglify.files %>'],
tasks: ['uglify']
},
cssmin: {
target: {
files: {
'app/css/main.min.css': ['app/css/tagcloud.css', 'app/css/jquery.rating.css', 'app/css/autocomplete.css', 'js/dropzone/dist/min/dropzone.min.css', 'js/fullcalendar/dist/fullcalendar.css', 'app/css/main.css'],
'app/css/pdf.min.css': ['app/css/pdf.css']
}
}
},
shell: {
builddoc: {
command: 'cd doc; make html'
},
buildapi: {
command: 'phpdoc run -d app/classes -d app/models -d app/controllers -d app/views -t doc/api'
},
rununit: {
command: 'php vendor/bin/codecept run unit'
},
// xdebug must be DISABLED
runtests: {
command: 'php vendor/bin/codecept run --skip functionnal; cp -f config.php.dev config.php'
},
// xdebug must be ENABLED
runcoverage: {
command: 'php vendor/bin/codecept run --skip acceptance --skip functionnal --coverage --coverage-html'
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-shell');
grunt.registerTask('default', ['uglify', 'cssmin']);
grunt.registerTask('css', 'cssmin');
grunt.registerTask('doc', 'shell:builddoc');
grunt.registerTask('api', 'shell:buildapi');
grunt.registerTask('test', 'shell:runtests');
grunt.registerTask('unit', 'shell:rununit');
grunt.registerTask('cov', 'shell:runcoverage');
};