Skip to content

neterra/EventBusGraph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EventBusGraph

If you use EventBus from greenrobot, you will find EventBusGraph very helpful.
EventBusGraph Scans java files, looking for post() and onEvent() methods and generates an HTML file that shows the relationships between events, posts and onEvents.

Dependencies

To view the graphs, it is necessary to add the viz.js library in the same folder where the HTML file is. You can download it from:

viz.js download

EventBusGraph in 3 steps

  1. Create a config_file with the base paths of the files to scan and the output folder:
    path/to/base/one
    path/to/another_base/two
    ... more paths ...
    path/to/the_last_base
    path_out = path/to/output_folder

  2. Run the command:
    python eventbus_graph.py config_file

  3. Open the generated HTML file in your favorite browser.

Conventions

  • Use: EventBus.getDefault() or mEventBus, example:
EventBus.getDefault().post(new String("Hello"));
EventBus mEventBus = EventBus.getDefault();
mEventBus.post(new String("Hello"));
  • Use cast to the same class if you create your objects outside the post, example:
String event = "message";
EventBus.getDefault().post((String)event);

Limitations

  • Doesn't recognize comments (at least for now). You shouldn't comment post or onEvents methods. They will be showed any way.
  • Unable to analyze if the methods are called between the register() and unregister() methods.

About

If you are using EventBus for Android, EventBusGraph will help you generating graphs that show the relationships between events, posts and onEvents.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors