Skip to content

Commit

Permalink
Include model class dependency into connector plugin
Browse files Browse the repository at this point in the history
By removing the implementation dependency from connector-plugin to connector-model the published Gradle plugin does not require an external dependency to the model in the generated pom. This obsoletes the need to publish the connector-model separately.
  • Loading branch information
ryru committed Sep 14, 2024
1 parent 884fac6 commit 4cb44b7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ individual modules with the help of [Mermaid](https://mermaid.js.org/).
graph TD
vd2a57d(app) -->|implementation| va74ad8(core)
vd2a57d(app) -->|implementation| v1bc49d(importer)
va02543(connector-plugin) -->|implementation| v91bd8e(connector-model)
va02543(connector-plugin) -->|compileOnly| v91bd8e(connector-model)
v1bc49d(importer) -->|implementation| v91bd8e(connector-model)
v1bc49d(importer) -->|implementation| va74ad8(core)
```
Expand Down Expand Up @@ -78,15 +78,12 @@ Download and setup this project:
git clone https://github.com/ryru/dependency-graph-analyser.git
cd dependency-graph-analyser/
./gradlew clean install
./gradlew :connector-plugin:publishToMavenLocal
```

1. Download the GitHub code repository
2. Change into code directory
3. Make a clean installation of the application (application will be available in the
directory `./app/build/install/dga/bin/dga`)
4. Publish the Gradle tooling API plugin and its data model to Maven local (available in the
directory `~/.m2/repository/ch/addere/dga/`)
3. Make a clean installation of the application (application will be available in the directory
`./app/build/install/dga/bin/dga`)

Get an overview of this project by running `dga .`:

Expand All @@ -95,7 +92,7 @@ Get an overview of this project by running `dga .`:
Analyse project "dependency-graph-analyser"
5 modules
5 dependency configurations (1 unique dependency configurations)
5 dependency configurations (2 unique dependency configurations)
```

Expand All @@ -108,12 +105,12 @@ Use `dga . --chart-mermaid` to generate a Mermaid chart of this project:
Analyse project "dependency-graph-analyser"
5 modules
5 dependency configurations (1 unique dependency configurations)
5 dependency configurations (2 unique dependency configurations)
graph TD
vd2a57d(app) -->|implementation| va74ad8(core)
vd2a57d(app) -->|implementation| v1bc49d(importer)
va02543(connector-plugin) -->|implementation| v91bd8e(connector-model)
va02543(connector-plugin) -->|compileOnly| v91bd8e(connector-model)
v1bc49d(importer) -->|implementation| v91bd8e(connector-model)
v1bc49d(importer) -->|implementation| va74ad8(core)
Expand All @@ -127,9 +124,9 @@ containing the dependencies originating from the module `app`:
```
./app/build/install/dga/bin/dga . -o app --mermaid-graph
Analyse project "dependency-graph-analyser"
Analyse project "dependency-graph-analyser"
5 modules
5 dependency configurations (1 unique dependency configurations)
5 dependency configurations (2 unique dependency configurations)
Applying filter on data results in:
3 modules
Expand Down
8 changes: 7 additions & 1 deletion connector-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ group = "ch.addere.dga.connectorplugin"
version = property("connectorPluginVersion").toString()

dependencies {
implementation(project(":connector-model"))
compileOnly(project(":connector-model"))
}

/* Include the :connector-model classes into the plugin jar to make it self-contained */
tasks.named<Jar>("jar") {
from(project.sourceSets["main"].output)
from(project(":connector-model").sourceSets["main"].output)
}

gradlePlugin {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties
org.gradle.parallel=true
org.gradle.caching=true
connectorPluginVersion=0.1.3
connectorPluginVersion=0.1.5

0 comments on commit 4cb44b7

Please sign in to comment.