Skip to content

Commit

Permalink
replace all (where stuff doesn't break) api with implementation calls (
Browse files Browse the repository at this point in the history
…#1859)

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

* typescript seems to need this

* Moving     implementation(libs.apache.commons.lang3) to common conventions

* Better handling of neo4j OGM

* Jackson to common

---------

Co-authored-by: Christian Banse <[email protected]>
Co-authored-by: Christian Banse <[email protected]>
  • Loading branch information
3 people authored Dec 2, 2024
1 parent b529b6c commit 0281c1e
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 12 deletions.
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)

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

0 comments on commit 0281c1e

Please sign in to comment.