-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add dependency-analysis-gradle-plugin #3158
Conversation
Motivation: The Dependency Analysis Gradle Plugin (DAGP) detects the following problems with dependencies: unused dependencies, used transitive dependencies that should be declared directly, dependencies declared on the wrong configuration. Modifications: - Add new plugin dependency as part of our `servicetalk-gradle-plugin-internal`; - Apply it for libraries to enable `projectHealth` task; - Apply it for root projects to enable `buildHealth` task that generates full report in a file; - Add `dependencyAnalysis` task and bundle it as part of `quality` task to allow validation via CI pipelines; - Make sure `copySourcesForJersey3` task always executes before `dependencyAnalysis` as it depends on copied source code; Result: We can automatically detect issues with dependencies.
Second iteration did not help.
This reverts commit dd2ffbb.
issues { | ||
all { | ||
onAny { | ||
severity("warn") // FIXME: switch to "fail" when all issues are addressed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will change after all issues are resolved, will require a few follow-up PRs
@@ -68,6 +68,13 @@ tasks.sourcesJar.dependsOn(copySourcesForJersey3) | |||
tasks.compileJava.dependsOn(copySourcesForJersey3) | |||
tasks.processTestResources.dependsOn(copySourcesForJersey3) | |||
tasks.compileTestJava.dependsOn(copySourcesForJersey3) | |||
afterEvaluate { | |||
if (tasks.findByName("projectHealth")) { | |||
tasks.withType(com.autonomousapps.tasks.CodeSourceExploderTask) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried many different ways to avoid this duplication. Unfortunately, nothing worked without bringing more problems. My gradle-foo is exhausted at this point 😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Post merge 👍
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/out/our
Motivation:
The Dependency Analysis Gradle Plugin (DAGP) detects the following
problems with dependencies: unused dependencies, used transitive
dependencies that should be declared directly, dependencies declared on
the wrong configuration.
Modifications:
build.gradle
file;buildHealth
task part of thequality
task;copySourcesForJersey3
task always executes beforedependency-analysis as it depends on copied source code;
Result:
We can automatically detect issues with dependencies.
More info: https://github.com/autonomousapps/dependency-analysis-gradle-plugin