Skip to content

Commit d729b7e

Browse files
authored
Merge pull request #38 from eXist-db/7-compat
Make exist-xqts runner compatible with 7.0.0-SNAPSHOT of exist-db
2 parents 21abfbb + d124649 commit d729b7e

23 files changed

+356
-144
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,25 @@ jobs:
99
fail-fast: false
1010
matrix:
1111
os: [ubuntu-latest, macos-latest, windows-latest]
12-
jdk: [8, 11]
12+
jdk: [21]
1313
runs-on: ${{ matrix.os }}
1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v2
17-
- name: Setup Scala
18-
uses: olafurpg/setup-scala@v12
16+
uses: actions/checkout@v4
17+
- name: Setup JDK
18+
uses: actions/setup-java@v4
1919
with:
20-
java-version: "adopt@1.${{ matrix.jdk }}"
21-
- name: Coursier cache
22-
uses: coursier/cache-action@v6
20+
distribution: temurin
21+
java-version: ${{ matrix.jdk }}
22+
cache: sbt
23+
- uses: sbt/setup-sbt@v1
24+
with:
25+
sbt-runner-version: '1.10.11'
2326
- name: Build
2427
shell: bash
25-
run: sbt -v -Dfile.encoding=UTF-8 assembly
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
run: sbt -v assembly
2631
- name: Test
2732
shell: bash
2833
run: target/scala-2.13/exist-xqts-runner-assembly-*-SNAPSHOT.jar --xqts-version HEAD --test-set fn-current-date
29-
- name: Cleanup before cache
30-
shell: bash
31-
run: |
32-
rm -rf "$HOME/.ivy2/local" || true
33-
find $HOME/Library/Caches/Coursier/v1 -name "ivydata-*.properties" -delete || true
34-
find $HOME/.ivy2/cache -name "ivydata-*.properties" -delete || true
35-
find $HOME/.cache/coursier/v1 -name "ivydata-*.properties" -delete || true
36-
find $HOME/.sbt -name "*.lock" -delete || true

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
.idea/
2+
.bsp/
23
*.iml
34
target/
45
work/
56
/project/metals.sbt
7+
.DS_Store
8+
.tool-versions

README.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,22 @@ This application executes a W3C XQTS against an embedded eXist-db server.
1212
To build from source you will need the following pre-requisites:
1313

1414
1. Git Command Line tools.
15-
2. Java 8+
16-
3. SBT (Simple Build Tool) 1.5.5+
15+
2. Java 21
16+
3. SBT (Simple Build Tool) 1.10.11
17+
4. a Github personal access token (PAT) with public read access
1718

18-
In the following steps, we assume that all of the above tools are available on your system path.
19+
In the following steps, we assume that git, java and sbt are available on your system path.
1920

2021
The version of eXist-db that the XQTS driver is compiled for is set in `build.sbt`. If you wish to compile against a newer or custom version of eXist-db, you can modify this to the version of an eXist-db Maven/Ivy artifact which you have available to your system, e.g.:
2122

2223
```scala
23-
val existV = "5.3.0"
24+
val existV = "7.0.0-SNAPSHOT"
2425
```
2526

27+
If you set the version to a SNAPSHOT version you want to load from Github Maven Package repository you need to authenticate with the Github PAT.
28+
29+
It can be provided via a credentials file in ~/.ivy2/.credentials or by setting the environment variable `GITHUB_TOKEN`.
30+
2631
Once the pre-requisites are met, to build from source you can execute the following commands from your console/terminal:
2732

2833
1. `git clone https://github.com/exist-db/exist-xqts-runner.git`
@@ -58,11 +63,21 @@ Given the standalone application, you can execute it by running either:
5863
2. or, even by just executing the `exist-xqts-runner-assembly-1.0.0.jar` file directly, as we compile an executable header into the Jar file. e.g. (on Linux/Mac): `./exist-xqts-runner-assembly-1.0.0.jar`.
5964

6065

61-
## Publishing to Maven Central / Evolved Binary Snapshots
66+
## Publishing
67+
68+
Releases are published to Maven Central
69+
Snaphots are published to Github Maven Package repository
70+
6271
1. Run `sbt clean release`
6372
2. Answer the questions
6473
3. Login to https://oss.sonatype.org/ then Close, and Release the Staging Repository
6574

75+
You can also publish to your local m2 repository which is useful for testing new builds within existdb's xqts-runner sub-project.
76+
77+
```sh
78+
sbt publishM2
79+
```
80+
6681
## XQTS Results
6782
The results of executing the XQTS will be formatted as JUnit test output.
6883

build.sbt

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name := "exist-xqts-runner"
44

55
organization := "org.exist-db"
66

7-
scalaVersion := "2.13.8"
7+
scalaVersion := "2.13.17"
88

99
semanticdbEnabled := true
1010

@@ -36,30 +36,35 @@ developers := List(
3636
name = "Adam Retter",
3737
email = "adam@evolvedbinary.com",
3838
url = url("https://www.evolvedbinary.com")
39+
),
40+
Developer(
41+
id = "line0",
42+
name = "Juri Leino",
43+
email = "juri@existsolutions.com",
44+
url = url("http://existsolutions.com")
3945
)
4046
)
4147

4248
versionScheme := Some("semver-spec")
4349

4450
libraryDependencies ++= {
45-
val existV = "6.1.0"
51+
val existV = "7.0.0-SNAPSHOT"
4652

4753
Seq(
48-
"com.typesafe.akka" %% "akka-actor" % "2.6.20",
49-
"com.github.scopt" %% "scopt" % "4.0.1",
50-
"org.typelevel" %% "cats-effect" % "3.4.5",
51-
//"com.fasterxml" % "aalto-xml" % "1.1.0-SNAPSHOT",
54+
"org.apache.pekko" %% "pekko-actor" % "1.3.0",
55+
"com.github.scopt" %% "scopt" % "4.1.0",
56+
"org.typelevel" %% "cats-effect" % "3.6.3",
57+
// "com.fasterxml" % "aalto-xml" % "1.3.4",
5258
"org.exist-db.thirdparty.com.fasterxml" % "aalto-xml" % "1.1.0-20180330",
53-
"org.parboiled" %% "parboiled" % "2.4.1",
54-
"org.clapper" %% "grizzled-slf4j" % "1.3.4" exclude("org.slf4j", "slf4j-api"),
55-
"org.apache.ant" % "ant-junit" % "1.10.13", // used for formatting junit style report
59+
"org.parboiled" %% "parboiled" % "2.5.1",
60+
"org.apache.ant" % "ant-junit" % "1.10.15", // used for formatting junit style report
5661

5762
"net.sf.saxon" % "Saxon-HE" % "9.9.1-8",
58-
"org.exist-db" % "exist-core" % existV,
59-
"org.xmlunit" % "xmlunit-core" % "2.9.1",
63+
"org.exist-db" % "exist-core" % existV changing() exclude("org.eclipse.jetty.toolchain", "jetty-jakarta-servlet-api"),
64+
"org.xmlunit" % "xmlunit-core" % "2.11.0",
6065

61-
"org.slf4j" % "slf4j-api" % "2.0.6" % "runtime",
62-
"org.apache.logging.log4j" % "log4j-slf4j2-impl" % "2.19.0" % "runtime"
66+
"org.slf4j" % "slf4j-api" % "2.0.17",
67+
"org.apache.logging.log4j" % "log4j-slf4j2-impl" % "2.25.2" % "runtime",
6368
)
6469
}
6570

@@ -73,12 +78,13 @@ excludeDependencies ++= Seq(
7378

7479
resolvers ++= Seq(
7580
Resolver.mavenLocal,
76-
"eXist-db Releases" at "https://repo.evolvedbinary.com/repository/exist-db/",
77-
"eXist-db Snapshots" at "https://repo.evolvedbinary.com/repository/exist-db-snapshots/",
78-
"eXist-db Maven Repo" at "https://raw.github.com/eXist-db/mvn-repo/master/"
81+
"eXist-db Releases" at "https://repo.exist-db.org/repository/exist-db/",
82+
"Github Package Registry" at "https://maven.pkg.github.com/exist-db/exist",
7983
)
8084

81-
scalacOptions ++= Seq("-encoding", "utf-8", "-deprecation", "-feature", "-Ywarn-unused")
85+
javacOptions ++= Seq("-source", "21", "-target", "21")
86+
87+
scalacOptions ++= Seq("-target:jvm-21", "-encoding", "utf-8", "-deprecation", "-feature", "-Ywarn-unused", "-Xlint")
8288

8389
// Fancy up the Assembly JAR
8490
Compile / packageBin / packageOptions += {
@@ -91,6 +97,7 @@ Compile / packageBin / packageOptions += {
9197
val gitTag = s"git name-rev --tags --name-only $gitCommit".!!.trim
9298

9399
val additional = Map(
100+
"Multi-Release" -> "true", /* Required by log4j2 on JDK 11 and newer */
94101
"Build-Timestamp" -> new SimpleDateFormat("yyyyMMddHHmmss").format(Calendar.getInstance.getTime),
95102
"Built-By" -> sys.props("user.name"),
96103
"Build-Tag" -> gitTag,
@@ -109,11 +116,12 @@ Compile / packageBin / packageOptions += {
109116
attributes.putValue(k, v)
110117
Package.JarManifest(manifest)
111118
}
112-
113119
// assembly merge strategy for duplicate files from dependencies
114120
assembly / assemblyMergeStrategy := {
115-
case PathList("org", "exist", "xquery", "lib", "xqsuite", "xqsuite.xql") => MergeStrategy.first
116-
case x if x.equals("module-info.class") || x.endsWith(s"${java.io.File.separatorChar}module-info.class") => MergeStrategy.discard
121+
case PathList("META-INF", "versions", "9" ,"OSGI-INF", "MANIFEST.MF") => MergeStrategy.discard
122+
case PathList("META-INF", "versions", "9" ,"module-info.class") => MergeStrategy.discard
123+
case PathList("org", "exist", "xquery", "lib", "xqsuite", "xqsuite.xql") => MergeStrategy.first
124+
case x if x.equals("module-info.class") || x.endsWith(s"${java.io.File.separatorChar}module-info.class") => MergeStrategy.discard
117125
case x =>
118126
val oldStrategy = (assembly / assemblyMergeStrategy).value
119127
oldStrategy(x)
@@ -134,15 +142,19 @@ Compile / assembly / artifact := {
134142
addArtifact(Compile / assembly / artifact, assembly)
135143

136144
// Publish to Maven Repo
137-
138145
publishMavenStyle := true
139146

140-
credentials += Credentials(Path.userHome / ".ivy2" / ".credentials")
147+
// Use GitHub Packages if GITHUB_TOKEN is set, otherwise use local connection in credentials file
148+
credentials += {
149+
sys.env.get("GITHUB_TOKEN") match {
150+
case Some(token) => Credentials("GitHub Package Registry", "maven.pkg.github.com", "_", token)
151+
case _ => Credentials(Path.userHome / ".ivy2" / ".credentials")
152+
}
153+
}
141154

142155
publishTo := {
143-
val eb = "https://repo.evolvedbinary.com/"
144156
if (isSnapshot.value)
145-
Some("snapshots" at eb + "repository/exist-db-snapshots/")
157+
Some("snapshots" at "https://maven.pkg.github.com/exist-db/exist-xqts-runner")
146158
else
147159
Some(Opts.resolver.sonatypeStaging)
148160
}
@@ -169,4 +181,4 @@ releaseProcess := Seq[ReleaseStep](
169181
setNextVersion,
170182
commitNextVersion,
171183
pushChanges
172-
)
184+
)

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version = 1.8.2
1+
sbt.version = 1.10.11

project/plugins.sbt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
logLevel := Level.Warn
22

3-
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.7.0")
4-
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.2.0")
5-
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
6-
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.12")
7-
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.0")
8-
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")
3+
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0")
4+
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.3.1")
5+
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.3.1")
6+
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.12.2")
7+
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.14.3")
8+
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.4.0")
99
addDependencyTreePlugin

src/main/resources/application.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ xqtsrunner {
2626
}
2727
}
2828

29-
akka {
29+
pekko {
3030

3131
loglevel = INFO
3232
stdout-loglevel = INFO

0 commit comments

Comments
 (0)