Skip to content
Merged
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
16 changes: 8 additions & 8 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ name := "flatgraph"
ThisBuild / organization := "io.joern"
ThisBuild / scalaVersion := scala3

val scala3 = "3.3.8"
// ^ n.b. should always be the current scala LTS release, see
// https://www.scala-lang.org/blog/2022/08/17/long-term-compatibility-plans.html#library-maintainers
val scala3 = "3.8.3"
val scala2_12 = "2.12.20"
val osLibVersion = "0.11.4"
val commonsTextVersion = "1.13.0"
Expand Down Expand Up @@ -32,7 +30,7 @@ lazy val core = project
.settings(
name := "flatgraph-core",
libraryDependencies ++= Seq(
"com.lihaoyi" %% "ujson" % "4.1.0",
"com.lihaoyi" %% "ujson" % "4.4.1",
"com.github.luben" % "zstd-jni" % "1.5.7-11",
"org.slf4j" % "slf4j-api" % slf4jVersion,
)
Expand All @@ -56,7 +54,7 @@ lazy val formats = project
libraryDependencies ++= Seq(
"com.github.tototoshi" %% "scala-csv" % "2.0.0",
"org.apache.commons" % "commons-text" % commonsTextVersion,
"org.scala-lang.modules" %% "scala-xml" % "2.3.0",
"org.scala-lang.modules" %% "scala-xml" % "2.4.0",
"io.spray" %% "spray-json" % "1.3.6",
"com.fasterxml.jackson.core" % "jackson-core" % "2.17.2",
"com.github.scopt" %% "scopt" % "4.1.0",
Expand Down Expand Up @@ -208,11 +206,13 @@ ThisBuild / libraryDependencies ++= Seq(
ThisBuild / scalacOptions ++= Seq(
"-deprecation",
"-feature",
"--release", "11",
"--release", "17",
"-language:implicitConversions",
"-no-indent", // Require classical {...} syntax, indentation is not significant.
"-old-syntax", // Require `(...)` around conditions.
"-Yfuture-lazy-vals"
// This lint doesn't have an ID to suppress it, and we don't want to suppress a whole category. So the message is the only option.
// The `repeat(...)(...)` DSL intentionally passes behaviour builders via an implicit parameter list.
"-Wconf:msg=Implicit parameters should be provided with a `using` clause:s"
)

val scalacOptionsFor2_12 = Seq(
Expand All @@ -223,7 +223,7 @@ val scalacOptionsFor2_12 = Seq(

ThisBuild / compile / javacOptions ++= Seq(
"-g", // debug symbols
"--release=11"
"--release=17"
)

Global / cancelable := true
Expand Down
14 changes: 13 additions & 1 deletion formats/src/main/scala/flatgraph/formats/ImporterMain.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,21 @@ import scala.util.Using
* specific implementations, specifically the NodeFactories and EdgeFactories from the domain-specific generated classes (typically
* generated by by https://github.com/ShiftLeftSecurity/flatgraph-codegen) need to be passed in.
*/
object ImporterMain extends App {
object ImporterMain {
Comment thread
max-leuthaeuser marked this conversation as resolved.
lazy val logger = LoggerFactory.getLogger(getClass)

/** Entry point for invoking the importer as an application. Note that importing requires a domain-specific `Schema`, which cannot be
* passed via the command line - domain-specific tools should therefore define their own main method that delegates to [[apply]], e.g.
* {{{
* def main(args: Array[String]): Unit = ImporterMain(MyDomain.schema)(args)
* }}}
*/
def main(args: Array[String]): Unit =
throw new UnsupportedOperationException(
"importing requires a domain-specific schema, which cannot be passed via the command line - " +
"please define a domain-specific main method that delegates to `ImporterMain.apply(schema)` instead"
)

def apply(schema: Schema): Array[String] => Unit = { args =>
OParser
.parse(parser, args, Config(Nil, null, Paths.get("/dev/null")))
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.11.2
sbt.version=1.12.4
Loading