Skip to content

Commit

Permalink
Using ki-shell from JitPack
Browse files Browse the repository at this point in the history
Instead of reyling on maven central, we are using a JitPack release for the console. This is ok, since the console is a standalone binary and is not to be used as a dependency.

Fixes #1426
Fixes #1439
Fixes #1272
  • Loading branch information
oxisto committed Mar 7, 2024
1 parent c1ee7c1 commit fb54d26
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 7 deletions.
5 changes: 2 additions & 3 deletions buildSrc/src/main/kotlin/cpg.common-conventions.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
Expand Down Expand Up @@ -97,9 +98,7 @@ signing {
//
// specify Java & Kotlin JVM version
kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
jvmToolchain(17)
}

tasks.withType<KotlinCompile> {
Expand Down
17 changes: 16 additions & 1 deletion cpg-console/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

/*
* Copyright (c) 2021, Fraunhofer AISEC. All rights reserved.
*
Expand Down Expand Up @@ -52,12 +54,25 @@ tasks.withType<Test> {
}
}


repositories {
maven {
setUrl("https://jitpack.io")
}
}

dependencies {
// CPG
api(projects.cpgAnalysis)
api(projects.cpgNeo4j)

implementation(libs.kotlin.ki.shell)

// ki-shell dependencies, that we need to specify manually because we are using the JitPack "release"
implementation(libs.kotlin.script.runtime)
implementation(libs.bundles.kotlin.scripting)
implementation(libs.antlr.runtime)
implementation(libs.kotlin.coroutines.core)
implementation(libs.kotlin.ki.shell)
implementation(libs.jline)

}
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,10 @@ fun Node.followPrevDFG(predicate: (Node) -> Boolean): MutableList<Node>? {
return null
}

/** Returns all [Node] children in this graph, starting with this [Node]. */
val Node?.nodes: List<Node>
get() = this.allChildren()

/** Returns all [CallExpression] children in this graph, starting with this [Node]. */
val Node?.calls: List<CallExpression>
get() = this.allChildren()
Expand Down
20 changes: 17 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,17 @@ nexus-publish = "1.3.0"
[libraries]
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin"}
kotlin-script-runtime = { module = "org.jetbrains.kotlin:kotlin-script-runtime", version.ref = "kotlin"}
kotlin-scripting-common = { module = "org.jetbrains.kotlin:kotlin-scripting-common", version.ref = "kotlin"}
kotlin-scripting-jvm = { module = "org.jetbrains.kotlin:kotlin-scripting-jvm", version.ref = "kotlin"}
kotlin-scripting-dependencies = { module = "org.jetbrains.kotlin:kotlin-scripting-dependencies", version.ref = "kotlin"}
kotlin-scripting-dependencies-maven-all = { module = "org.jetbrains.kotlin:kotlin-scripting-dependencies-maven-all", version.ref = "kotlin"}
kotlin-scripting-ide-services = { module = "org.jetbrains.kotlin:kotlin-scripting-ide-services", version.ref = "kotlin"}
kotlin-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version = "1.8.0"}
kotlin-ki-shell = { module = "org.jetbrains.kotlinx:ki-shell", version = "0.5.2"}
kotlin-ki-shell = { module = "com.github.Kotlin:kotlin-interactive-shell", version = "5b1ff4d821"}
kotlin-test-junit5 = { module = "org.jetbrains.kotlin:kotlin-test-junit5", version.ref = "kotlin"} # this is only needed for the testFixtures in cpg-core, everywhere else kotlin("test") is used

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" }
log4j-core = { module = "org.apache.logging.log4j:log4j-core", version.ref = "log4j" }

apache-commons-lang3 = { module = "org.apache.commons:commons-lang3", version = "3.14.0"}
neo4j-ogm-core = { module = "org.neo4j:neo4j-ogm-core", version.ref = "neo4j"}
Expand All @@ -30,7 +35,9 @@ picocli = { module = "info.picocli:picocli", version = "4.7.0"}
picocli-codegen = { module = "info.picocli:picocli-codegen", version = "4.7.0"}
jep = { module = "black.ninia:jep", version = "4.2.0" } # build.yml uses grep to extract the jep verison number for CI/CD purposes
llvm = { module = "org.bytedeco:llvm-platform", version = "16.0.4-1.5.9"}
jruby = {module = "org.jruby:jruby-core", version = "9.4.3.0" }
jruby = { module = "org.jruby:jruby-core", version = "9.4.3.0" }
jline = { module = "org.jline:jline", version = "3.25.1" }
antlr-runtime = { module = "org.antlr:antlr4-runtime", version = "4.8-1" } # we cannot upgrade until ki-shell upgrades this!

# test
junit-params = { module = "org.junit.jupiter:junit-jupiter-params", version = "5.10.0"}
Expand All @@ -47,6 +54,13 @@ nexus-publish-gradle = { module = "io.github.gradle-nexus:publish-plugin", versi
[bundles]
log4j = ["log4j-impl", "log4j-core"]
neo4j = ["neo4j-ogm-core", "neo4j-ogm-bolt-driver"]
kotlin-scripting = [
"kotlin-scripting-common",
"kotlin-scripting-jvm",
"kotlin-scripting-ide-services",
"kotlin-scripting-dependencies",
"kotlin-scripting-dependencies-maven-all",
]

[plugins]
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin"}
Expand Down

0 comments on commit fb54d26

Please sign in to comment.