-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathGruntfile.js
More file actions
159 lines (130 loc) · 5.05 KB
/
Gruntfile.js
File metadata and controls
159 lines (130 loc) · 5.05 KB
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
155
156
157
158
159
/*
* grunt-phpdocumentor
* https://github.com/gomoob/grunt-phpdocumentor
*
* Copyright (c) 2013 Baptiste Gaillard
* Licensed under the MIT license.
*/
'use strict';
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
jshint : {
all : [ 'Gruntfile.js', 'tasks/*.js', 'test/*.js', ],
options : {
jshintrc : '.jshintrc',
}
},
// Before generating any new files, remove any previously-created files.
clean : [ 'docs', 'target' ],
// Task to be run (and then tested)
phpdocumentor : {
// Task-level options
options : {
command : 'run'
},
// Configuration used by the 'testForList()' unit test method
testForList : {
options : {
command : 'list'
}
},
// Configuration used by the 'testForParse()' unit test method
testForParse : {
options : {
command : 'parse'
}
},
// Configuration used by the 'testForProjectParse()' unit test method
testForProjectParse : {
options : {
command : 'project:parse'
}
},
// Configuration used by the 'testForProjectRun()' unit test method
testForProjectRun : {
options : {
command : 'project:run',
target : 'target/testForProjectRun'
}
},
// Configuration used by the 'testForProjectTransform()' unit test method
// FIXME: 'transform' is not supported for the moment
/*testForProjectTransform : {
options : {
command : 'project:transform'
}
},*/
// Configuration used by the 'testForTemplateGenerate()' unit test method
// FIXME: 'template:generate' is not supported for the moment
// @see http://www.phpdoc.org/docs/latest/for-users/commands/template_generate.html
/*testForTemplateGenerate : {
options : {
command : 'template:generate'
}
},*/
// Configuration used by the 'testForTemplateList()' unit test method
testForTemplateList : {
options : {
command : 'template:list'
}
},
// Configuration used by the 'testForTemplatePackage()' unit test method
// FIXME: 'template:package' is not supported for the moment
/*testForTemplatePackage : {
options : {
command : 'template:package'
}
},*/
// Configuration used by the 'testForTransform()' unit test method
// FIXME: 'transform' is not supported for the moment
/*testForTransform : {
options : {
command : 'transform'
}
},*/
// Configuration used by the 'testWithCustomPharFile()' unit test method
testWithCustomPharFile : {
options : {
phar : 'test/fixtures/phpDocumentor.phar',
target : 'target/testWithCustomPharFile'
}
},
// Configuration used by the 'testWithDefaultOptions()' unit test method
testWithDefaultOptions : {},
// Configuration used by the 'testWithNullPhar()' unit test method
testWithNullPhar : {
options : {
phar : null,
target : 'target/testWithNullPhar'
}
},
// Configuration used by the 'testWithTarget()' unit test method
testWithTarget : {
options : {
target : 'target/testWithTarget'
}
},
// Configuration used by the 'testOverwriteTaskLevelOptions()' unit test method
testWithTaskOptionsOverwriting : {
options : {
command : 'help'
}
}
},
// Unit tests.
nodeunit : {
tests : [ 'test/*_test.js' ],
},
});
// Actually load this plugin's task(s).
grunt.loadTasks('tasks');
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-nodeunit');
// Whenever the "test" task is run, first clean the "tmp" dir, then run this plugin's task(s), then test the result.
grunt.registerTask('test', [ 'clean', 'nodeunit' ]);
// By default, lint and run all tests.
grunt.registerTask('default', [ 'jshint', 'test' ]);
};