iurysza / module-graph

A Gradle Plugin for visualizing your project's structure, powered by mermaidjs

Home Page:https://plugins.gradle.org/plugin/dev.iurysouza.modulegraph

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Could not get unknown property 'Orientation'

ceduliocezar opened this issue ยท comments

๐Ÿ› 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/")
        }
  1. Apply the plugin
plugins {
    id "dev.iurysouza.modulegraph" version "0.5.0"
}
  1. 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

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

The same is hapenning for linkText and theme.

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.

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