./dtcw copyTask generateHTML
copyTask
About This Task
copyTask copies an installed task script into your project so you can modify it
— monkey-patching. The project copy has the same name as the installed task and
therefore overrides it: dtcw runs your copy instead of the shipped one.
This copies the installed generateHTML.groovy to scripts/generateHTML.groovy
in your project. Edit it, then run ./dtcw generateHTML as usual.
Setup and Configuration
-
Pass the name of an existing installed task. Run
./dtcw tasksto see the available names. -
The copy is placed in
scripts/by default; override withDTC_PROJECT_SCRIPTS_DIR. -
copyTaskrefuses to overwrite an existing project copy.
How the Override Behaves
-
./dtcw generateHTMLprints a note to stderr that the installed task is being overridden by your project file. -
./dtcw tasksflags the task asoverridden by scripts/generateHTML.groovy. -
The copy still loads its bundled helpers and resources from the installation via
dtc.scriptsHome, so it keeps working unchanged. -
Delete the copy to fall back to the shipped task.
|
Warning
|
A copied task is pinned to the version you copied. After upgrading docToolchain, re-copy it if you want upstream changes. |
Further Reading and Resources
-
createTask — scaffold a brand-new custom task
Source
View the source of this task: scripts/copyTask.groovy on GitHub
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.