forked from ThaumicMekanism/venus
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
98 lines (96 loc) · 3.5 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
87
88
89
90
91
92
93
94
95
96
97
98
module.exports = function(grunt) {
grunt.initConfig({
qunit: {
src: ['qunit/test.html'],
force: true
},
uglify: {
options: {
banner: '/*! venus <%= grunt.template.today("dd-mm-yyyy") %> */\n'
},
venus: {
files: {
'out/js/venus.js': ['build/kotlin-js-min/main/venus.js'],
'out/js/kotlin.js': ['build/kotlin-js-min/main/kotlin.js'],
'out/js/codemirror/codemirror.js': ['src/main/frontend/js/codemirror/*.js']
}
}
},
cssmin: {
venus: {
files: [{
'out/css/venus.css': ['src/main/frontend/css/*.css', "!src/main/frontend/css/alertify/*", "!src/main/frontend/css/themes/*"],
},
{
expand: true,
cwd: 'src/main/frontend/css/themes/',
src: ['*.css'],
dest: 'out/css/themes/',
}
]
}
},
copy: {
venus: {
files: [
{expand: true,
cwd: 'src/main/frontend/images',
src: '**',
dest: 'out/images/',},
{expand: true,
cwd: 'src/main/frontend/scripts',
src: '**',
dest: 'out/scripts/',},
{expand: true,
cwd: 'src/main/frontend/packages',
src: '**',
dest: 'out/packages/',},
{expand: true,
cwd: 'src/main/frontend/css/alertify',
src: '**',
dest: 'out/css/alertify/',},
{src: 'src/main/frontend/CNAME',
dest: 'out/CNAME',},
]
},
jvm: {
files: [
{expand: true,
cwd: 'build/libs',
dest: 'out/jvm/',
src: [
'venus*.jar'
],
rename: function(dest, src) {
return dest + "venus-jvm-latest.jar"
}
},
]
},
},
htmlmin: {
venus: {
options: {
removeComments: true,
collapseWhitespace: true,
removeEmptyAttributes: true,
removeCommentsFromCDATA: true,
removeRedundantAttributes: true,
collapseBooleanAttributes: true
},
files: {
'out/index.html': ['src/main/frontend/index.html']
}
}
},
});
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-htmlmin');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.registerTask('test', 'qunit:src');
grunt.registerTask('dist', ['uglify:venus', 'cssmin', 'htmlmin', 'copy:venus']);
grunt.registerTask('frontend', ['cssmin:venus', 'htmlmin:venus']);
grunt.registerTask('distjvm', ['copy:jvm']);
};