-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
40 lines (36 loc) · 1.31 KB
/
Gruntfile.js
File metadata and controls
40 lines (36 loc) · 1.31 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
/**
* DocumentorJS
* ----------------------------------------------
* This Grunt Module helps to document resources automagically.
* Add a New Grunt Watch and Grunt Exec for each DocGroup,
* to add the config vals add to configGroup the required inputs.
* ----------------------------------------------
* @author Daniel Vera <danyelmorales1991 at gmail.com>
*/
const path = require('path');
var gruntmodule = require('./lib/documentor/grunt.module.js');
var configFile = "./apidoc.config.js";
var pathOP = undefined;
var packagePath = 'package.json';
// DOCUMENTOR EXPORT
module.exports = function (grunt) {
if(typeof grunt.option("invokedFrom") != "undefined" &&
typeof grunt.option("configFile") != "undefined" &&
typeof grunt.option("packagePath") != "undefined")
{
pathOP = grunt.option("invokedFrom");
configFile = grunt.option("configFile");
packagePath = grunt.option("packagePath");
}
var apidocconfig = require(configFile);
var documentAutomation = gruntmodule(apidocconfig, pathOP);
grunt.initConfig({
pkg: grunt.file.readJSON(packagePath)
, apidoc: documentAutomation.getApidocs()
, watch: documentAutomation.getWatchers()
});
grunt.loadNpmTasks('grunt-apidoc');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-exec');
grunt.registerTask('default', ["watch"]);
};