diff --git a/build.sbt b/build.sbt index c2ea52d..be57305 100644 --- a/build.sbt +++ b/build.sbt @@ -2,11 +2,20 @@ version := "1.2" -scalaVersion := "2.12.4" +scalaVersion := "2.13.2" libraryDependencies ++= Seq( - "org.apache.jena" % "jena-arq" % "3.6.0", - "com.github.scopt" %% "scopt" % "3.7.0" + "org.apache.jena" % "jena-arq" % "3.14.0", + "com.github.scopt" %% "scopt" % "3.7.1" ) +excludeDependencies += "commons-logging" % "commons-logging" + +assemblyMergeStrategy in assembly := { + case "module-info.class" => MergeStrategy.discard + case x => + val oldStrategy = (assemblyMergeStrategy in assembly).value + oldStrategy(x) +} + assemblyJarName in assembly := "rdfdiff.jar" diff --git a/project/build.properties b/project/build.properties index 8b697bb..5a9ed92 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.1.0 +sbt.version=1.3.4 diff --git a/src/main/scala/uk/floop/org/RdfDiff.scala b/src/main/scala/uk/floop/org/RdfDiff.scala deleted file mode 100644 index 5071031..0000000 --- a/src/main/scala/uk/floop/org/RdfDiff.scala +++ /dev/null @@ -1,38 +0,0 @@ -package uk.org.floop - -import java.io.{File, StringWriter} -import java.net.URI -import org.apache.jena.riot.RDFDataMgr - -case class Config(uris: Seq[URI] = Seq.empty) - -object RdfDiff extends App { - val packageVersion: String = getClass.getPackage.getImplementationVersion() - val parser = new scopt.OptionParser[Config]("rdfdiff") { - head("rdfdiff", packageVersion) - arg[URI]("") minOccurs(1) maxOccurs(2) hidden() action { (x, c) => - c.copy(uris = c.uris :+ x) - } - help("help") text("Parses each file/URL as RDF and shows the differences between the resulting set of statements.") - } - parser.parse(args, Config()) match { - case Some(Config(Seq(uriA, uriB))) => - val a = RDFDataMgr.loadModel(uriA.toString) - val b = RDFDataMgr.loadModel(uriB.toString) - if (a isIsomorphicWith b) { - println("Graphs are isomorphic.") - System.exit(0) - } else { - val sw = new StringWriter() - sw.write("<<<<\n") - a.difference(b).write(sw, "TURTLE") - sw.write("\n----\n") - b.difference(a).write(sw, "TURTLE") - sw.write("\n>>>>\n") - println(sw.toString) - System.exit(1) - } - case _ => - System.exit(2) - } -} diff --git a/src/main/scala/uk/org/floop/RdfDiff.scala b/src/main/scala/uk/org/floop/RdfDiff.scala new file mode 100644 index 0000000..69b7cc1 --- /dev/null +++ b/src/main/scala/uk/org/floop/RdfDiff.scala @@ -0,0 +1,42 @@ +package uk.org.floop + +import java.io.StringWriter +import java.net.URI + +import org.apache.jena.riot.RDFDataMgr + +case class Config(uris: Seq[URI] = Seq.empty) + +object RdfDiff extends App { + val packageVersion: String = getClass.getPackage.getImplementationVersion + val parser = new scopt.OptionParser[Config]("rdfdiff") { + head("rdfdiff", packageVersion) + arg[URI]("") + .minOccurs(1) + .maxOccurs(2) + .hidden() + .action { (x, c) => c.copy(uris = c.uris :+ x) + } + help("help") text("Parses each file/URL as RDF and shows the differences between the resulting set of statements.") + } + parser.parse(args, Config()) match { + case Some(Config(Seq(uriA, uriB))) => + val a = RDFDataMgr.loadModel(uriA.toString) + val b = RDFDataMgr.loadModel(uriB.toString) + if (a isIsomorphicWith b) { + println("Graphs are isomorphic.") + System.exit(0) + } else { + val sw = new StringWriter() + sw.write("<<<<\n") + a.difference(b).write(sw, "TURTLE") + sw.write("\n----\n") + b.difference(a).write(sw, "TURTLE") + sw.write("\n>>>>\n") + println(sw.toString) + System.exit(1) + } + case _ => + System.exit(2) + } +}