Skip to content

Commit 0cb7b33

Browse files
committed
Update documentation
1 parent 3cb5ffe commit 0cb7b33

File tree

1 file changed

+86
-5
lines changed

1 file changed

+86
-5
lines changed

README.MD

Lines changed: 86 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,21 +167,35 @@ dependencies {
167167
## Define Module versions in a version catalog
168168

169169
Alternatively, versions can be defined in the `[version]` block of a [version catalog](https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog).
170-
- *Note:* Since `.` is not supported, you need to use `_` as delimiter in the module names.
170+
- *Note, if you use the _libs.versions.toml_ notation:* Since `.` is not supported, you need to use `_` as delimiter in the module names.
171+
172+
**settings.gradle.kts**
173+
174+
```
175+
dependencyResolutionManagement {
176+
versionCatalogs.create("libs") {
177+
version("org.apache.xmlbeans", "5.0.1")
178+
version("com.fasterxml.jackson.databind", "2.12.5")
179+
version("org.slf4j", "2.0.7")
180+
181+
version("org.junit.jupiter.api", "5.8.2")
182+
}
183+
}
184+
```
171185

172186
**gradle/libs.versions.toml**
173187
```
174188
[versions]
175189
org_apache_xmlbeans = "5.0.1"
176190
com_fasterxml_jackson_databind = "2.12.5"
177-
org_slf4j = "1.7.32"
191+
org_slf4j = "2.0.7"
178192
179193
org_junit_jupiter_api = "5.7.2"
180194
```
181195

182196
- _If_ you use a catalog, the plugin will warn if a version it looks for is missing.
183197
You can turn these warnings off using `warnForMissingVersions.set(false)`.
184-
- _If_ you use a catalog with a custom name (not `libs`), you can tell the plugin using `getVersionCatalogName.set("customName")`.
198+
- _If_ you use a catalog with a custom name (not `libs`), you can tell the plugin using `versionCatalogName.set("customName")`.
185199

186200
## Find the latest stable version of a Module
187201

@@ -236,16 +250,83 @@ org_slf4j_simple = "1.7.36"
236250

237251
## Check module-info.java files
238252

239-
You can use the `checkAllModuleInfo` check task to fail the build if require directives are not defined in alphabetical order in your `module-info.java` files.
253+
You can use the `checkAllModuleInfo` check task to validate all `module-info.java` files for the following:
254+
255+
- Do the _requires_ directives correspond to what is needed in the source code?
256+
To activate this functionality, you need to apply the [com.autonomousapps.dependency-analysis](https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin) in the root project.
257+
- Are the _requires_ directives defined in alphabetical order?
240258

241259
## Analyze Module Paths
242260

243-
You can use the `analyzeModulePath` help task to analyse the Module Paths of a project.
261+
You can use the `moduleDependencies` and `analyzeModulePath` help task to analyse the Module Paths of a project.
244262
It will show you which Modules are used and to which GAV coordinates they map.
245263
It will also print potential issues - like Jars that are not Modules
246264
(and are therefore put on the classpath)
247265
or wrong custom mappings from Module Names to GAs where the Jars are not Modules.
248266

267+
```
268+
$ ./gradlew :app:moduleDependencies --configuration=runtimeClasspath -q
269+
270+
------------------------------------------------------------
271+
Project ':app'
272+
------------------------------------------------------------
273+
274+
runtimeClasspath - Runtime classpath of source set 'main'.
275+
+--- org.example.product.bespin
276+
| +--- org.example.product.corellia
277+
| | +--- org.apache.poi.poi (5.2.2)
278+
| | | +--- org.apache.commons.codec (1.15)
279+
| | | +--- org.apache.commons.collections4 (4.4)
280+
| | | +--- commons.math3 (3.6.1)
281+
| | | +--- org.apache.commons.io (2.11.0)
282+
| | | +--- SparseBitSet (1.2)
283+
| | | \--- org.apache.logging.log4j (2.17.2)
284+
| | +--- org.apache.commons.io (2.11.0)
285+
| | \--- org.apache.poi.ooxml (5.2.2)
286+
| | +--- org.apache.poi.poi (5.2.2) (*)
287+
| | +--- org.apache.poi.ooxml.schemas (5.2.2)
288+
| | | \--- org.apache.xmlbeans (5.0.3)
289+
| | | \--- org.apache.logging.log4j (2.17.2)
290+
| | +--- org.apache.xmlbeans (5.0.3) (*)
291+
| | +--- org.apache.commons.compress (1.21)
292+
| | +--- org.apache.commons.io (2.11.0)
293+
| | +--- com.github.virtuald.curvesapi (1.07)
294+
| | +--- org.apache.logging.log4j (2.17.2)
295+
| | \--- org.apache.commons.collections4 (4.4)
296+
| +--- org.example.product.coruscant
297+
| | +--- com.fasterxml.jackson.annotation (2.13.4)
298+
| | +--- com.fasterxml.jackson.databind (2.13.4)
299+
| | | +--- com.fasterxml.jackson.annotation (2.13.4)
300+
| | | \--- com.fasterxml.jackson.core (2.13.4)
301+
| | +--- com.google.common (30.1-jre)
302+
| | +--- java.inject (1.0.5)
303+
| | +--- com.fasterxml.jackson.core (2.13.4)
304+
| | +--- com.fasterxml.jackson.datatype.jsr310 (2.13.4)
305+
| | | +--- com.fasterxml.jackson.annotation (2.13.4)
306+
| | | +--- com.fasterxml.jackson.core (2.13.4)
307+
| | | \--- com.fasterxml.jackson.databind (2.13.4) (*)
308+
| | +--- jakarta.activation (1.2.2)
309+
| | +--- jakarta.mail (1.6.7)
310+
| | | \--- jakarta.activation (1.2.2)
311+
| | \--- org.slf4j (2.0.3)
312+
| \--- velocity.engine.core (2.3)
313+
| +--- org.apache.commons.lang3 (3.11)
314+
| \--- org.slf4j (2.0.3)
315+
+--- org.example.product.corellia (*)
316+
+--- org.example.product.kamino
317+
| \--- org.example.product.coruscant (*)
318+
+--- org.example.product.kashyyyk
319+
| +--- org.example.product.naboo
320+
| +--- org.example.product.tatooine
321+
| +--- org.example.product.bespin (*)
322+
| \--- org.example.product.kamino (*)
323+
+--- org.example.product.naboo
324+
+--- org.example.product.tatooine
325+
+--- jakarta.servlet (6.0.0)
326+
\--- org.slf4j (2.0.3)
327+
```
328+
329+
249330
```
250331
$ ./gradlew :app:analyzeModulePath -q
251332

0 commit comments

Comments
 (0)