Skip to content

Commit 4226460

Browse files
committed
Compiles with Scala 3
1 parent cf7c9bc commit 4226460

File tree

22 files changed

+1695
-632
lines changed

22 files changed

+1695
-632
lines changed

.bsp/sbt.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"name":"sbt","version":"1.5.4","bspVersion":"2.0.0-M5","languages":["scala"],"argv":["/usr/lib/jvm/java-12-openjdk-amd64/bin/java","-Xms100m","-Xmx100m","-classpath","/usr/share/sbt/bin/sbt-launch.jar","xsbt.boot.Boot","-bsp","--sbt-launch-jar=/usr/share/sbt/bin/sbt-launch.jar"]}
1+
{"name":"sbt","version":"1.6.0","bspVersion":"2.0.0-M5","languages":["scala"],"argv":["/usr/lib/jvm/java-11-openjdk-amd64/bin/java","-Xms100m","-Xmx100m","-classpath","/home/labra/.cache/sbt/boot/sbt-launch/1.5.8/sbt-launch-1.5.8.jar","-Dsbt.script=/usr/bin/sbt","xsbt.boot.Boot","-bsp"]}

.github/workflows/ci.yml

+20-16
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ name: Continuous Integration
99

1010
on:
1111
pull_request:
12-
branches: ['*']
12+
branches: ['**']
1313
push:
14-
branches: ['*']
14+
branches: ['**']
1515

1616
env:
1717
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -22,19 +22,21 @@ jobs:
2222
strategy:
2323
matrix:
2424
os: [ubuntu-latest]
25-
scala: [2.12.14]
26-
java: [adopt@1.11]
25+
scala: [2.12.15]
26+
java: [temurin@11]
2727
runs-on: ${{ matrix.os }}
2828
steps:
2929
- name: Checkout current branch (full)
3030
uses: actions/checkout@v2
3131
with:
3232
fetch-depth: 0
3333

34-
- name: Setup Java and Scala
35-
uses: olafurpg/setup-scala@v10
34+
- name: Setup Java (temurin@11)
35+
if: matrix.java == 'temurin@11'
36+
uses: actions/setup-java@v2
3637
with:
37-
java-version: ${{ matrix.java }}
38+
distribution: temurin
39+
java-version: 11
3840

3941
- name: Cache sbt
4042
uses: actions/cache@v2
@@ -70,19 +72,21 @@ jobs:
7072
strategy:
7173
matrix:
7274
os: [ubuntu-latest]
73-
scala: [2.12.14]
74-
java: [adopt@1.11]
75+
scala: [2.12.15]
76+
java: [temurin@11]
7577
runs-on: ${{ matrix.os }}
7678
steps:
7779
- name: Checkout current branch (full)
7880
uses: actions/checkout@v2
7981
with:
8082
fetch-depth: 0
8183

82-
- name: Setup Java and Scala
83-
uses: olafurpg/setup-scala@v10
84+
- name: Setup Java (temurin@11)
85+
if: matrix.java == 'temurin@11'
86+
uses: actions/setup-java@v2
8487
with:
85-
java-version: ${{ matrix.java }}
88+
distribution: temurin
89+
java-version: 11
8690

8791
- name: Cache sbt
8892
uses: actions/cache@v2
@@ -96,15 +100,15 @@ jobs:
96100
~/Library/Caches/Coursier/v1
97101
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
98102

99-
- name: Download target directories (2.12.14)
103+
- name: Download target directories (2.12.15)
100104
uses: actions/download-artifact@v2
101105
with:
102-
name: target-${{ matrix.os }}-2.12.14-${{ matrix.java }}
106+
name: target-${{ matrix.os }}-2.12.15-${{ matrix.java }}
103107

104-
- name: Inflate target directories (2.12.14)
108+
- name: Inflate target directories (2.12.15)
105109
run: |
106110
tar xf targets.tar
107111
rm targets.tar
108112
109113
- name: Publish project
110-
run: sbt ++${{ matrix.scala }} +publish
114+
run: sbt ++${{ matrix.scala }} +publish

.github/workflows/clean.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ jobs:
5656
printf "Deleting '%s' #%d, %'d bytes\n" $name ${ARTCOUNT[$name]} $size
5757
ghapi -X DELETE $REPO/actions/artifacts/$id
5858
done
59-
done
59+
done

build.sbt

+21-20
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,37 @@
1-
lazy val scala212 = "2.12.14"
2-
lazy val scala213 = "2.13.6"
3-
lazy val supportedScalaVersions = List(scala212, scala213)
1+
lazy val scala212 = "2.12.15"
2+
lazy val scala213 = "2.13.7"
3+
lazy val scala3 = "3.1.0"
44

5-
val Java11 = "adopt@1.11"
5+
lazy val supportedScalaVersions = List(
6+
scala3, scala212, scala213
7+
)
8+
9+
val Java11 = JavaSpec.temurin("11") // "adopt@1.11"
610

711

812
// Local dependencies
9-
lazy val utilsVersion = "0.1.98"
10-
lazy val srdfVersion = "0.1.102"
11-
lazy val shexVersion = "0.1.91"
12-
lazy val shaclVersion = "0.1.75"
13+
lazy val srdfVersion = "0.1.106"
14+
lazy val utilsVersion = "0.2.2"
15+
lazy val shexVersion = "0.1.107"
16+
lazy val shaclVersion = "0.1.78"
1317

1418
// Dependency versions
15-
lazy val catsVersion = "2.6.1"
16-
// lazy val commonsTextVersion = "1.8"
19+
lazy val catsVersion = "2.7.0"
1720
lazy val circeVersion = "0.14.1"
18-
// lazy val diffsonVersion = "4.0.0"
19-
// lazy val effVersion = "4.6.1"
20-
lazy val jenaVersion = "3.16.0"
21+
lazy val jenaVersion = "4.3.2"
2122
lazy val jgraphtVersion = "1.3.1"
2223
lazy val jlineVersion = "3.17.0"
2324
lazy val jnaVersion = "5.6.0"
2425
lazy val logbackVersion = "1.2.3"
25-
lazy val loggingVersion = "3.9.2"
26-
lazy val munitVersion = "0.7.26"
27-
lazy val munitEffectVersion = "1.0.1"
28-
lazy val pprintVersion = "0.6.0"
26+
lazy val loggingVersion = "3.9.4"
27+
lazy val munitVersion = "0.7.29"
28+
lazy val munitEffectVersion = "1.0.7"
29+
lazy val pprintVersion = "0.7.1"
2930
lazy val rdf4jVersion = "3.0.0"
30-
lazy val scalacheckVersion = "1.14.0"
31-
lazy val scallopVersion = "3.3.2"
31+
lazy val scalacheckVersion = "1.15.4"
32+
lazy val scallopVersion = "4.1.0"
3233
lazy val shaclTQVersion = "1.3.2"
33-
lazy val typesafeConfigVersion = "1.3.4"
34+
lazy val typesafeConfigVersion = "1.4.1"
3435

3536

3637
// Compiler plugin dependency versions

modules/converter/src/main/scala/es/weso/shex/linter/ShExLinter.scala

+5-3
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,11 @@ object ShExLinter {
5252
} yield newSchema
5353

5454
private def replaceSchema(schema: Schema, expr: ShapeExpr, newExpr: ShapeExpr): Schema = {
55-
schema.copy(shapes = schema.shapes.map(ls => {
56-
replaceList(ls, expr, newExpr)
57-
}))
55+
schema.copy(
56+
shapes = schema.shapes.map(ls => {
57+
replaceList(ls, expr, newExpr)
58+
})
59+
)
5860
}
5961

6062
private def removeShape(schema: Schema, expr: ShapeExpr): Schema = {

modules/converter/src/test/scala/es/weso/shex/linter/ShExLinterTest.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class ShExLinterTest extends CatsEffectSuite {
3636
expected <- io2es(shex.Schema.fromString(strExpected,"SHEXC"))
3737
} yield (schema,simplified, expected)
3838

39-
run_es(r).unsafeRunSync.fold(e => fail(s"Error: $e"), values => {
39+
run_es(r).unsafeRunSync().fold(e => fail(s"Error: $e"), values => {
4040
val (schema,simplified,expected) = values
4141
if (Eq[Schema].eqv(simplified,expected)) {
4242
assertEquals(true,true)

modules/schema/src/main/scala/es/weso/schema/DataFormats.scala

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package es.weso.schema
22

33
import scala.util._
44

5-
case class DataFormats(name: String)
5+
case class DataFormats(name: String)
66

77
object DataFormats {
88
lazy val TURTLE = DataFormats("TURTLE")
@@ -28,10 +28,11 @@ object DataFormats {
2828

2929
lazy val toList: List[String] = availableFormats.map(_.name).toList
3030

31-
override def toString(): String = {
31+
def show: String = {
3232
toList.mkString(",")
3333
}
3434

35+
3536
def lookup(format: String): Try[DataFormats] = {
3637
availableFormats.find(_.name == format.toUpperCase).headOption match {
3738
case Some(df) => Success(df)

modules/schema/src/main/scala/es/weso/schema/ErrorInfo.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ case class ErrorInfo(msg: String) {
99
}
1010

1111
object ErrorInfo extends LazyLogging {
12-
implicit val showErrorInfo = new Show[ErrorInfo] {
12+
implicit val showErrorInfo: Show[ErrorInfo] = new Show[ErrorInfo] {
1313
override def show(e: ErrorInfo): String = e.show
1414
}
1515

modules/schema/src/main/scala/es/weso/schema/Result.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ object Result extends LazyLogging {
148148
def errStr(str: String) =
149149
empty.copy(isValid = false, message = str)
150150

151-
implicit val showResult = new Show[Result] {
151+
implicit val showResult: Show[Result] = new Show[Result] {
152152
override def show(r: Result): String = r.show(None,Details)
153153
}
154154

modules/schema/src/main/scala/es/weso/schema/SchemaLabel.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ case class SchemaLabel(node: RDFNode, pm: PrefixMap = PrefixMap.empty) {
2020
}
2121

2222
object SchemaLabel {
23-
implicit val showSchemaLabel = new Show[SchemaLabel] {
23+
implicit val showSchemaLabel: Show[SchemaLabel] = new Show[SchemaLabel] {
2424
override def show(s: SchemaLabel): String = s.show
2525
}
2626
}

modules/schemaInfer/src/main/scala/es/weso/schemaInfer/InferredNodeConstraint.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ case object InferredString extends InferredNodeConstraint {
155155
case class InferredLang(lang: Lang) extends InferredNodeConstraint {
156156
override def collapse(other: InferredNodeConstraint) = other match {
157157
case l : InferredLang =>
158-
if (lang.lang == l.lang) InferredLang(lang)
158+
if (lang.lang == l.lang.lang) InferredLang(lang)
159159
else InferredLangString
160160
case InferredLangString => InferredLangString
161161
case InferredLiteral | _:InferredDatatype=> InferredLiteral

modules/sgraph/src/test/scala/es/weso/rdf/sgraph/SGraphTest.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ class SGraphTest extends CatsEffectSuite {
3333
"TURTLE",
3434
None
3535
).flatMap(_.use(rdf => for {
36-
ts <- rdf.rdfTriples.compile.toList
36+
ts <- rdf.rdfTriples().compile.toList
3737
dot <-RDF2SGraph.rdf2sgraph(rdf)
3838
} yield (rdf,ts,dot)))
39-
e.attempt.unsafeRunSync.fold(
39+
e.attempt.unsafeRunSync().fold(
4040
e => fail(s"Error: $e"),
4141
tuple => {
4242
val (_,ts,dot) = tuple

0 commit comments

Comments
 (0)