android / android-studio-poet

Large Android projects generator
Apache License 2.0
702 stars 85 forks source link

Save dependencies adjacency matrix in a png image #95

Closed srmurguia closed 6 years ago

srmurguia commented 6 years ago

For large projects with many module dependencies, the dependency graph can be dificult to visualize. Now, a png image is generated with a representation of the adjacency matrix.

The first row and first columns are headers, the colors there represent the type of module:

If the cell in row r and column c is green, it means that the module associated with that row has a dependency with the module associated with that column. We can add different colors for different dependency methods later (api, implementation, testImplementation, etc).

This image was created using these settings:

"topologies": [ {"type": "binary_tree", "seed": "2"} ], "dependencies": [ {"from": "module1", "to": "module0"} ]

On a project with 20 Android and 50 pure modules

dependencies

srmurguia commented 6 years ago

Last two commits incorporates the feedback from @NikitaKozlov.

This is an example of how the image colors changed after the last two commits:

prueba

The colors match the colors in https://docs.gradle.org/current/userguide/java_library_plugin.html#sec:java_library_configurations_graph

Right now the test for the image only checks the size, but not the content, the attached image is the image generated during the tests. What do you think is the best approach to test its content?

NikitaKozlov commented 6 years ago

@srmurguia maybe just store an "expected" image and compare it with generated one?

NikitaKozlov commented 6 years ago

LGTM