This plugin can be used to generate REST documentation that can be served by compiled application.
- nodejs
- apidocjs
- global installation
npm install apidoc -g
(you may needsudo
)
- local installation
- in your project folder type
npm install apidoc
(this will create node_modules folder with all dependencies)
- in your project folder type
- global installation
Generates REST API documentation using apidocjs.
Generates minimal apidoc.json configuation file from project variables (name, description, version).
Listening below illustrates how can you use all available options.
If you agree with defaults, you can omit whole apidoc
section.
plugins {
id "com.simplid.gradle.apidoc" version "0.1.0"
}
apidoc {
exec "apidoc"
inputDir "src/main/java/some/package/controllers"
outputDir "$project.buildDir/resources/main/doc"
include ".groovy", ".java"
include ".kt"
exclude ".scala"
exclude ".js"
template "/path/to/template"
configFile "custom/config/apidoc.json"
}
default:
"apidoc"
or"apidoc.cmd"
Full path or name on $path to apidoc executable. If not specified, plugin will check if local copy of
apidoc is avaible inside node_modules/apidoc/bin/
folder in your project, otherwise it will try to
execute apidoc from $path.
default:
"src/main"
Should point to folder where you store all your annotated files. To speed up generation, you should point to folder that directly contains annotated files f.i. controllers or resources package.
default:
"$project.buildDir/resources/main/static/doc"
Where to generate output.
default:
[]
example:
[".*\\\\.(clj|cls|coffee|cpp|cs|dart|erl|exs?|go|groovy|ino?|java|js|jsx|kt|litcoffee|lua|p|php?|pl|pm|py|rb|scala|ts|vue)$"]
RegEx filter to select files that should be parsed. Multiple includes can be used.
default:
[]
RegEx filter to select files/dirs that should not be parsed. Multiple excludes can be used.
default:
"$project.buildDir/apidoc/apidoc.json"
Path to config file OR to directory containing config file apidoc.json
. This setting is used by both tasks.
default:
""
Path to directory containing apidoc template.