Skip to content

Commit 26a6268

Browse files
authored
scala 3.5.2 migration (#1)
* scala 3.5.2 migration Signed-off-by: Prabhu Subramanian <[email protected]> * Generate sbom with cdxgen during release Signed-off-by: Prabhu Subramanian <[email protected]> --------- Signed-off-by: Prabhu Subramanian <[email protected]>
1 parent 2e95890 commit 26a6268

File tree

19 files changed

+70
-53
lines changed

19 files changed

+70
-53
lines changed

.github/workflows/release.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ jobs:
1515
- uses: actions/checkout@v4
1616
with:
1717
fetch-depth: 0
18+
- name: Use Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '23.x'
22+
registry-url: https://registry.npmjs.org/
1823
- name: Set up JDK
1924
uses: actions/setup-java@v4
2025
with:
@@ -33,3 +38,15 @@ jobs:
3338
if: startsWith(github.ref, 'refs/tags/')
3439
env:
3540
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
- name: Generate SBOM with cdxgen
42+
run: |
43+
npm install -g @cyclonedx/cdxgen
44+
cdxgen -t sbt -o bom.json . -p --no-recurse
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
- name: Create Release
48+
if: startsWith(github.ref, 'refs/tags/')
49+
uses: softprops/action-gh-release@v2
50+
with:
51+
files: |
52+
bom.json

build.sbt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name := "overflowdb2"
22
ThisBuild / organization := "io.appthreat"
3-
ThisBuild / version := "1.0.0"
4-
ThisBuild / scalaVersion := "3.3.1"
3+
ThisBuild / version := "1.0.1"
4+
ThisBuild / scalaVersion := "3.5.2"
55
publish / skip := true
66

77
lazy val core = project.in(file("core"))
@@ -12,7 +12,7 @@ lazy val coreTests = project.in(file("core-tests")).dependsOn(formats, testdomai
1212
lazy val traversalTests = project.in(file("traversal-tests")).dependsOn(formats)
1313

1414
ThisBuild / libraryDependencies ++= Seq(
15-
"org.scalatest" %% "scalatest" % "3.2.17" % Test
15+
"org.scalatest" %% "scalatest" % "3.2.19" % Test
1616
)
1717

1818
ThisBuild / scalacOptions ++= Seq(

core/build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name := "odb2-core"
22

33
libraryDependencies ++= Seq(
44
"net.sf.trove4j" % "core" % "3.1.0",
5-
"org.msgpack" % "msgpack-core" % "0.9.1",
5+
"org.msgpack" % "msgpack-core" % "0.9.8",
66
"com.h2database" % "h2-mvstore" % "1.4.200"
77
)
88
githubOwner := "appthreat"

formats/build.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name := "odb2-formats"
22

33
libraryDependencies ++= Seq(
4-
"com.github.tototoshi" %% "scala-csv" % "1.3.10",
5-
"org.scala-lang.modules" %% "scala-xml" % "2.2.0",
4+
"com.github.tototoshi" %% "scala-csv" % "2.0.0",
5+
"org.scala-lang.modules" %% "scala-xml" % "2.3.0",
66
"com.github.pathikrit" %% "better-files" % "3.9.2" % Test,
77
"com.github.scopt" %% "scopt" % "4.1.0",
88
"io.spray" %% "spray-json" % "1.3.6"

formats/src/main/scala/overflowdb/formats/ExporterMain.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import scala.util.Using
2020
object ExporterMain:
2121

2222
def apply(
23-
nodeFactories: Seq[NodeFactory[_]],
24-
edgeFactories: Seq[EdgeFactory[_]]
23+
nodeFactories: Seq[NodeFactory[?]],
24+
edgeFactories: Seq[EdgeFactory[?]]
2525
): Array[String] => Unit = args =>
2626
OParser
2727
.parse(parser, args, Config(Paths.get("/dev/null"), null, Paths.get("/dev/null")))

formats/src/main/scala/overflowdb/formats/ImporterMain.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import scala.util.Using
1818
object ImporterMain extends App:
1919

2020
def apply(
21-
nodeFactories: Seq[NodeFactory[_]],
22-
edgeFactories: Seq[EdgeFactory[_]],
21+
nodeFactories: Seq[NodeFactory[?]],
22+
edgeFactories: Seq[EdgeFactory[?]],
2323
convertPropertyForPersistence: Any => Any = identity
2424
): Array[String] => Unit = args =>
2525
OParser

formats/src/main/scala/overflowdb/formats/graphson/GraphSONProtocol.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ object GraphSONProtocol extends DefaultJsonProtocol:
4040
)
4141
case x => serializationError(s"unsupported propertyValue: $x")
4242

43-
def read(value: JsValue): PropertyValue with Product =
43+
def read(value: JsValue): PropertyValue & Product =
4444
value match
4545
case JsString(v) => return StringValue(v)
4646
case JsBoolean(v) => return BooleanValue(v)
@@ -50,7 +50,7 @@ object GraphSONProtocol extends DefaultJsonProtocol:
5050
case x: Seq[?] => readNonList(x)
5151
case null => deserializationError("PropertyValue expected")
5252

53-
def readNonList(value: Seq[?]): PropertyValue with Product = value match
53+
def readNonList(value: Seq[?]): PropertyValue & Product = value match
5454
case Seq(JsNumber(v), JsString(typ)) =>
5555
if typ.equals(Type.Long.typ) then LongValue(v.toLongExact)
5656
else if typ.equals(Type.Int.typ) then IntValue(v.toIntExact)
@@ -64,7 +64,7 @@ object GraphSONProtocol extends DefaultJsonProtocol:
6464
implicit object LongValueFormat extends RootJsonFormat[LongValue]:
6565
def write(c: LongValue): JsValue = PropertyValueJsonFormat.write(c)
6666

67-
def read(value: JsValue): LongValue with Product =
67+
def read(value: JsValue): LongValue & Product =
6868
value.asJsObject.getFields("@value", "@type") match
6969
case Seq(JsNumber(v), JsString(typ)) if typ.equals(Type.Long.typ) =>
7070
LongValue(v.toLongExact)

formats/src/main/scala/overflowdb/formats/graphson/package.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ package object graphson:
4343
Type.Double
4444
else if clazz.isAssignableFrom(classOf[String]) then
4545
Type.String
46-
else if clazz.isAssignableFrom(classOf[List[_]]) then
46+
else if clazz.isAssignableFrom(classOf[List[?]]) then
4747
Type.List
4848
else
4949
throw new AssertionError(

formats/src/main/scala/overflowdb/formats/neo4jcsv/ColumnDefinitions.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,13 @@ class ColumnDefinitions(propertyNames: Iterable[String]):
139139

140140
value match
141141
case _: Iterable[?] =>
142-
deriveNeo4jTypeForArray(_.asInstanceOf[Iterable[_]])
142+
deriveNeo4jTypeForArray(_.asInstanceOf[Iterable[?]])
143143
case _: IterableOnce[?] =>
144-
deriveNeo4jTypeForArray(_.asInstanceOf[IterableOnce[_]].iterator.toSeq)
144+
deriveNeo4jTypeForArray(_.asInstanceOf[IterableOnce[?]].iterator.toSeq)
145145
case _: java.lang.Iterable[?] =>
146-
deriveNeo4jTypeForArray(_.asInstanceOf[java.lang.Iterable[_]].asScala)
146+
deriveNeo4jTypeForArray(_.asInstanceOf[java.lang.Iterable[?]].asScala)
147147
case _: Array[?] =>
148-
deriveNeo4jTypeForArray(x => ArraySeq.unsafeWrapArray(x.asInstanceOf[Array[_]]))
148+
deriveNeo4jTypeForArray(x => ArraySeq.unsafeWrapArray(x.asInstanceOf[Array[?]]))
149149
case scalarValue =>
150150
ScalarColumnDef(deriveNeo4jTypeForScalarValue(scalarValue.getClass))
151151
end deriveNeo4jType

formats/src/main/scala/overflowdb/formats/package.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ package object formats:
2121
*/
2222
def isList(clazz: Class[?]): Boolean =
2323
clazz.isArray ||
24-
classOf[java.lang.Iterable[_]].isAssignableFrom(clazz) ||
25-
classOf[IterableOnce[_]].isAssignableFrom(clazz)
24+
classOf[java.lang.Iterable[?]].isAssignableFrom(clazz) ||
25+
classOf[IterableOnce[?]].isAssignableFrom(clazz)
2626

27-
val iterableForList: PartialFunction[Any, Iterable[_]] = {
27+
val iterableForList: PartialFunction[Any, Iterable[?]] = {
2828
case it: Iterable[?] => it
2929
case it: IterableOnce[?] => it.iterator.toSeq
3030
case it: java.lang.Iterable[?] => it.asScala

0 commit comments

Comments
 (0)