Skip to content

Commit

Permalink
Customized dependency analysis (Java Modules)
Browse files Browse the repository at this point in the history
  • Loading branch information
jjohannes committed Dec 4, 2023
1 parent 97a4b8f commit 68d19b5
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions gradle/plugins/base-plugins/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ plugins {
dependencies {
implementation(platform(project(":plugins-platform")))

implementation(project(":dependency-analysis-plugins"))
implementation(project(":dependency-rules-plugins"))
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id("lifecycle-base")
id("org.example.dependency-analysis-root")
}

// Configure the ':tasks' task of the root project to only show
Expand Down
7 changes: 7 additions & 0 deletions gradle/plugins/dependency-analysis-plugins/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
plugins {
`kotlin-dsl`
}

dependencies {
implementation(platform(project(":plugins-platform")))

implementation("com.autonomousapps:dependency-analysis-gradle-plugin")
implementation("org.gradlex:java-module-dependencies")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
plugins {
id("java")
id("org.gradlex.java-module-dependencies")
}

tasks.check {
dependsOn(tasks.checkAllModuleInfo)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
plugins {
id("com.autonomousapps.dependency-analysis")
}

// Lifecycle task to check dependency scopes in all subprojects
tasks.register("checkAllModuleInfo") {
group = LifecycleBasePlugin.VERIFICATION_GROUP
description = "Check scope and order of directives in 'module-info.java' files"
dependsOn(subprojects.map { "${it.path}:checkAllModuleInfo"})
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
id("jacoco") // Record test coverage data during test execution
id("org.example.base")
id("org.example.consistent-resolution")
id("org.example.dependency-analysis-project")
}

// Configure Java compilation on java {} extension or directly on 'JavaCompile' tasks
Expand Down
1 change: 1 addition & 0 deletions gradle/plugins/plugins-platform/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
}

dependencies.constraints {
api("com.autonomousapps:dependency-analysis-gradle-plugin:1.27.0")
api("dev.jacomet.gradle.plugins:logging-capabilities:0.11.1")
api("io.fuchs.gradle.classpath-collision-detector:classpath-collision-detector:0.3")
api("org.gradlex:extra-java-module-info:1.6")
Expand Down

0 comments on commit 68d19b5

Please sign in to comment.