From 60eac6a25e781073b605e65ab3729b1fb2dca8fb Mon Sep 17 00:00:00 2001 From: Maximilian Kaul Date: Wed, 20 Nov 2024 17:06:11 +0100 Subject: [PATCH 1/5] replace all (where stuff doesn't break) api with implementation calls --- cpg-core/build.gradle.kts | 2 +- cpg-language-cxx/build.gradle.kts | 8 ++++---- cpg-language-java/build.gradle.kts | 2 +- cpg-language-jvm/build.gradle.kts | 2 +- cpg-neo4j/build.gradle.kts | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cpg-core/build.gradle.kts b/cpg-core/build.gradle.kts index d21606d204..b4d74a02d6 100644 --- a/cpg-core/build.gradle.kts +++ b/cpg-core/build.gradle.kts @@ -54,7 +54,7 @@ tasks.test { dependencies { api(libs.apache.commons.lang3) api(libs.neo4j.ogm.core) - api(libs.jackson) + implementation(libs.jackson) implementation(libs.bundles.log4j) implementation(libs.kotlin.reflect) diff --git a/cpg-language-cxx/build.gradle.kts b/cpg-language-cxx/build.gradle.kts index 71a3cac919..219448f656 100644 --- a/cpg-language-cxx/build.gradle.kts +++ b/cpg-language-cxx/build.gradle.kts @@ -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")) diff --git a/cpg-language-java/build.gradle.kts b/cpg-language-java/build.gradle.kts index d8a0986a68..5f56c6077a 100644 --- a/cpg-language-java/build.gradle.kts +++ b/cpg-language-java/build.gradle.kts @@ -40,5 +40,5 @@ publishing { } dependencies { - api(libs.javaparser) + implementation(libs.javaparser) } diff --git a/cpg-language-jvm/build.gradle.kts b/cpg-language-jvm/build.gradle.kts index 6502dfa23a..16e6c00fe8 100644 --- a/cpg-language-jvm/build.gradle.kts +++ b/cpg-language-jvm/build.gradle.kts @@ -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 { diff --git a/cpg-neo4j/build.gradle.kts b/cpg-neo4j/build.gradle.kts index 82377fb321..496f37df4e 100644 --- a/cpg-neo4j/build.gradle.kts +++ b/cpg-neo4j/build.gradle.kts @@ -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)) From 80dfda7a6967ba1212353fbf96740b084f6262e0 Mon Sep 17 00:00:00 2001 From: Maximilian Kaul Date: Wed, 20 Nov 2024 17:17:24 +0100 Subject: [PATCH 2/5] typescript seems to need this --- cpg-core/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpg-core/build.gradle.kts b/cpg-core/build.gradle.kts index b4d74a02d6..d21606d204 100644 --- a/cpg-core/build.gradle.kts +++ b/cpg-core/build.gradle.kts @@ -54,7 +54,7 @@ tasks.test { dependencies { api(libs.apache.commons.lang3) api(libs.neo4j.ogm.core) - implementation(libs.jackson) + api(libs.jackson) implementation(libs.bundles.log4j) implementation(libs.kotlin.reflect) From 80cc143cfe03089ac7382d81540fd3405efcec09 Mon Sep 17 00:00:00 2001 From: Christian Banse Date: Wed, 20 Nov 2024 18:05:03 +0100 Subject: [PATCH 3/5] Moving implementation(libs.apache.commons.lang3) to common conventions --- buildSrc/src/main/kotlin/cpg.common-conventions.gradle.kts | 7 +++++++ cpg-core/build.gradle.kts | 2 -- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/kotlin/cpg.common-conventions.gradle.kts b/buildSrc/src/main/kotlin/cpg.common-conventions.gradle.kts index 42ddb6e7d9..68bff10e38 100644 --- a/buildSrc/src/main/kotlin/cpg.common-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/cpg.common-conventions.gradle.kts @@ -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; @@ -164,3 +165,9 @@ kover { } } } + +// Common dependencies that we need for all modules +val libs = the() // necessary to be able to use the version catalog in buildSrc +dependencies { + implementation(libs.apache.commons.lang3) +} \ No newline at end of file diff --git a/cpg-core/build.gradle.kts b/cpg-core/build.gradle.kts index d21606d204..544b64a2e8 100644 --- a/cpg-core/build.gradle.kts +++ b/cpg-core/build.gradle.kts @@ -52,13 +52,11 @@ tasks.test { } dependencies { - api(libs.apache.commons.lang3) api(libs.neo4j.ogm.core) api(libs.jackson) implementation(libs.bundles.log4j) implementation(libs.kotlin.reflect) - implementation(libs.jacksonyml) testImplementation(libs.junit.params) From 995776156f573c198de8119ab0130a2809b80526 Mon Sep 17 00:00:00 2001 From: Christian Banse Date: Wed, 20 Nov 2024 18:16:51 +0100 Subject: [PATCH 4/5] Better handling of neo4j OGM --- buildSrc/src/main/kotlin/cpg.common-conventions.gradle.kts | 1 + cpg-core/build.gradle.kts | 2 +- gradle/libs.versions.toml | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/cpg.common-conventions.gradle.kts b/buildSrc/src/main/kotlin/cpg.common-conventions.gradle.kts index 68bff10e38..6beefc63fa 100644 --- a/buildSrc/src/main/kotlin/cpg.common-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/cpg.common-conventions.gradle.kts @@ -170,4 +170,5 @@ kover { val libs = the() // necessary to be able to use the version catalog in buildSrc dependencies { implementation(libs.apache.commons.lang3) + implementation(libs.neo4j.ogm.core) } \ No newline at end of file diff --git a/cpg-core/build.gradle.kts b/cpg-core/build.gradle.kts index 544b64a2e8..734910e5c5 100644 --- a/cpg-core/build.gradle.kts +++ b/cpg-core/build.gradle.kts @@ -52,8 +52,8 @@ tasks.test { } dependencies { - api(libs.neo4j.ogm.core) api(libs.jackson) + api(libs.slf4j.api) implementation(libs.bundles.log4j) implementation(libs.kotlin.reflect) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4a8a2e5a44..eb263ad8ac 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -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"} @@ -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"} From 8d82ba2f371cba73cb2ccb4c68b38c15f0a089d9 Mon Sep 17 00:00:00 2001 From: Christian Banse Date: Wed, 20 Nov 2024 18:18:06 +0100 Subject: [PATCH 5/5] Jackson to common --- buildSrc/src/main/kotlin/cpg.common-conventions.gradle.kts | 1 + cpg-core/build.gradle.kts | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/cpg.common-conventions.gradle.kts b/buildSrc/src/main/kotlin/cpg.common-conventions.gradle.kts index 6beefc63fa..f3bd20c5bb 100644 --- a/buildSrc/src/main/kotlin/cpg.common-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/cpg.common-conventions.gradle.kts @@ -171,4 +171,5 @@ val libs = the() // necessary to be able to use the version c dependencies { implementation(libs.apache.commons.lang3) implementation(libs.neo4j.ogm.core) + implementation(libs.jackson) } \ No newline at end of file diff --git a/cpg-core/build.gradle.kts b/cpg-core/build.gradle.kts index 734910e5c5..40d27d3269 100644 --- a/cpg-core/build.gradle.kts +++ b/cpg-core/build.gradle.kts @@ -52,7 +52,6 @@ tasks.test { } dependencies { - api(libs.jackson) api(libs.slf4j.api) implementation(libs.bundles.log4j)