Skip to content
Closed

Next #39

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
29 changes: 13 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,25 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
jdk: [8, 11]
jdk: [21]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Scala
uses: olafurpg/setup-scala@v12
uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: "adopt@1.${{ matrix.jdk }}"
- name: Coursier cache
uses: coursier/cache-action@v6
distribution: temurin
java-version: ${{ matrix.jdk }}
# cache: sbt
- uses: sbt/setup-sbt@v1
with:
sbt-runner-version: '1.10.11'
- name: Build
shell: bash
run: sbt -v -Dfile.encoding=UTF-8 assembly
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: sbt -v assembly
- name: Test
shell: bash
run: target/scala-2.13/exist-xqts-runner-assembly-*-SNAPSHOT.jar --xqts-version HEAD --test-set fn-current-date
- name: Cleanup before cache
shell: bash
run: |
rm -rf "$HOME/.ivy2/local" || true
find $HOME/Library/Caches/Coursier/v1 -name "ivydata-*.properties" -delete || true
find $HOME/.ivy2/cache -name "ivydata-*.properties" -delete || true
find $HOME/.cache/coursier/v1 -name "ivydata-*.properties" -delete || true
find $HOME/.sbt -name "*.lock" -delete || true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
.idea/
.bsp/
*.iml
target/
work/
/project/metals.sbt
.DS_Store
.tool-versions
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ This application executes a W3C XQTS against an embedded eXist-db server.
To build from source you will need the following pre-requisites:

1. Git Command Line tools.
2. Java 8+
3. SBT (Simple Build Tool) 1.5.5+
2. Java 21
3. SBT (Simple Build Tool) 1.10.11

In the following steps, we assume that all of the above tools are available on your system path.

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.:

```scala
val existV = "5.3.0"
val existV = "7.0.0-SNAPSHOT"
```

Once the pre-requisites are met, to build from source you can execute the following commands from your console/terminal:
Expand Down
62 changes: 37 additions & 25 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name := "exist-xqts-runner"

organization := "org.exist-db"

scalaVersion := "2.13.8"
scalaVersion := "2.13.16"

semanticdbEnabled := true

Expand Down Expand Up @@ -36,30 +36,35 @@ developers := List(
name = "Adam Retter",
email = "adam@evolvedbinary.com",
url = url("https://www.evolvedbinary.com")
),
Developer(
id = "line0",
name = "Juri Leino",
email = "juri@existsolutions.com",
url = url("http://existsolutions.com")
)
)

versionScheme := Some("semver-spec")

libraryDependencies ++= {
val existV = "6.1.0"
val existV = "7.0.0-SNAPSHOT"

Seq(
"com.typesafe.akka" %% "akka-actor" % "2.6.20",
"com.github.scopt" %% "scopt" % "4.0.1",
"org.typelevel" %% "cats-effect" % "3.4.5",
//"com.fasterxml" % "aalto-xml" % "1.1.0-SNAPSHOT",
"com.typesafe.akka" %% "akka-actor" % "2.8.1-M1",
"com.github.scopt" %% "scopt" % "4.1.0",
"org.typelevel" %% "cats-effect" % "3.6.3",
// "com.fasterxml" % "aalto-xml" % "1.3.4",
"org.exist-db.thirdparty.com.fasterxml" % "aalto-xml" % "1.1.0-20180330",
"org.parboiled" %% "parboiled" % "2.4.1",
"org.clapper" %% "grizzled-slf4j" % "1.3.4" exclude("org.slf4j", "slf4j-api"),
"org.apache.ant" % "ant-junit" % "1.10.13", // used for formatting junit style report
"org.parboiled" %% "parboiled" % "2.5.1",
"org.apache.ant" % "ant-junit" % "1.10.15", // used for formatting junit style report

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

"org.slf4j" % "slf4j-api" % "2.0.6" % "runtime",
"org.apache.logging.log4j" % "log4j-slf4j2-impl" % "2.19.0" % "runtime"
"org.slf4j" % "slf4j-api" % "2.0.17",
"org.apache.logging.log4j" % "log4j-slf4j2-impl" % "2.25.2" % "runtime",
)
}

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

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

scalacOptions ++= Seq("-encoding", "utf-8", "-deprecation", "-feature", "-Ywarn-unused")
javacOptions ++= Seq("-source", "21", "-target", "21")

scalacOptions ++= Seq("-target:jvm-21", "-encoding", "utf-8", "-deprecation", "-feature", "-Ywarn-unused", "-Xlint")

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

val additional = Map(
"Multi-Release" -> "true", /* Required by log4j2 on JDK 11 and newer */
"Build-Timestamp" -> new SimpleDateFormat("yyyyMMddHHmmss").format(Calendar.getInstance.getTime),
"Built-By" -> sys.props("user.name"),
"Build-Tag" -> gitTag,
Expand All @@ -109,11 +116,12 @@ Compile / packageBin / packageOptions += {
attributes.putValue(k, v)
Package.JarManifest(manifest)
}

// assembly merge strategy for duplicate files from dependencies
assembly / assemblyMergeStrategy := {
case PathList("org", "exist", "xquery", "lib", "xqsuite", "xqsuite.xql") => MergeStrategy.first
case x if x.equals("module-info.class") || x.endsWith(s"${java.io.File.separatorChar}module-info.class") => MergeStrategy.discard
case PathList("META-INF", "versions", "9" ,"OSGI-INF", "MANIFEST.MF") => MergeStrategy.discard
case PathList("META-INF", "versions", "9" ,"module-info.class") => MergeStrategy.discard
case PathList("org", "exist", "xquery", "lib", "xqsuite", "xqsuite.xql") => MergeStrategy.first
case x if x.equals("module-info.class") || x.endsWith(s"${java.io.File.separatorChar}module-info.class") => MergeStrategy.discard
case x =>
val oldStrategy = (assembly / assemblyMergeStrategy).value
oldStrategy(x)
Expand All @@ -134,15 +142,19 @@ Compile / assembly / artifact := {
addArtifact(Compile / assembly / artifact, assembly)

// Publish to Maven Repo

publishMavenStyle := true

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

publishTo := {
val eb = "https://repo.evolvedbinary.com/"
if (isSnapshot.value)
Some("snapshots" at eb + "repository/exist-db-snapshots/")
Some("snapshots" at "https://maven.pkg.github.com/exist-db/exist-xqts-runner")
else
Some(Opts.resolver.sonatypeStaging)
}
Expand All @@ -169,4 +181,4 @@ releaseProcess := Seq[ReleaseStep](
setNextVersion,
commitNextVersion,
pushChanges
)
)
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version = 1.8.2
sbt.version = 1.10.11
12 changes: 6 additions & 6 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
logLevel := Level.Warn

addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.7.0")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.2.0")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.12")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.0")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.3.1")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.3.1")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.12.2")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.14.2")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.4.0")
addDependencyTreePlugin
Loading