Skip to content
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

Correct numerous small dependency nits #1408

Merged
merged 5 commits into from
Jun 16, 2024
Merged

Conversation

liblit
Copy link
Contributor

@liblit liblit commented Jun 16, 2024

  1. Add a dependency analysis plugin: 69ea56f

  2. Add dependency checking to standard build checks: d1bd335

  3. Print dependency problems directly to build output: d76b145

    Dependency problems are always reported in build/reports/dependency-analysis/build-health-report.txt. With this property setting, they are also printed directly as build output. The latter is more accessible when debugging dependency problems that are discovered during GitHub Actions builds.

  4. Correct numerous dependency nits: d34b256

    These tweaks correct all warnings provided by the excellent dependency-analysis-gradle-plugin.

    Dependency problems reported immediately before applying these fixes:
    Advice for root project
    Unused dependencies which should be removed:
      api("org.jetbrains.kotlin:kotlin-stdlib:2.0.0")
      testFixturesApi("org.jetbrains.kotlin:kotlin-stdlib:2.0.0")
      testFixturesImplementation(libs.junit.jupiter.api)
      testImplementation(libs.junit.jupiter.api)
    
    Unused plugins that can be removed:
      org.jetbrains.kotlin.jvm: this project has both java-library and org.jetbrains.kotlin.jvm applied, which is redundant. You can remove org.jetbrains.kotlin.jvm
    
    Advice for :cast
    Unused dependencies which should be removed:
      testFixturesImplementation(libs.junit.jupiter.api)
    
    These transitive dependencies should be declared directly:
      testFixturesApi(project(":core"))
      testFixturesImplementation(project(":util"))
    
    Existing dependencies which should be modified to be as indicated:
      api(project(":shrike")) (was implementation)
      api(project(":util")) (was implementation)
    
    Advice for :cast:java
    Unused dependencies which should be removed:
      testImplementation(libs.junit.jupiter.api)
    
    These transitive dependencies should be declared directly:
      testFixturesApi(project(":util"))
      testFixturesImplementation(project(":shrike"))
    
    Existing dependencies which should be modified to be as indicated:
      api(project(":cast")) (was implementation)
      api(project(":core")) (was implementation)
      api(project(":util")) (was implementation)
      testFixturesApi(libs.junit.jupiter.api) (was testFixturesImplementation)
      testFixturesApi(project(":core")) (was testFixturesImplementation)
    
    Advice for :cast:java:ecj
    Unused dependencies which should be removed:
      implementation("org.eclipse.platform:org.eclipse.core.runtime:3.30.0")
      testFixturesImplementation(libs.junit.jupiter.api)
    
    These transitive dependencies should be declared directly:
      implementation("org.eclipse.platform:org.eclipse.equinox.common:3.18.200")
      implementation(libs.eclipse.ecj)
    
    Advice for :cast:java:test:data
    Unused dependencies which should be removed:
      testFixturesImplementation(libs.junit.jupiter.api)
      testImplementation(libs.junit.jupiter.api)
    
    Advice for :cast:js
    Unused dependencies which should be removed:
      testImplementation(testFixtures(project(":cast")))
    
    These transitive dependencies should be declared directly:
      testFixturesApi(project(":cast"))
      testFixturesApi(project(":core"))
      testFixturesApi(project(":util"))
    
    Existing dependencies which should be modified to be as indicated:
      api(libs.jericho.html) (was implementation)
      api(project(":core")) (was implementation)
      api(project(":util")) (was implementation)
      testFixturesApi(libs.junit.jupiter.api) (was testFixturesImplementation)
      testFixturesApi(testFixtures(project(":cast"))) (was testFixturesImplementation)
    
    Advice for :cast:js:html:nu_validator
    Unused dependencies which should be removed:
      testFixturesImplementation(libs.junit.jupiter.api)
      testImplementation(libs.junit.jupiter.api)
      testImplementation(testFixtures(project(":cast")))
      testImplementation(testFixtures(project(":cast:js")))
    
    Existing dependencies which should be modified to be as indicated:
      api(project(":cast:js")) (was implementation)
    
    Advice for :cast:js:nodejs
    Unused dependencies which should be removed:
      testFixturesImplementation(libs.junit.jupiter.api)
    
    Existing dependencies which should be modified to be as indicated:
      api(project(":core")) (was implementation)
      api(project(":util")) (was implementation)
    
    Advice for :cast:js:rhino
    Unused dependencies which should be removed:
      testFixturesImplementation(testFixtures(project(":cast")))
      testImplementation(testFixtures(project(":cast")))
    
    These transitive dependencies should be declared directly:
      testFixturesApi(project(":cast:js"))
      testFixturesApi(project(":util"))
      testFixturesImplementation(project(":cast"))
      testFixturesImplementation(project(":core"))
    
    Existing dependencies which should be modified to be as indicated:
      api(libs.rhino) (was implementation)
      api(project(":cast")) (was implementation)
      api(project(":cast:js")) (was implementation)
      api(project(":core")) (was implementation)
      api(project(":util")) (was implementation)
      testFixturesApi(libs.junit.jupiter.api) (was testFixturesImplementation)
      testFixturesApi(testFixtures(project(":cast:js"))) (was testFixturesImplementation)
    
    Advice for :core
    These transitive dependencies should be declared directly:
      testFixturesApi(project(":shrike"))
      testFixturesImplementation("org.junit.platform:junit-platform-engine:1.10.2")
      testFixturesImplementation(project(":util"))
    
    Existing dependencies which should be modified to be as indicated:
      testFixturesApi(libs.junit.jupiter.api) (was testFixturesImplementation)
    
    Advice for :dalvik
    Unused dependencies which should be removed:
      testFixturesImplementation(libs.junit.jupiter.api)
      testImplementation(libs.dexlib2)
      testImplementation(project(":core"))
      testImplementation(project(":shrike"))
      testImplementation(project(":util"))
    
    Existing dependencies which should be modified to be as indicated:
      api(libs.dexlib2) (was implementation)
      api(project(":core")) (was implementation)
      api(project(":shrike")) (was implementation)
      api(project(":util")) (was implementation)
    
    Advice for :ide
    Unused dependencies which should be removed:
      implementation("org.eclipse.platform:org.eclipse.core.commands:3.11.200")
      implementation("org.eclipse.platform:org.eclipse.core.jobs:3.15.100")
      testFixturesImplementation(libs.junit.jupiter.api)
      testImplementation(libs.junit.jupiter.api)
    
    These transitive dependencies should be declared directly:
      api("org.osgi:org.osgi.framework:1.8.0")
      implementation("org.eclipse.platform:org.eclipse.swt.gtk.linux.x86_64:3.124.200")
    
    Existing dependencies which should be modified to be as indicated:
      api("org.eclipse.platform:org.eclipse.core.resources:3.20.0") (was implementation)
      api("org.eclipse.platform:org.eclipse.core.runtime:3.30.0") (was implementation)
      api("org.eclipse.platform:org.eclipse.equinox.common:3.18.200") (was implementation)
      api("org.eclipse.platform:org.eclipse.jface:3.32.0") (was implementation)
      api(libs.eclipse.osgi) (was implementation)
      api(project(":core")) (was implementation)
      api(project(":util")) (was implementation)
      implementation("org.eclipse.pde:org.eclipse.pde.core:3.17.200") (was api)
    
    Advice for :ide:jdt
    Unused dependencies which should be removed:
      implementation("org.eclipse.platform:org.eclipse.core.runtime:3.30.0")
      testFixturesImplementation(libs.junit.jupiter.api)
      testImplementation(libs.junit.jupiter.api)
    
    These transitive dependencies should be declared directly:
      api("org.osgi:org.osgi.framework:1.8.0")
      implementation(libs.eclipse.ecj)
    
    Existing dependencies which should be modified to be as indicated:
      api("org.eclipse.jdt:org.eclipse.jdt.core:3.36.0") (was implementation)
      api("org.eclipse.platform:org.eclipse.core.resources:3.20.0") (was implementation)
      api("org.eclipse.platform:org.eclipse.equinox.app:1.6.400") (was implementation)
      api("org.eclipse.platform:org.eclipse.jface:3.32.0") (was implementation)
      api("org.eclipse.platform:org.eclipse.ui.workbench:3.131.0") (was implementation)
      api(libs.eclipse.osgi) (was implementation)
      api(project(":cast")) (was implementation)
      api(project(":cast:java")) (was implementation)
      api(project(":cast:java:ecj")) (was implementation)
      api(project(":core")) (was implementation)
      api(project(":ide")) (was implementation)
      api(project(":util")) (was implementation)
    
    Advice for :ide:jdt:test
    Unused dependencies which should be removed:
      testFixturesImplementation(libs.junit.jupiter.api)
      testImplementation("org.eclipse.jdt:org.eclipse.jdt.core:3.36.0")
      testImplementation("org.eclipse.platform:org.eclipse.core.contenttype:3.9.200")
      testImplementation("org.eclipse.platform:org.eclipse.equinox.preferences:3.10.400")
      testImplementation(libs.eclipse.osgi)
      testImplementation(project(":cast"))
      testImplementation(project(":cast:java:ecj"))
      testImplementation(project(":ide"))
      testImplementation(project(":shrike"))
    
    These transitive dependencies should be declared directly:
      testImplementation("org.osgi:org.osgi.framework:1.8.0")
    
    Advice for :ide:jsdt
    Unused dependencies which should be removed:
      implementation("org.eclipse.platform:org.eclipse.core.jobs:3.15.100")
      implementation(libs.javax.annotation.api)
      testFixturesImplementation(libs.javax.annotation.api)
      testFixturesImplementation(libs.junit.jupiter.api)
      testImplementation(libs.junit.jupiter.api)
    
    These transitive dependencies should be declared directly:
      api("org.osgi:org.osgi.framework:1.8.0")
    
    Existing dependencies which should be modified to be as indicated:
      api("org.eclipse.platform:org.eclipse.core.resources:3.20.0") (was implementation)
      api("org.eclipse.platform:org.eclipse.core.runtime:3.30.0") (was implementation)
      api("org.eclipse.platform:org.eclipse.equinox.common:3.18.200") (was implementation)
      api("org.eclipse.platform:org.eclipse.ui.workbench:3.131.0") (was implementation)
      api(libs.eclipse.osgi) (was implementation)
      api(libs.eclipse.wst.jsdt.core) (was implementation)
      api(project(":cast:js")) (was implementation)
      api(project(":core")) (was implementation)
      api(project(":util")) (was implementation)
    
    Advice for :ide:jsdt:tests
    Unused dependencies which should be removed:
      testFixturesImplementation(libs.junit.jupiter.api)
      testImplementation(libs.eclipse.osgi)
      testImplementation(libs.javax.annotation.api)
    
    These transitive dependencies should be declared directly:
      testImplementation("org.osgi:org.osgi.framework:1.8.0")
    
    Advice for :ide:tests
    Unused dependencies which should be removed:
      testFixturesImplementation(libs.junit.jupiter.api)
    
    These transitive dependencies should be declared directly:
      testFixturesApi("org.eclipse.platform:org.eclipse.equinox.common:3.18.200")
      testFixturesImplementation("org.eclipse.platform:org.eclipse.ui.workbench:3.131.0")
      testFixturesImplementation(libs.eclipse.osgi)
      testImplementation("org.osgi:org.osgi.framework:1.8.0")
      testImplementation(libs.eclipse.osgi)
    
    Existing dependencies which should be modified to be as indicated:
      testFixturesApi("org.eclipse.platform:org.eclipse.ui.ide:3.22.0") (was testFixturesImplementation)
    
    Advice for :scandroid
    Unused dependencies which should be removed:
      testFixturesImplementation(libs.junit.jupiter.api)
      testImplementation(libs.junit.jupiter.api)
    
    Existing dependencies which should be modified to be as indicated:
      api(project(":core")) (was implementation)
      api(project(":util")) (was implementation)
    
    Advice for :shrike
    Unused dependencies which should be removed:
      testFixturesImplementation(libs.junit.jupiter.api)
      testImplementation(libs.junit.jupiter.api)
    
    Existing dependencies which should be modified to be as indicated:
      api(project(":util")) (was implementation)
    
    Advice for :util
    Unused dependencies which should be removed:
      testFixturesImplementation(libs.junit.jupiter.api)
    
  5. Treat dependency problems as fatal errors: a8842f3

Dependency problems are always reported in
`build/reports/dependency-analysis/build-health-report.txt`.  With this
property setting, they are also printed directly as build output.  The
latter is more accessible when debugging dependency problems that are
discovered during GitHub Actions builds.
These tweaks correct all warnings provided by the excellent
[dependency-analysis-gradle-plugin](https://github.com/autonomousapps/dependency-analysis-gradle-plugin).
@liblit liblit added gradle WALA’s Gradle build system cleanup API cleanup and refactoring labels Jun 16, 2024
@liblit liblit requested a review from msridhar June 16, 2024 03:13
@liblit liblit self-assigned this Jun 16, 2024
Copy link

Test Results

  695 files  ±0    695 suites  ±0   3h 29m 13s ⏱️ - 12m 56s
  735 tests ±0    718 ✅ ±0   17 💤 ±0  0 ❌ ±0 
4 294 runs  ±0  4 190 ✅ ±0  104 💤 ±0  0 ❌ ±0 

Results for commit a8842f3. ± Comparison against base commit 9a68b2d.

Copy link
Member

@msridhar msridhar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! I need to pull this into some other projects :-)

@liblit liblit merged commit df5caa4 into wala:master Jun 16, 2024
11 checks passed
@liblit liblit deleted the dependency-checker branch June 16, 2024 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup API cleanup and refactoring gradle WALA’s Gradle build system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants