forked from pedrolsazevedo/git-webui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
81 lines (74 loc) · 2.35 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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
copy: {
jquery: {
expand: true,
flatten: true,
src: 'bower_components/jquery/dist/jquery.min.js',
dest: 'dist/share/git-webui/webui/js/',
},
bootstrap: {
expand: true,
flatten: true,
src: 'bower_components/bootstrap/dist/js/bootstrap.min.js',
dest: 'dist/share/git-webui/webui/js/',
},
git_webui: {
options: {
mode: true,
},
expand: true,
cwd: 'src',
src: ['libexec/**', 'share/**', '!**/less', '!**/*.less'],
dest: 'dist',
},
release: {
options: {
mode: true,
},
expand: true,
cwd: 'dist',
src: '**',
dest: 'release',
},
},
less: {
options: {
paths: 'bower_components/bootstrap/less',
},
files: {
expand: true,
cwd: 'src',
src: 'share/git-webui/webui/css/*.less',
dest: 'dist',
ext: '.css',
},
},
shell: {
serve: {
command: './dist/libexec/git-core/git-webui'
},
},
watch: {
scripts: {
files: ['src/libexec/**/*', 'src/share/**/*.js', 'src/share/**/*.html'],
tasks: 'copy:git_webui'
},
css: {
files: 'src/**/*.less',
tasks: 'less',
},
},
clean: ['dist'],
});
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('copytodist', ['copy:jquery', 'copy:bootstrap', 'copy:git_webui']);
grunt.registerTask('default', ['copytodist', 'less']);
grunt.registerTask('serve', ['default', 'shell:serve']);
grunt.registerTask('release', ['default', 'copy:release']);
};