-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
63 lines (55 loc) · 1.25 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
/**
* Grunt configuration file.
*
* @package WordPoints_BuddyPress
* @since 1.0.0
*/
/* jshint node:true */
module.exports = function( grunt ) {
var SOURCE_DIR = 'src/',
DEV_LIB_DIR = 'dev-lib/';
// Load tasks.
require( 'matchdep' ).filterDev( 'grunt-*' ).forEach( grunt.loadNpmTasks );
grunt.loadTasks( DEV_LIB_DIR + 'grunt/tasks/' );
// Project configuration.
grunt.initConfig({
autoloader: {
all: {
src_dir: SOURCE_DIR,
prefix: 'wordpoints_bp_',
filter: function ( class_files ) {
// This class needs to come before other event classes.
class_files.splice(
class_files.indexOf( 'entity.php' ) + 1
, 0
, class_files.splice(
class_files.indexOf( 'entity/activity/user.php' )
, 1
)[0]
);
return class_files;
}
}
},
watch: {
autoloader: {
files: [
SOURCE_DIR + '**/classes/**/*.php',
'!' + SOURCE_DIR + '**/classes/index.php'
],
tasks: ['autoloader'],
options: {
event: [ 'added', 'deleted' ]
}
},
// This triggers an automatic reload of the `watch` task.
config: {
files: 'Gruntfile.js',
tasks: ['build']
}
}
});
grunt.registerTask( 'build', ['autoloader'] );
grunt.registerTask( 'default', 'build' );
};
// EOF