forked from projectsend/projectsend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
104 lines (101 loc) · 3.12 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
99
100
101
102
103
104
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
assets_dir: 'assets/',
src_dir: '<%= assets_dir %>src/',
dest_dir: '<%= assets_dir %>dist/',
options_file: './app/includes/options.get.php',
config_file: './app/config/config.php',
dependencies_bower_dir: 'bower_components/',
dependencies_composer_dir: 'vendor/',
dependencies_npm_dir: 'node_modules/',
concat: {
options: {
separator: '\n\n',
},
projectsend: {
src: [
'<%= src_dir %>js/jquery.functions.js',
'<%= src_dir %>js/bulk.actions.js',
'<%= src_dir %>js/jquery.psendmodal.js',
'<%= src_dir %>js/dashboard.widgets.js',
'<%= src_dir %>js/jquery.validations.js',
'<%= src_dir %>js/main.js',
],
dest: '<%= dest_dir %>js/projectsend.js',
},
compatibility: {
src: [
'<%= src_dir %>js/html5shiv.min.js',
'<%= src_dir %>js/respond.min.js',
],
dest: '<%= dest_dir %>js/ie8compatibility.js',
}
},
uglify: {
projectsend: {
options: {
unused: false,
},
files: { '<%= dest_dir %>js/projectsend.min.js' : '<%= dest_dir %>js/projectsend.js' }
},
compatibility: {
files: { '<%= dest_dir %>js/ie8compatibility.min.js' : '<%= dest_dir %>js/ie8compatibility.js' }
}
},
sass: {
dist: {
options: {
style: 'compressed'
},
files: { '<%= dest_dir %>css/main.min.css' : '<%= src_dir %>css/main.scss' }
}
},
setPHPConstant: {
version: {
constant : 'CURRENT_VERSION',
value : '<%= pkg.version %>',
file : '<%= config_file %>'
},
debug: {
constant : 'DEBUG',
value : 'false',
file : '<%= config_file %>'
},
is_dev: {
constant : 'IS_DEV',
value : 'false',
file : '<%= config_file %>'
},
},
compress: {
dist: {
options: {
archive: '<%= pkg.name %>-<%= pkg.version %>.zip'
// This is not implemented yet
// Don't forget to add an ignore to the custom config file config/config.php
},
files: [
{
expand: true,
cwd: './',
src: './*'
}
]
}
},
shell: {
command: ["npm update", "bower update", "composer update"].join('&&')
}
});
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-php-set-constant');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-shell');
grunt.registerTask('default', ['concat', 'uglify', 'sass']);
grunt.registerTask('prepare_dist', ['compress', 'setPHPConstant']);
grunt.registerTask('dependencies_update', ['shell']);
}