Skip to content

Commit 478e3d9

Browse files
committed
Appling neo4j dependency hack also to Codyze
1 parent d0c3cac commit 478e3d9

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

codyze-core/src/main/kotlin/de/fraunhofer/aisec/codyze/Project.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ fun buildConfig(
8585
.defaultPasses()
8686
.optionalLanguage("de.fraunhofer.aisec.cpg.frontends.python.PythonLanguage")
8787
.topLevel(projectOptions.directory.toFile())
88-
.sourceLocations(translationOptions.sources.map { it.toFile() })
88+
.sourceLocations(
89+
translationOptions.sources.map { projectOptions.directory.resolve(it).toFile() }
90+
)
8991
.build()
9092
}

codyze/build.gradle.kts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import groovy.util.Node
2+
import groovy.util.NodeList
3+
14
/*
25
* Copyright (c) 2025, Fraunhofer AISEC. All rights reserved.
36
*
@@ -39,6 +42,17 @@ publishing {
3942
artifactId = "codyze"
4043
name.set("Codyze")
4144
description.set("The one-stop shop to the code property graph")
45+
withXml {
46+
// Modify the XML to exclude dependencies that start with "cpg-language-".
47+
// This is necessary because we do not want to "leak" the dependency to our dynamically activated
48+
// frontends to the outside
49+
val dependenciesNode = asNode().children().filterIsInstance<Node>().firstOrNull { it.name().toString() == "{http://maven.apache.org/POM/4.0.0}dependencies" }
50+
dependenciesNode?.children()?.removeIf {
51+
it is Node &&
52+
(it.name().toString() == "{http://maven.apache.org/POM/4.0.0}dependency") &&
53+
((it.get("artifactId") as? NodeList)?.text()?.startsWith("cpg-language-") == true)
54+
}
55+
}
4256
}
4357
}
4458
}

cpg-neo4j/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ publishing {
4949
// Modify the XML to exclude dependencies that start with "cpg-language-".
5050
// This is necessary because we do not want to "leak" the dependency to our dynamically activated
5151
// frontends to the outside
52-
var dependenciesNode = asNode().children().filterIsInstance<Node>().firstOrNull { true && it.name().toString() == "{http://maven.apache.org/POM/4.0.0}dependencies" }
52+
val dependenciesNode = asNode().children().filterIsInstance<Node>().firstOrNull { it.name().toString() == "{http://maven.apache.org/POM/4.0.0}dependencies" }
5353
dependenciesNode?.children()?.removeIf {
5454
it is Node &&
5555
(it.name().toString() == "{http://maven.apache.org/POM/4.0.0}dependency") &&

0 commit comments

Comments
 (0)