Implement Module-Type Based Styling #35
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🚀 Description
This PR introduces enhancements to the module graph visualization by adding plugin-type-based styling options.
There's default support and set precedence for key plugins, namely:
- React Native
- Kotlin Multiplatform
- Android Application
- Android Library
- Kotlin
- Java Library
- Java
To enable the custom styling, users need to use the
setStyleByPluginType
option.moduleGraphConfig { setStyleByPluginType.set(true) }
The supported plugins already have a default color pattern , but users can also customize them via the
Theme.BASE
objec.Finally, you can add custom styling for other plugins by providing a
CustomPlugin
with anid
and its color.eg.:
Important
We determine the module's plugin type based on the plugins applied to it. We need to sort out a precedence order because a
module
might have several plugins.So for example, if a module has both
react-native
andandroid-library
on it, it's identified asreact-native
. But if it has bothandroid-library
andkotlin
, then it's anandroid-library
.Example graph
📄 Motivation and Context
This feature will help developers quickly identify module types, aiding in better understanding their project's architecture and dependency relationships.
Solves #20
🧪 How Has This Been Tested?
Manual tests.
Unit testing is WIP
📦 Types of changes
✅ Checklist