iurysza / module-graph

A Gradle Plugin for visualizing your project's structure, powered by mermaidjs
https://plugins.gradle.org/plugin/dev.iurysouza.modulegraph
MIT License
346 stars 13 forks source link

Could not get unknown property 'Orientation' #24

Closed ceduliocezar closed 10 months ago

ceduliocezar commented 10 months ago

🐛 Describe the bug

Not able to define all properties listed on the documentation.

⚠️ Current behavior

Whenever I sync my project with your plugin applied or execute the gradle task createModuleGraph i get the error:

Build file 'myproject/build.gradle' line: 148

A problem occurred evaluating root project 'myproject'.
> Could not get unknown property 'Orientation' for extension 'moduleGraphConfig' of type dev.iurysouza.modulegraph.gradle.ModuleGraphExtension.

if i comment the orientation it generate correctly.

✅ Expected behavior

I am able to define all the properties available.

💣 Steps to reproduce

  1. Add maven to root build.gradle.
    maven {
            url = uri("https://plugins.gradle.org/m2/")
        }
  2. Apply the plugin
    plugins {
    id "dev.iurysouza.modulegraph" version "0.5.0"
    }
  3. Configure the plugin on root build.gradle
moduleGraphConfig {
    readmePath.set("./README.md")
    heading.set("### Dependency Diagram")
    showFullPath.set(false) // optional
    orientation.set(Orientation.TOP_TO_BOTTOM) //optional
    //linkText.set(LinkText.NONE) // optional
    //theme.set(Theme.NEUTRAL) // optional
    // or you can fully customize it by using the BASE theme:
    // theme.set(Theme.BASE(
    //      mapOf(
    //          "primaryTextColor" to "#fff",
    //          "primaryColor" to "#5a4f7c",
    //          "primaryBorderColor" to "#5a4f7c",
    //          "lineColor" to "#f5a623",
    //          "tertiaryColor" to "#40375c",
    //          "fontSize" to "11px"
    //      )
    //   )
    // )
}
  1. Run the gradle task createModuleGraph or sync the project
ceduliocezar commented 10 months ago

The weird part is that if i command click on orientation property it leads me to the ModuleGraphExtension and i can see all the properties there.

image

image

ceduliocezar commented 10 months ago

The same is hapenning for linkText and theme.

ceduliocezar commented 10 months ago

I figured out the problem.

Apparently you need to import those Orientation and the classes to be able to use them.

Somehow the message was a bit misleading.

So either use directly the full name with package or import the classes at the top of the gradle file.

@iurysza maybe consider changing the readme documentation to include the package name there, it took me sometime to realise what was missing.

iurysza commented 9 months ago

Thanks for the feedback @ceduliocezar! I'll update the README!