cosminpolifronie / gradle-plantuml-plugin

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

Create same directory structure in output when using glob #4

Open mdnorman opened 4 years ago

mdnorman commented 4 years ago

When using a glob for hte input (eg src/doc/**/*.puml), the output should be generated in the same directory structure under the output directory.

For example, an input of src/doc/conceptual/conceptual-model.puml should be output to build/doc/conceptual/conceptual-model.png if the output was ${project.buildDir.absolutePath}/docs

This would help with keeping the documentation organized into directories.

Without this, globs cannot realistically be used for the input, and each input directory of PlantUML files must have a separate line in the gradle file.

cosminpolifronie commented 4 years ago

Thank you for your report! I will start looking into this after the 5th of February, as I will soon have my final exam for my BSc diploma.

alexsapran commented 3 years ago

I faced the same issue today.

I solved it in a nonideal way, by using a ConfigurableFileTree and iterating through the files issuing a render for each inside the plantuml task

Example

   val tree: ConfigurableFileTree = fileTree(projectDir) {
        include("**/*.puml")
        exclude("whatever-here")
    }
    tree.visit {
        if (!this.isDirectory) {
            ...render...
        } 
    }

minor my project is using Kotlin