diff --git a/build.sbt b/build.sbt index e687d799..4349637b 100644 --- a/build.sbt +++ b/build.sbt @@ -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" @@ -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, ) @@ -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", @@ -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( @@ -223,7 +223,7 @@ val scalacOptionsFor2_12 = Seq( ThisBuild / compile / javacOptions ++= Seq( "-g", // debug symbols - "--release=11" + "--release=17" ) Global / cancelable := true diff --git a/formats/src/main/scala/flatgraph/formats/ImporterMain.scala b/formats/src/main/scala/flatgraph/formats/ImporterMain.scala index ab92a67d..a2bc4e07 100644 --- a/formats/src/main/scala/flatgraph/formats/ImporterMain.scala +++ b/formats/src/main/scala/flatgraph/formats/ImporterMain.scala @@ -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 { 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"))) diff --git a/project/build.properties b/project/build.properties index bbb0b608..c9aaa516 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.11.2 +sbt.version=1.12.4