forked from anspress/anspress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
154 lines (147 loc) · 4.31 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
pkg: grunt.file.readJSON( 'package.json' ),
makepot: {
target: {
options: {
domainPath: '/languages', // Where to save the POT file.
exclude: ['.git/.*', '.svn/.*', '.node_modules/.*', '.vendor/.*'],
mainFile: 'anspress-question-answer.php',
potHeaders: {
poedit: true, // Includes common Poedit headers.
'x-poedit-keywordslist': true // Include a list of all possible gettext functions.
}, // Headers to add to the generated POT file.
type: 'wp-plugin', // Type of project (wp-plugin or wp-theme).
updateTimestamp: true // Whether the POT-Creation-Date should be updated without other changes.
}
}
},
addtextdomain: {
options: {
textdomain: 'anspress-question-answer', // Project text domain.
updateDomains: ['ap'] // List of text domains to replace.
},
target: {
files: {
src: [
'*.php',
'**/*.php',
'!node_modules/**',
'!tests/**',
'!.git/.*', '!.svn/.*', '!.vendor/.*'
]
}
}
},
phpdocumentor: {
dist: {
options: {
directory : './',
target : 'M:\wamp\www\anspress-docs\\'
}
}
},
csscomb: {
files: ['**/*.css', '!**/node_modules/**'],
tasks: ['csscomb'],
},
copy: {
main: {
files: [
{nonull:true, expand: true, cwd: 'M:\\xampp\\htdocs\\anspress\\wp-content\\plugins\\anspress-question-answer', src: ['**/*', '!**/.git/**', '!**/.svn/**', '!**/node_modules/**', '!**/bin/**', '!**/docs/**', '!**/tests/**'], dest: 'M:\\wamp\\www\\aptest\\wp-content\\plugins\\anspress-question-answer'},
{nonull:true, expand: true, cwd: 'M:\\xampp\\htdocs\\anspress\\wp-content\\plugins\\anspress-question-answer', src: ['**/*', '!**/.git/**', '!**/.svn/**', '!**/node_modules/**', '!**/bin/**', '!**/docs/**', '!**/tests/**'], dest: 'M:\\xampp\\htdocs\\askbug\\wp-content\\plugins\\anspress-question-answer'}
]
}
},
version: {
css: {
options: {
prefix: 'Version\\:\\s'
},
src: [ 'style.css' ],
},
php: {
options: {
prefix: 'Version\\:\\s+'
},
src: [ 'anspress-question-answer.php' ],
},
mainplugin: {
options: {
pattern: '\$_plugin_version = (?:\')(.+)(?:\')/g'
},
src: [ 'anspress-question-answer.php' ],
},
project: {
src: ['plugin.json']
}
},
sass: {
dist: {
options: {
style: 'expanded'
},
files: {
"templates/css/main.css": "templates/scss/main.scss",
"templates/css/RTL.css": "templates/scss/RTL.scss",
"assets/ap-admin.css": "assets/ap-admin.scss"
}
}
},
uglify: {
my_target: {
files: {
'assets/js/min/question.min.js': ['assets/js/question.js'],
'assets/js/min/common.min.js': ['assets/js/common.js'],
'assets/js/min/upload.min.js': ['assets/js/upload.js'],
'assets/js/min/ap-admin.min.js': ['assets/js/ap-admin.js'],
'assets/js/min/ask.min.js': ['assets/js/ask.js'],
'assets/js/min/list.min.js': ['assets/js/list.js'],
'assets/js/min/tags.min.js': ['assets/js/tags.js'],
'assets/js/min/notifications.min.js': ['assets/js/notifications.js'],
'templates/js/min/theme.min.js': ['templates/js/theme.js'],
}
}
},
wp_readme_to_markdown: {
your_target: {
files: {
'README.md': 'readme.txt'
},
},
},
phplint : {
options : {
spawn : false
},
all: ['**/*.php']
},
cssmin: {
options: {
shorthandCompacting: false,
roundingPrecision: -1,
rebase: true
},
target: {
files: {
'templates/css/min/main.min.css': 'templates/css/main.css',
'templates/css/min/RTL.min.css': 'templates/css/RTL.css',
'templates/css/min/fonts.min.css': 'templates/css/fonts.css',
'assets/ap-admin.min.css': 'assets/ap-admin.css'
}
}
},
watch: {
sass: {
files: ['**/*.scss'],
tasks: ['sass', 'cssmin'],
},
uglify: {
files: ['templates/js/*.js','assets/js/*.js'],
tasks: ['uglify'],
}
},
});
grunt.registerTask( 'build', [ 'phplint', 'makepot', 'version', 'sass', 'uglify', 'compress' ]);
}