Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce maven-based visualization plugin #62

Open
smagellan opened this issue Nov 3, 2015 · 7 comments
Open

Introduce maven-based visualization plugin #62

smagellan opened this issue Nov 3, 2015 · 7 comments

Comments

@smagellan
Copy link

E.g. look at sonar: it is possible to invoke sonar analysis even without altering project's pom.xml: just alter your global setting.xml(example: https://gist.github.com/nkabir/2159177 ), then execute mvn sonar:sonar.
Is it hard to introduce same functionality(degraph maven plugin) into Degraph suite?

@schauder
Copy link
Collaborator

schauder commented Nov 3, 2015

This would certainly be possible and AFAIK all one needs for this is a maven plugin for Degraph. Although I never wrote a Maven plugin, it's supposedly rather easy.

Unfortunately my time is very limited and a Maven plugin isn't very high on my list of priorities. So I won't implement this in the foreseeable future.

But if somebody else wants to do it, I'll support the effort (setting it up in the build file, making modifications to the core if necessary, accepting the pull request ..).

@smagellan
Copy link
Author

I did not write them before, too. Excellent reason to try.

@schauder
Copy link
Collaborator

schauder commented Nov 3, 2015

If you want to do it you have two options:

  • create your own project depending on degraph core
  • or create a new module in this project and make a pull request.

If you want follow one of these roads, let me know, I can put together some pointers how to get started with the degraph side of things

@janschaefer
Copy link

The implementation of the plugin would be rather easy I guess, however, building a maven plugin using gradle is not directly possible (AFAIK). You can have a look at the jgiven-maven-plugin, which also uses gradle, but requires maven behind the scenes for building the plugin: https://github.com/TNG/JGiven/tree/master/jgiven-maven-plugin

@smagellan
Copy link
Author

@janschaefer, thank you, I will take a look.

@smagellan
Copy link
Author

@schauder, I like option no. 2: new module in this project.
I have 2 questions:

  1. How to embed degraph into application? How gradle plugin embeds and runs core? It is good idea to share execution interface between gradle and maven plugins.
  2. How to build settings and feed it into core?

@schauder
Copy link
Collaborator

schauder commented Nov 7, 2015

The plugin would have a dependency on degraph-core so it can use the Degraph functionality.

For how to use it, probably the best is to look at the Degraph main method: https://github.com/schauder/degraph/blob/master/degraph/src/main/scala/de/schauderhaft/degraph/app/Degraph.scala

You create a Configuration instance, pass in an (Analyzer)[https://github.com/schauder/degraph/blob/master/core/src/main/scala/de/schauderhaft/degraph/analysis/asm/Analyzer.scala] and get out a (Graph)[https://github.com/schauder/degraph/blob/master/core/src/main/scala/de/schauderhaft/degraph/graph/Graph.scala], which contains information about violations of Constraints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants