Skip to content

Commit

Permalink
Correct numerous dependency nits
Browse files Browse the repository at this point in the history
These tweaks correct all warnings provided by the excellent
[dependency-analysis-gradle-plugin](https://github.com/autonomousapps/dependency-analysis-gradle-plugin).
  • Loading branch information
liblit committed Jun 16, 2024
1 parent d76b145 commit 120346c
Show file tree
Hide file tree
Showing 21 changed files with 105 additions and 81 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ dependencies {
"javadocSource"(sourceSets.main.get().allJava)

testFixturesImplementation(platform(findLibrary("junit-bom")))
testFixturesImplementation(findLibrary("junit-jupiter-api"))

testImplementation(platform(findLibrary("junit-bom")))
testImplementation(findLibrary("junit-jupiter-api"))
testRuntimeOnly(findLibrary("junit-jupiter-engine"))
testRuntimeOnly(findLibrary("junit-vintage-engine"))
}
Expand Down
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ plugins {
java
alias(libs.plugins.dependency.analysis)
alias(libs.plugins.file.lister)
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.shellcheck)
alias(libs.plugins.task.tree)
alias(libs.plugins.version.catalog.update)
Expand Down
9 changes: 6 additions & 3 deletions cast/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,19 @@ dependencies {
api(projects.core) {
because("public method AstCGNode.addTarget receives an argument of type CGNode")
}
api(projects.shrike)
api(projects.util)
implementation(libs.commons.io)
implementation(projects.shrike)
implementation(projects.util)
castJsJavadocDestinationDirectory(
project(mapOf("path" to ":cast:js", "configuration" to "javadocDestinationDirectory")))
castCastSharedLibrary(projects.cast.cast)
castJsPackageListDirectory(
project(mapOf("path" to ":cast:js", "configuration" to "packageListDirectory")))
javadocClasspath(projects.cast.js)
xlatorTestSharedLibrary(project("xlator_test"))
testFixturesApi(projects.core)
testFixturesImplementation(projects.util)
testImplementation(libs.junit.jupiter.api)
xlatorTestSharedLibrary(projects.cast.xlatorTest)
}

val castHeaderDirectory: Configuration by configurations.creating { isCanBeResolved = false }
Expand Down
11 changes: 7 additions & 4 deletions cast/java/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ plugins {
eclipse.project.natures("org.eclipse.pde.PluginNature")

dependencies {
implementation(projects.cast)
implementation(projects.core)
api(projects.cast)
api(projects.core)
api(projects.util)
implementation(projects.shrike)
implementation(projects.util)
testFixturesApi(libs.junit.jupiter.api)
testFixturesApi(projects.core)
testFixturesApi(projects.util)
testFixturesImplementation(projects.cast)
testFixturesImplementation(projects.core)
testFixturesImplementation(projects.shrike)
}
8 changes: 4 additions & 4 deletions cast/java/ecj/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@ plugins {

walaEclipseMavenCentral {
implementation(
"org.eclipse.core.runtime",
"org.eclipse.equinox.common",
"org.eclipse.jdt.core",
)
}

val runSourceDirectory: Configuration by configurations.creating { isCanBeConsumed = false }

dependencies {
implementation(
projects.cast,
)
implementation(libs.eclipse.ecj)
implementation(projects.cast)
implementation(projects.cast.java)
implementation(projects.core)
implementation(projects.shrike)
implementation(projects.util)
runSourceDirectory(
project(
mapOf("path" to ":cast:java:test:data", "configuration" to "testJavaSourceDirectory")))
testImplementation(libs.junit.jupiter.api)
testImplementation(testFixtures(projects.cast.java))
}

Expand Down
14 changes: 9 additions & 5 deletions cast/js/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@ plugins {
}

dependencies {
api(libs.jericho.html)
api(projects.cast) { because("public class JSCallGraphUtil extends class CAstCallGraphUtil") }
api(projects.core)
api(projects.util)
implementation(libs.commons.io)
implementation(libs.gson)
implementation(libs.jericho.html)
implementation(projects.core)
implementation(projects.shrike)
implementation(projects.util)
javadocClasspath(projects.cast.js.rhino)
testFixturesImplementation(testFixtures(projects.cast))
testImplementation(testFixtures(projects.cast))
testFixturesApi(libs.junit.jupiter.api)
testFixturesApi(projects.cast)
testFixturesApi(projects.core)
testFixturesApi(projects.util)
testFixturesApi(testFixtures(projects.cast))
testImplementation(libs.junit.jupiter.api)
testImplementation(testFixtures(projects.core))
}

Expand Down
4 changes: 1 addition & 3 deletions cast/js/html/nu_validator/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ plugins { id("com.ibm.wala.gradle.java") }
val extraTestResources: Configuration by configurations.creating { isCanBeConsumed = false }

dependencies {
api(projects.cast.js)
extraTestResources(project(mapOf("path" to ":cast:js", "configuration" to "testResources")))
implementation(libs.htmlparser)
implementation(projects.cast)
implementation(projects.cast.js)
implementation(projects.util)
testImplementation(testFixtures(projects.cast))
testImplementation(testFixtures(projects.cast.js))
testImplementation(testFixtures(projects.cast.js.rhino))
}

Expand Down
5 changes: 3 additions & 2 deletions cast/js/nodejs/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ dependencies {
api(projects.cast.js) {
because("public class NodejsCallGraphBuilderUtil extends class JSCallGraphUtil")
}
api(projects.core)
api(projects.util)
implementation(libs.commons.io)
implementation(libs.json)
implementation(projects.cast)
implementation(projects.cast.js.rhino)
implementation(projects.core)
implementation(projects.util)
testImplementation(libs.junit.jupiter.api)
}

val downloadNodeJS by
Expand Down
20 changes: 12 additions & 8 deletions cast/js/rhino/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,21 @@ val extraTestResources: Configuration by configurations.creating { isCanBeConsum

dependencies {
extraTestResources(project(mapOf("path" to ":cast:js", "configuration" to "testResources")))
implementation(libs.rhino)
implementation(projects.cast)
implementation(projects.cast.js)
implementation(projects.core)
implementation(projects.util)
api(libs.rhino)
api(projects.cast)
api(projects.cast.js)
api(projects.core)
api(projects.util)
testFixturesApi(libs.junit.jupiter.api)
testFixturesApi(projects.cast.js)
testFixturesApi(projects.util)
testFixturesApi(testFixtures(projects.cast.js))
testFixturesImplementation(projects.cast)
testFixturesImplementation(projects.core)
testImplementation(libs.gson)
testImplementation(libs.hamcrest)
testImplementation(testFixtures(projects.cast))
testImplementation(libs.junit.jupiter.api)
testImplementation(testFixtures(projects.cast.js))
testFixturesImplementation(testFixtures(projects.cast))
testFixturesImplementation(testFixtures(projects.cast.js))
}

tasks.named<Copy>("processTestResources") { from(extraTestResources) }
Expand Down
5 changes: 5 additions & 0 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,16 @@ dependencies {
because("public class Entrypoint implements interface BytecodeConstraints")
}
api(projects.util) { because("public interface CallGraph extends interface NumberedGraph") }
testFixturesApi(libs.junit.jupiter.api)
testFixturesApi(projects.shrike)
testFixturesImplementation(libs.ant)
testFixturesImplementation(libs.junit.platform.engine)
testFixturesImplementation(libs.junit.platform.launcher)
testFixturesImplementation(projects.util)
implementation(libs.gson)
testImplementation(libs.assertj.core)
testImplementation(libs.hamcrest)
testImplementation(libs.junit.jupiter.api)
testRuntimeOnly(sourceSets["testSubjects"].output.classesDirs)
// add the testSubjects source files to enable SourceMapTest to pass
testRuntimeOnly(files(sourceSets["testSubjects"].java.srcDirs))
Expand Down
14 changes: 6 additions & 8 deletions dalvik/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -79,25 +79,23 @@ val installAndroidSdk by
eclipse { synchronizationTasks(installAndroidSdk) }

dependencies {
api(libs.dexlib2)
api(projects.core)
api(projects.shrike)
api(projects.util)

coreTestJar(project("path" to ":core", "configuration" to "testJarConfig"))
extraTestResources(project("path" to ":core", "configuration" to "dalvikTestResources"))

implementation(libs.slf4j.api)
implementation(libs.dexlib2)
implementation(libs.guava)
implementation(projects.core)
implementation(projects.shrike)
implementation(projects.util)

sampleCupSources(libs.java.cup.map { "$it:sources" })

testImplementation(libs.android.tools)
testImplementation(libs.dexlib2)
testImplementation(libs.junit.jupiter.api)
testImplementation(libs.junit.jupiter.params)
testImplementation(projects.core)
testImplementation(projects.dalvik)
testImplementation(projects.shrike)
testImplementation(projects.util)
testImplementation(testFixtures(projects.core))

// directory containing "android.jar", which various tests want to find as a resource
Expand Down
3 changes: 2 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ junit-bom = "org.junit:junit-bom:5.10.2"
junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api" }
junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine" }
junit-jupiter-params = { module = "org.junit.jupiter:junit-jupiter-params" }
junit-platform-engine = { module = "org.junit.platform:junit-platform-engine" }
junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher" }
junit-vintage-engine = { module = "org.junit.vintage:junit-vintage-engine" }
nullaway = "com.uber.nullaway:nullaway:0.10.24"
osgi-framework = "org.osgi:org.osgi.framework:1.8.0"
rhino = "org.mozilla:rhino:1.7.15"
slf4j-api = "org.slf4j:slf4j-api:2.0.13"
w3c-css-sac = "org.eclipse.birt.runtime:org.w3c.css.sac:1.3.1.v200903091627"
Expand All @@ -45,7 +47,6 @@ w3c-css-sac = "org.eclipse.birt.runtime:org.w3c.css.sac:1.3.1.v200903091627"
dependency-analysis = "com.autonomousapps.dependency-analysis:1.32.0"
file-lister = "all.shared.gradle.file-lister:1.0.2"
google-java-format = "com.github.sherter.google-java-format:0.9"
kotlin-jvm = "org.jetbrains.kotlin.jvm:2.0.0"
ktfmt = "com.ncorti.ktfmt.gradle:0.18.0"
shellcheck = "com.felipefzdz.gradle.shellcheck:1.4.6"
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
Expand Down
19 changes: 12 additions & 7 deletions ide/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,25 @@ plugins {
eclipse.project.natures("org.eclipse.pde.PluginNature")

walaEclipseMavenCentral {
api("org.eclipse.pde.core")
implementation(
"org.eclipse.core.commands",
"org.eclipse.core.jobs",
api(
"org.eclipse.core.resources",
"org.eclipse.core.runtime",
"org.eclipse.equinox.common",
"org.eclipse.jdt.core",
"org.eclipse.jface",
"org.eclipse.osgi",
)
implementation(
"org.eclipse.jdt.core",
"org.eclipse.pde.core",
"org.eclipse.swt",
"org.eclipse.ui.workbench",
)
}

dependencies {
implementation(projects.core)
implementation(projects.util)
api(libs.osgi.framework)
api(projects.core)
api(projects.util)
}

configurations.all {
Expand All @@ -34,3 +35,7 @@ configurations.all {
"both provide several of the same classes, but org.w3c.css.sac includes everything we need from both")
}
}

dependencyAnalysis.issues {
onUsedTransitiveDependencies { exclude("org.eclipse.platform:org.eclipse.swt.gtk.linux.x86_64") }
}
23 changes: 13 additions & 10 deletions ide/jdt/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,27 @@ plugins {
}

walaEclipseMavenCentral {
api("org.eclipse.equinox.common")
implementation(
"org.eclipse.core.jobs",
api(
"org.eclipse.core.resources",
"org.eclipse.core.runtime",
"org.eclipse.equinox.app",
"org.eclipse.equinox.common",
"org.eclipse.jdt.core",
"org.eclipse.jface",
"org.eclipse.osgi",
"org.eclipse.ui.workbench",
)
implementation(
"org.eclipse.core.jobs",
)
}

dependencies {
implementation(projects.cast)
implementation(projects.cast.java)
implementation(projects.cast.java.ecj)
implementation(projects.core)
implementation(projects.ide)
implementation(projects.util)
api(libs.osgi.framework)
api(projects.cast)
api(projects.cast.java)
api(projects.cast.java.ecj)
api(projects.core)
api(projects.ide)
api(projects.util)
implementation(libs.eclipse.ecj)
}
10 changes: 2 additions & 8 deletions ide/jdt/test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,17 @@ plugins {

walaEclipseMavenCentral {
testImplementation(
"org.eclipse.core.contenttype",
"org.eclipse.core.runtime",
"org.eclipse.equinox.preferences",
"org.eclipse.jdt.core",
"org.eclipse.osgi",
)
}

dependencies {
testImplementation(libs.eclipse.osgi)
testImplementation(projects.cast)
testImplementation(libs.junit.jupiter.api)
testImplementation(libs.osgi.framework)
testImplementation(projects.cast.java)
testImplementation(projects.cast.java.ecj)
testImplementation(projects.core)
testImplementation(projects.ide)
testImplementation(projects.ide.jdt)
testImplementation(projects.shrike)
testImplementation(projects.util)
testImplementation(testFixtures(projects.cast.java))
testImplementation(testFixtures(projects.ide.tests))
Expand Down
14 changes: 6 additions & 8 deletions ide/jsdt/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ plugins {
}

walaEclipseMavenCentral {
implementation(
"org.eclipse.core.jobs",
api(
"org.eclipse.core.resources",
"org.eclipse.core.runtime",
"org.eclipse.equinox.common",
Expand All @@ -16,14 +15,13 @@ walaEclipseMavenCentral {
}

dependencies {
api(libs.eclipse.wst.jsdt.core)
api(libs.osgi.framework)
api(projects.cast.js)
api(projects.core)
api(projects.ide) { because("public class JavaScriptHeadlessUtil extends class HeadlessUtil") }
implementation(libs.eclipse.wst.jsdt.core)
api(projects.util)
implementation(libs.eclipse.wst.jsdt.ui)
implementation(libs.javax.annotation.api)
implementation(projects.cast)
implementation(projects.cast.js)
implementation(projects.cast.js.rhino)
implementation(projects.core)
implementation(projects.util)
testFixturesImplementation(libs.javax.annotation.api)
}
4 changes: 2 additions & 2 deletions ide/jsdt/tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ walaEclipseMavenCentral {
testImplementation(
"org.eclipse.core.runtime",
"org.eclipse.equinox.common",
"org.eclipse.osgi",
)
}

dependencies {
testImplementation(libs.eclipse.osgi)
testImplementation(libs.eclipse.wst.jsdt.core)
testImplementation(libs.javax.annotation.api)
testImplementation(libs.junit.jupiter.api)
testImplementation(libs.osgi.framework)
testImplementation(projects.cast)
testImplementation(projects.cast.js)
testImplementation(projects.cast.js.rhino)
Expand Down
Loading

0 comments on commit 120346c

Please sign in to comment.