Skip to content

Commit

Permalink
Update docs and error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeNeedham committed May 17, 2024
1 parent 335363c commit dcd0c2c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
33 changes: 33 additions & 0 deletions plugin-build/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
This is the source for the Module Graph Gradle plugin.

# Workflow

The recommended workflow is to navigate to the root and run:

- `./gradlew reformatAll` - for auto-fixing formatting issues
- `./gradlew preMerge` - for validating everything (this runs ktlint, detekt and tests)

# Formatting

The code style of this project is enforced with Detekt. Run it with:
`./gradlew :plugin-build:modulegraph:detekt`

Expand All @@ -9,9 +17,34 @@ Also check Ktlint:
`./gradlew :plugin-build:modulegraph:ktlintTestSourceSetCheck`

# Test

This project has extensive unit tests. Run them locally with:
`./gradlew :plugin:modulegraph:test`

# Sample project

Check out the sample project to test out the plugin. Create graphs with:
`./gradlew createModuleGraph`

# Local publish

You can test a local release of this plugin on another local project by publishing the plugin
locally.

Run:
`./gradlew :plugin-build:modulegraph:publishToMavenLocal`

Then in the **consumer** project, make sure `mavenLocal` is a configured repository.
In `settings.gradle`:

```
pluginManagement {
repositories {
mavenLocal()
...
}
}
```

Give `mavenLocal` priority over all other repositories by putting in first in the list.
This ensures the plugin will use your local publish over official releases.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ abstract class CreateModuleGraphTask : DefaultTask() {
fun execute() {
runCatching {
val results =
graphModels.orNull ?: error("Graph models have not been computed on time!")
graphModels.orNull
?: error("Graph models have not been computed. This is a bug in the plugin - please report it!")
results.forEach { result ->
val config = result.config
val mermaidGraph = Mermaid.generateGraph(result)
Expand Down

0 comments on commit dcd0c2c

Please sign in to comment.