diff --git a/README.md b/README.md index 82cc63ea3b..caa8fff8ef 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,25 @@ Proof Of Concept to run a Matrix client on Android devices using the Matrix Rust Sdk and Jetpack compose. The plan is [here](https://github.com/vector-im/element-x-android-poc/issues/1)! + + +### Modules + +This Android project is a multi modules project. + +- `app` module is the Android application module. Other modules are libraries; +- `features` modules contain some UI and can be seen as screen of the application; +- `libraries` modules contain classes that can be useful for other modules to work. + +A few details about some modules: + +- `libraries-core` module contains utility classes; +- `libraries-designsystem` module contains Composables which can be used across the app (theme, etc.); +- `libraries-elementresources` module contains resource from Element Android (mainly strings); +- `libraries-matrix` module contains wrappers around the Matrix Rust SDK. + +Here is the current module dependency graph: + + + + diff --git a/build.gradle.kts b/build.gradle.kts index ab8ea28281..97d1e038f1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,6 +9,7 @@ plugins { alias(libs.plugins.kapt) apply false alias(libs.plugins.detekt) alias(libs.plugins.ktlint) + alias(libs.plugins.dependencygraph) } tasks.register("clean").configure { diff --git a/docs/images/module_graph.png b/docs/images/module_graph.png new file mode 100644 index 0000000000..3be0256646 Binary files /dev/null and b/docs/images/module_graph.png differ diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c2faf58e20..5860bbebd2 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -58,6 +58,7 @@ anvil = "2.4.2" # quality detekt = "1.22.0" ktlint = "11.0.0" +dependencygraph = "0.10" [libraries] # Project @@ -78,8 +79,8 @@ androidx_lifecycle_process = { module = "androidx.lifecycle:lifecycle-process", androidx_lifecycle_viewmodel_compose = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "lifecycle" } androidx_activity_compose = { module = "androidx.activity:activity-compose", version.ref = "activity_compose" } -androidx_fragment = {module = "androidx.fragment:fragment-ktx", version.ref = "fragment"} -androidx_startup = { module = "androidx.startup:startup-runtime", version.ref = "startup"} +androidx_fragment = { module = "androidx.fragment:fragment-ktx", version.ref = "fragment" } +androidx_startup = { module = "androidx.startup:startup-runtime", version.ref = "startup" } androidx_compose_bom = { group = "androidx.compose", name = "compose-bom", version.ref = "compose_bom" } androidx_compose_foundation = { group = "androidx.compose.foundation", name = "foundation" } @@ -127,7 +128,7 @@ jsoup = { module = "org.jsoup:jsoup", version.ref = "jsoup" } # Di -inject = {module = "javax.inject:javax.inject", version = "1"} +inject = { module = "javax.inject:javax.inject", version = "1" } dagger = { module = "com.google.dagger:dagger", version.ref = "dagger" } dagger_compiler = { module = "com.google.dagger:dagger-compiler", version.ref = "dagger" } anvil_compiler_api = { module = "com.squareup.anvil:compiler-api", version.ref = "anvil" } @@ -143,8 +144,9 @@ android_application = { id = "com.android.application", version.ref = "android_g android_library = { id = "com.android.library", version.ref = "android_gradle_plugin" } kotlin_android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } kotlin_jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } -kapt = {id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin"} +kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" } ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } -anvil = {id = "com.squareup.anvil", version.ref = "anvil"} +anvil = { id = "com.squareup.anvil", version.ref = "anvil" } detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" } ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" } +dependencygraph = { id = "com.savvasdalkitsis.module-dependency-graph", version.ref = "dependencygraph" } diff --git a/tools/docs/generateModuleGraph.sh b/tools/docs/generateModuleGraph.sh new file mode 100755 index 0000000000..06aa6b3404 --- /dev/null +++ b/tools/docs/generateModuleGraph.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +## Dependency graph https://github.com/savvasdalkitsis/module-dependency-graph +dotPath=`pwd`/docs/images/module_graph.dot +pngPath=`pwd`/docs/images/module_graph.png +./gradlew graphModules -PdotFilePath=${dotPath} -PgraphOutputFilePath=${pngPath} -PautoOpenGraph=false +rm ${dotPath}