Skip to content
Merged
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
27 changes: 15 additions & 12 deletions .github/workflows/aot-test.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,51 +35,54 @@ jobs:
run: |
set -euo pipefail

# sbt 2 nests build outputs under target/out/<platform>/<scala version>/<project>/
mv target/out/jvm/scala-*/jelly-cli/graalvm-native-image/jelly-cli jelly-cli

# See if it runs at all
target/graalvm-native-image/jelly-cli version || exit 1
./jelly-cli version || exit 1

# Make sure reflection is supported
target/graalvm-native-image/jelly-cli version | grep "JVM reflection: supported" \
./jelly-cli version | grep "JVM reflection: supported" \
|| exit 1

# Make sure large RDF/XML file parsing is supported
target/graalvm-native-image/jelly-cli version | grep "Large RDF/XML file parsing: supported" \
./jelly-cli version | grep "Large RDF/XML file parsing: supported" \
|| exit 1

# Test RDF conversions
echo '_:b <http://t.org/> _:b .' > in.nt
target/graalvm-native-image/jelly-cli \
./jelly-cli \
rdf to-jelly --in-format=nt in.nt > out.jelly && \
[ -s out.jelly ] || exit 1
target/graalvm-native-image/jelly-cli \
./jelly-cli \
rdf from-jelly --out-format=jelly-text out.jelly > out.txt && \
[ -s out.txt ] || exit 1
# From jelly-text
target/graalvm-native-image/jelly-cli \
./jelly-cli \
rdf to-jelly --in-format=jelly-text out.txt > out2.jelly && \
[ -s out2.jelly ] || exit 1
target/graalvm-native-image/jelly-cli \
./jelly-cli \
rdf from-jelly --out-format=jsonld out.jelly > out.json && \
[ -s out.json ] || exit 1
echo '{"@graph":[{"@id":"http://e.org/r","http://e.org/p":{"@value":"v"}}]}' | \
target/graalvm-native-image/jelly-cli rdf to-jelly --in-format "jsonld" > jsonld.jelly && \
./jelly-cli rdf to-jelly --in-format "jsonld" > jsonld.jelly && \
[ -s jsonld.jelly ] || exit 1
echo '<?xml version="1.0"?><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Seq rdf:about="http://example.org/favourite-fruit"></rdf:Seq></rdf:RDF>' | \
target/graalvm-native-image/jelly-cli rdf to-jelly --in-format "rdfxml" > rdfxml.jelly && \
./jelly-cli rdf to-jelly --in-format "rdfxml" > rdfxml.jelly && \
[ -s rdfxml.jelly ] || exit 1

# Invalid RDF/XMl input test
# Regression test for: https://github.com/Jelly-RDF/cli/issues/217
echo 'invalidxml' | \
( ! target/graalvm-native-image/jelly-cli rdf to-jelly --in-format "rdfxml" &> error.txt ) && \
( ! ./jelly-cli rdf to-jelly --in-format "rdfxml" &> error.txt ) && \
grep 'Content is not allowed in prolog' error.txt || exit 1

# Test rdf validate
target/graalvm-native-image/jelly-cli \
./jelly-cli \
rdf validate out.jelly --compare-to-rdf-file in.nt || exit 1

- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: jelly-cli-${{ matrix.os }}
path: target/graalvm-native-image/*
path: jelly-cli
5 changes: 3 additions & 2 deletions .github/workflows/publish.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -31,7 +31,8 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: jelly-cli-${{ matrix.os }}
path: target/graalvm-native-image/*
# sbt 2 nests build outputs under target/out/<platform>/<scala version>/<project>/
path: target/out/jvm/scala-*/jelly-cli/graalvm-native-image/*

jit-compile:
name: Build the uber-JAR
Expand All@@ -53,7 +54,7 @@ jobs:
shell: bash
run: |
sbt -v assembly
mv target/scala-*/jelly-cli-assembly*.jar jelly-cli.jar
mv target/out/jvm/scala-*/jelly-cli/jelly-cli-assembly*.jar jelly-cli.jar

- name: Upload assembly
uses: actions/upload-artifact@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scala.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -40,7 +40,7 @@ jobs:

- name: Build and test
shell: bash
run: sbt -v +test test-serial:test
run: sbt -v +test TestSerial/test

test-assembly:
runs-on: ubuntu-latest
Expand All@@ -61,7 +61,7 @@ jobs:
shell: bash
run: |
sbt -v assembly
mv target/scala-*/jelly-cli-assembly*.jar jelly-cli.jar
mv target/out/jvm/scala-*/jelly-cli/jelly-cli-assembly*.jar jelly-cli.jar

- name: Test the assembly
run: |
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -176,12 +176,12 @@ The CI checks will not pass if this is not the case.
- Ensure you have [GraalVM](https://www.graalvm.org/) installed and the `native-image` utility is available in your `PATH`.
- Clone the repository.
- Run `sbt GraalVMNativeImage/packageBin`
- The binary will be available at `./target/graalvm-native-image/jelly-cli`.
- The binary will be available at `./target/out/jvm/scala-3.*.*/jelly-cli/graalvm-native-image/jelly-cli`.

#### Über-JAR build (just-in-time)

- Run `sbt assembly`
- The resulting JAR will be in `./target/scala-3.*.*/jelly-cli-assembly-*.jar`
- The resulting JAR will be in `./target/out/jvm/scala-3.*.*/jelly-cli/jelly-cli-assembly-*.jar`
- Run it like: `java -jar <path-to-jar>`

----
Expand Down
5 changes: 5 additions & 0 deletions build.sbt
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,11 @@ ThisBuild / semanticdbEnabled := true
lazy val scalaV = "3.8.4"
ThisBuild / scalaVersion := scalaV

// sbt-native-packager (pulled in by GraalVMNativeImagePlugin) defines settings for the Debian,
// RPM, and Universal packaging formats, which we don't use. sbt 2 reports all of them as unused
// keys on every startup, so turn the lint off.
Global / lintUnusedKeysOnLoad := false

resolvers +=
"Sonatype OSS Snapshots" at "https://s01.oss.sonatype.org/content/repositories/snapshots"

Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
sbt.version = 1.12.15
sbt.version = 2.0.6
Original file line numberDiff line numberDiff line change
Expand Up@@ -102,7 +102,7 @@ class RdfToJellySpec extends AnyWordSpec with TestFixtureHelper with Matchers:
}

"input stream to output stream, generalized RDF (N-Triples)" in {
val inputStream = new FileInputStream(getClass.getResource("/generalized.nt").getPath)
val inputStream = getClass.getResourceAsStream("/generalized.nt")
RdfToJelly.setStdIn(inputStream)
val (out, err) = RdfToJelly.runTestCommand(
List("rdf", "to-jelly", "--in-format=nt"),
Expand All@@ -116,7 +116,7 @@ class RdfToJellySpec extends AnyWordSpec with TestFixtureHelper with Matchers:
}

"input stream to output stream, generalized RDF (N-Quads)" in {
val inputStream = new FileInputStream(getClass.getResource("/generalized.nq").getPath)
val inputStream = getClass.getResourceAsStream("/generalized.nq")
RdfToJelly.setStdIn(inputStream)
val (out, err) = RdfToJelly.runTestCommand(
List("rdf", "to-jelly", "--in-format=nq"),
Expand Down
Loading