cosminpolifronie / gradle-plantuml-plugin

A simple Gradle plugin to render PlantUML files
MIT License
10 stars 5 forks source link

Failure to render generated diagrams #1

Open nikolay-martynov opened 5 years ago

nikolay-martynov commented 5 years ago

Plugin seems to determine all inputs during project configuration. At that time not all diagrams might be already existing. Some diagrams might be generated by other tasks run before plantUml task. Unfortunately, plantUml does not see such diagrams (because they do not exist yet during project configuration) and report their absence. Workaround is to build second time without clean so that plugin sees the diagrams during configuration phase. Instead, plantUml task should use usual gradle api for inputs which dynamically discovers files to operate on when the task is actually called. You can see scan of first build here: https://scans.gradle.com/s/acg3fca45mwea/console-log And scan of second build without clean here: https://scans.gradle.com/s/l2armzps356fa/console-log

These scans were generated for the following config where build/all-sprites.puml is a diagram generated during build:

plantUml {
    render input: 'diagrams/example.puml', output: 'generated-examples/example.png', withMetadata: false
    render input: 'diagrams/sizes.puml', output: 'generated-examples/sizes.png', withMetadata: false
    render input: 'build/all-sprites.puml', output: 'generated-examples/all-sprites.png', withMetadata: false
}
cosminpolifronie commented 5 years ago

This is quite easy to solve but it might take me a week to get to it, depending on how much I'll have on my hands at work.