Skip to content

Commit

Permalink
Updated the build configuration to use sbt-nexus-workbench (#18)
Browse files Browse the repository at this point in the history
Removed unnecessary workbench module as the sources are now
inherited from the workbench dependency.

Updated context files such that the `@context` value is now boxed
in a json document under the `@context` key.  This addresses the
lack of compliance with the json-ld spec.
  • Loading branch information
bogdanromanx authored and MFSY committed Oct 18, 2017
1 parent db2080a commit 64811f9
Show file tree
Hide file tree
Showing 13 changed files with 156 additions and 606 deletions.
79 changes: 15 additions & 64 deletions build.sbt
@@ -1,74 +1,25 @@
lazy val commonsVersion = "0.4.3"
lazy val scalaTestVersion = "3.0.4"
lazy val akkaHttpVersion = "10.0.10"

lazy val shaclValidator = "ch.epfl.bluebrain.nexus" %% "shacl-validator" % commonsVersion
lazy val akkaHttpCore = "com.typesafe.akka" %% "akka-http-core" % akkaHttpVersion
lazy val scalaTest = "org.scalatest" %% "scalatest" % scalaTestVersion

val baseUri = "http://localhost/v0"

lazy val workbench = project
.in(file("modules/workbench"))
.settings(commonSettings, noPublishSettings)
.settings(name := "schema-workbench",
moduleName := "schema-workbench",
libraryDependencies ++= Seq(shaclValidator, akkaHttpCore, scalaTest))

lazy val prov = project
.in(file("modules/prov"))
.enablePlugins(BuildInfoPlugin)
.dependsOn(workbench % Test)
.settings(commonSettings, buildInfoSettings)
.settings(name := "nexus-prov", moduleName := "nexus-prov", libraryDependencies ++= Seq(scalaTest % Test))
.enablePlugins(WorkbenchPlugin)
.disablePlugins(ScapegoatSbtPlugin)
.settings(
name := "nexus-prov",
moduleName := "nexus-prov",
resolvers += Resolver.bintrayRepo("bogdanromanx", "maven"),
autoScalaLibrary := false,
workbenchVersion := "0.1.3"
)

lazy val root = project
.in(file("."))
.settings(name := "nexus-prov-root", moduleName := "nexus-prov-root")
.settings(commonSettings, noPublishSettings)
.aggregate(workbench, prov)
.settings(noPublish)
.aggregate(prov)

lazy val buildInfoSettings = Seq(
buildInfoKeys := Seq[BuildInfoKey](
BuildInfoKey("base" -> baseUri),
BuildInfoKey.map(resources.in(Compile)) {
case (_, v) =>
val resourceBase = resourceDirectory.in(Compile).value.getAbsolutePath
val dirsWithJson = (v * "schemas" ** "*.json").get
val schemas = dirsWithJson.map(_.getAbsolutePath.substring(resourceBase.length))
"schemas" -> schemas
},
BuildInfoKey.map(resources.in(Compile)) {
case (_, v) =>
val resourceBase = resourceDirectory.in(Compile).value.getAbsolutePath
val dirsWithJson = (v * "contexts" ** "*.json").get
val contexts = dirsWithJson.map(_.getAbsolutePath.substring(resourceBase.length))
"contexts" -> contexts
},
BuildInfoKey.map(resources.in(Test)) {
case (_, v) =>
val resourceBase = resourceDirectory.in(Test).value.getAbsolutePath
val dirsWithJson = (v * "data" ** "*.json").get
val data = dirsWithJson.map(_.getAbsolutePath.substring(resourceBase.length))
"data" -> data
},
BuildInfoKey.map(resources.in(Test)) {
case (_, v) =>
val resourceBase = resourceDirectory.in(Test).value.getAbsolutePath
val dirsWithJson = (v * "invalid" ** "*.json").get
val invalid = dirsWithJson.map(_.getAbsolutePath.substring(resourceBase.length))
"invalid" -> invalid
}
),
buildInfoPackage := "ch.epfl.bluebrain.nexus.prov"
lazy val noPublish = Seq(
publishLocal := {},
publish := {},
publishArtifact := false
)

lazy val commonSettings = Seq(resolvers += Resolver.bintrayRepo("bogdanromanx", "maven"))

lazy val noPublishSettings = Seq(publishLocal := {}, publish := {}, publishArtifact := false)

def nexusDep(name: String, version: String): ModuleID =
"ch.epfl.bluebrain.nexus" %% name % version

addCommandAlias("review", ";clean;test")
addCommandAlias("rel", ";release with-defaults skip-tests")
@@ -1,17 +1,19 @@
{
"skos": "http://www.w3.org/2004/02/skos/core#",
"label": {
"@id": "rdfs:label",
"@type": "xsd:string"
},
"comment": {
"@id": "rdfs:comment",
"@type": "xsd:string"
},
"editorialNote": {
"@id": "skos:editorialNote",
"@type": "xsd:string"
},
"schema": "http://schema.org/",
"prov": "http://www.w3.org/ns/prov#"
"@context": {
"skos": "http://www.w3.org/2004/02/skos/core#",
"label": {
"@id": "rdfs:label",
"@type": "xsd:string"
},
"comment": {
"@id": "rdfs:comment",
"@type": "xsd:string"
},
"editorialNote": {
"@id": "skos:editorialNote",
"@type": "xsd:string"
},
"schema": "http://schema.org/",
"prov": "http://www.w3.org/ns/prov#"
}
}
@@ -1,122 +1,124 @@
{
"sh": "http://www.w3.org/ns/shacl#",
"class": {
"@id": "sh:class",
"@type": "@id"
},
"rootClass": {
"@id": "shext:rootClass",
"@type": "@id"
},
"path": {
"@id": "sh:path",
"@type": "@id"
},
"qualifiedValueShape": {
"@id": "sh:qualifiedValueShape",
"@type": "@id",
"@container": "@list"
},
"qualifiedValueShapesDisjoint": {
"@id": "sh:qualifiedValueShapesDisjoint",
"@type": "xsd:boolean"
},
"qualifiedMinCount": {
"@id": "sh:qualifiedMinCount",
"@type": "xsd:integer"
},
"qualifiedMaxCount": {
"@id": "sh:qualifiedMaxCount",
"@type": "xsd:integer"
},
"maxCount": {
"@id": "sh:maxCount",
"@type": "xsd:integer"
},
"minCount": {
"@id": "sh:minCount",
"@type": "xsd:integer"
},
"minInclusive": "sh:minInclusive",
"maxInclusive": "sh:maxInclusive",
"maxExclusive": "sh:maxExclusive",
"minExclusive": "sh:minExclusive",
"in": {
"@id": "sh:in",
"@container": "@list"
},
"imports": {
"@id": "owl:imports",
"@type": "@id",
"@container": "@set"
},
"datatype": {
"@id": "sh:datatype",
"@type": "@id"
},
"description": "sh:description",
"name": "sh:name",
"nodeKind": {
"@id": "sh:nodeKind",
"@type": "@id"
},
"node": {
"@id": "sh:node",
"@type": "@id"
},
"property": {
"@id": "sh:property",
"@type": "@id",
"@container": "@set"
},
"targetClass": {
"@id": "sh:targetClass",
"@type": "@id"
},
"targetObjectsOf": {
"@id": "sh:targetObjectsOf",
"@type": "@id"
},
"targetSubjectsOf": {
"@id": "sh:targetSubjectsOf",
"@type": "@id"
},
"isDefinedBy": {
"@id": "http://www.w3.org/2000/01/rdf-schema#isDefinedBy",
"@type": "@id"
},
"shapes": {
"@reverse": "http://www.w3.org/2000/01/rdf-schema#isDefinedBy",
"@type": "@id",
"@container": "@set"
},
"or": {
"@id": "sh:or",
"@type": "@id",
"@container": "@list"
},
"and": {
"@id": "sh:and",
"@type": "@id",
"@container": "@list"
},
"xone": {
"@id": "sh:xone",
"@type": "@id",
"@container": "@list"
},
"not": {
"@id": "sh:not",
"@type": "@id",
"@container": "@list"
},
"lessThan": {
"@id": "sh:lessThan",
"@type": "@id"
},
"hasValue": "sh:hasValue",
"owl": "http://www.w3.org/2002/07/owl#",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"xsd": "http://www.w3.org/2001/XMLSchema#"
"@context": {
"sh": "http://www.w3.org/ns/shacl#",
"class": {
"@id": "sh:class",
"@type": "@id"
},
"rootClass": {
"@id": "shext:rootClass",
"@type": "@id"
},
"path": {
"@id": "sh:path",
"@type": "@id"
},
"qualifiedValueShape": {
"@id": "sh:qualifiedValueShape",
"@type": "@id",
"@container": "@list"
},
"qualifiedValueShapesDisjoint": {
"@id": "sh:qualifiedValueShapesDisjoint",
"@type": "xsd:boolean"
},
"qualifiedMinCount": {
"@id": "sh:qualifiedMinCount",
"@type": "xsd:integer"
},
"qualifiedMaxCount": {
"@id": "sh:qualifiedMaxCount",
"@type": "xsd:integer"
},
"maxCount": {
"@id": "sh:maxCount",
"@type": "xsd:integer"
},
"minCount": {
"@id": "sh:minCount",
"@type": "xsd:integer"
},
"minInclusive": "sh:minInclusive",
"maxInclusive": "sh:maxInclusive",
"maxExclusive": "sh:maxExclusive",
"minExclusive": "sh:minExclusive",
"in": {
"@id": "sh:in",
"@container": "@list"
},
"imports": {
"@id": "owl:imports",
"@type": "@id",
"@container": "@set"
},
"datatype": {
"@id": "sh:datatype",
"@type": "@id"
},
"description": "sh:description",
"name": "sh:name",
"nodeKind": {
"@id": "sh:nodeKind",
"@type": "@id"
},
"node": {
"@id": "sh:node",
"@type": "@id"
},
"property": {
"@id": "sh:property",
"@type": "@id",
"@container": "@set"
},
"targetClass": {
"@id": "sh:targetClass",
"@type": "@id"
},
"targetObjectsOf": {
"@id": "sh:targetObjectsOf",
"@type": "@id"
},
"targetSubjectsOf": {
"@id": "sh:targetSubjectsOf",
"@type": "@id"
},
"isDefinedBy": {
"@id": "http://www.w3.org/2000/01/rdf-schema#isDefinedBy",
"@type": "@id"
},
"shapes": {
"@reverse": "http://www.w3.org/2000/01/rdf-schema#isDefinedBy",
"@type": "@id",
"@container": "@set"
},
"or": {
"@id": "sh:or",
"@type": "@id",
"@container": "@list"
},
"and": {
"@id": "sh:and",
"@type": "@id",
"@container": "@list"
},
"xone": {
"@id": "sh:xone",
"@type": "@id",
"@container": "@list"
},
"not": {
"@id": "sh:not",
"@type": "@id",
"@container": "@list"
},
"lessThan": {
"@id": "sh:lessThan",
"@type": "@id"
},
"hasValue": "sh:hasValue",
"owl": "http://www.w3.org/2002/07/owl#",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"xsd": "http://www.w3.org/2001/XMLSchema#"
}
}

0 comments on commit 64811f9

Please sign in to comment.