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

replace all (where stuff doesn't break) api with implementation calls #1859

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions buildSrc/src/main/kotlin/cpg.common-conventions.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import org.gradle.accessors.dm.LibrariesForLibs
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.gradle.api.services.BuildService;
Expand Down Expand Up @@ -164,3 +165,11 @@ kover {
}
}
}

// Common dependencies that we need for all modules
val libs = the<LibrariesForLibs>() // necessary to be able to use the version catalog in buildSrc
dependencies {
implementation(libs.apache.commons.lang3)
implementation(libs.neo4j.ogm.core)
implementation(libs.jackson)
}
5 changes: 1 addition & 4 deletions cpg-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,10 @@ tasks.test {
}

dependencies {
api(libs.apache.commons.lang3)
api(libs.neo4j.ogm.core)
api(libs.jackson)
api(libs.slf4j.api)
Copy link
Member

Choose a reason for hiding this comment

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

Could probably also moved to common dependencies


implementation(libs.bundles.log4j)
implementation(libs.kotlin.reflect)

implementation(libs.jacksonyml)

testImplementation(libs.junit.params)
Expand Down
8 changes: 4 additions & 4 deletions cpg-language-cxx/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ publishing {

dependencies {
// Eclipse dependencies
api(libs.eclipse.runtime) {
implementation(libs.eclipse.runtime) {
// For some reason, this group name is wrong
exclude("org.osgi.service", "org.osgi.service.prefs")
}
api(libs.osgi.service)
api(libs.icu4j)
implementation(libs.osgi.service)
implementation(libs.icu4j)

// CDT
api(libs.eclipse.cdt.core)
implementation(libs.eclipse.cdt.core)

testImplementation(libs.junit.params)
testImplementation(project(":cpg-analysis"))
Expand Down
2 changes: 1 addition & 1 deletion cpg-language-java/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ publishing {
}

dependencies {
api(libs.javaparser)
implementation(libs.javaparser)
}
2 changes: 1 addition & 1 deletion cpg-language-jvm/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ publishing {
}

dependencies {
api(libs.bundles.sootup)
implementation(libs.bundles.sootup)
// needed until https://github.com/antlr/antlr4/issues/3895 is fixed
runtimeOnly("org.antlr:antlr4-runtime") {
version {
Expand Down
4 changes: 2 additions & 2 deletions cpg-neo4j/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ publishing {

dependencies {
// neo4j
api(libs.bundles.neo4j)
implementation(libs.bundles.neo4j)

// Command line interface support
api(libs.picocli)
implementation(libs.picocli)
annotationProcessor(libs.picocli.codegen)

testImplementation(testFixtures(projects.cpgCore))
Expand Down
3 changes: 3 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ log4j = "2.24.0"
spotless = "6.25.0"
nexus-publish = "2.0.0"
sootup = "1.3.0"
slf4j = "2.0.16"

[libraries]
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin"}
Expand All @@ -22,6 +23,8 @@ kotlin-test-junit5 = { module = "org.jetbrains.kotlin:kotlin-test-junit5", versi
log4j-impl = { module = "org.apache.logging.log4j:log4j-slf4j2-impl", version.ref = "log4j" }
log4j-core = { module = "org.apache.logging.log4j:log4j-core", version.ref = "log4j" }

slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j"}

apache-commons-lang3 = { module = "org.apache.commons:commons-lang3", version = "3.17.0"}
neo4j-ogm-core = { module = "org.neo4j:neo4j-ogm-core", version.ref = "neo4j"}
neo4j-ogm-bolt-driver = { module = "org.neo4j:neo4j-ogm-bolt-driver", version.ref = "neo4j"}
Expand Down
Loading