diff --git a/.github/workflows/ci-prq.yml b/.github/workflows/ci-prq.yml index f5ca234a4e..093ea71236 100644 --- a/.github/workflows/ci-prq.yml +++ b/.github/workflows/ci-prq.yml @@ -37,7 +37,7 @@ jobs: - name: Clean Gradle project run: ./gradlew --parallel clean - name: Build with Gradle - run: ./gradlew --parallel quality + run: ./gradlew --parallel -Pdependency.analysis.print.build.health=true quality - name: Upload CheckStyle Results if: always() uses: actions/upload-artifact@v4 diff --git a/build.gradle b/build.gradle index 1d3d84dc54..cdb80c9a4d 100644 --- a/build.gradle +++ b/build.gradle @@ -42,8 +42,40 @@ if (!repositories) { print("This machine already has some pre-configured repositories, will use: ${repositories*.name.join(", ")}") } +buildscript { + if (!repositories) { + repositories { + gradlePluginPortal() + } + } + dependencies { + if (JavaVersion.current().isJava11Compatible()) { + classpath("com.autonomousapps:dependency-analysis-gradle-plugin:$dependencyAnalysisPluginVersion") + } + } +} + apply plugin: "io.servicetalk.servicetalk-gradle-plugin-internal-root" +// Unfortunately, we can not make this validation part of our servicetalk-gradle-plugin-internal because it requires +// JDK11 while we build and package out plugin with JDK8. +if (JavaVersion.current().isJava11Compatible()) { + apply plugin: "com.autonomousapps.dependency-analysis" + + dependencyAnalysis { + issues { + all { + onAny { + severity("warn") // FIXME: switch to "fail" when all issues are addressed + exclude("com.google.code.findbugs:jsr305") + } + } + } + } + + quality.dependsOn buildHealth +} + task validateLocalDocSite(type: Exec) { group 'Documentation' description 'Generate and validate servicetalk.io site documentation' @@ -56,6 +88,8 @@ subprojects { // mockito 5 only supports jdk11+ if (JavaVersion.current() < JavaVersion.VERSION_11) { project.setProperty("mockitoCoreVersion", mockitoCorePreJdk11Version) + } else { + apply plugin: "com.autonomousapps.dependency-analysis" } // Used by ci-release.yaml to determine which modules need to be built/released with JDK11. task printJavaTargetCompatibility { diff --git a/gradle.properties b/gradle.properties index 66831d41e4..b23ba51e61 100644 --- a/gradle.properties +++ b/gradle.properties @@ -95,6 +95,7 @@ mockitoCoreVersion=5.14.2 # mockito version is overridden for