You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wrote my own dependencyGraphGenerator. I managed to show the package name including the version.
But as soon as I add any if statement, the task fails:
Execution failed for task ':generateDependencyGraphMyGenerator '.
> Error while evaluating property 'dotFormatGraph' of task ':generateDependencyGraphMyGenerator '
> java.lang.NullPointerException (no error message)
There are no nullpointers / empty values in my own code, I checked that. It seems like I can't manipulate only certain dependencyNodes in the lambda using ifs.
My Generator:
dependencyGraphGenerator {
generators {
myGenerator {
include = { true }
children = { true }
dependencyNode = { node, dependency ->
// Version of Label
String versionedLabel = "${dependency.moduleGroup}:${dependency.moduleName}:${dependency.moduleVersion}"
node.attrs().add(Label.of(versionedLabel))
if (dependency.moduleName.startsWith("app")) {
node.attrs().add(Style.FILLED, Color.rgb("#ADD8E6"))
}
if (dependency.moduleGroup.startsWith('org.apache')) {
node.attrs().add(Style.FILLED, Color.rgb("#d1bc8a"))
}
}
}
}
}
How can I implement this generator, so some attributes will only be applied to dependency which fulfill a certain condition?
Thanks for your help
The text was updated successfully, but these errors were encountered:
NiC0x36
changed the title
Custom Graph Generator: Apply certain attributes only to certain dependencyNodes
Custom Graph Generator: Conditional Attributes for Dependency Nodes
Aug 26, 2023
I wrote my own dependencyGraphGenerator. I managed to show the package name including the version.
But as soon as I add any if statement, the task fails:
There are no nullpointers / empty values in my own code, I checked that. It seems like I can't manipulate only certain dependencyNodes in the lambda using ifs.
My Generator:
How can I implement this generator, so some attributes will only be applied to dependency which fulfill a certain condition?
Thanks for your help
The text was updated successfully, but these errors were encountered: