@@ -2,10 +2,10 @@ import Dependencies._
22import com .typesafe .sbt .packager .docker ._
33import xerial .sbt .Sonatype ._
44
5- ThisBuild / scalaVersion := " 2.13.14"
6- ThisBuild / versionScheme := Some (" early-semver" )
7- ThisBuild / organization := " io.github.dataunitylab"
8- ThisBuild / organizationName := " Rochester Institute of Technology"
5+ ThisBuild / scalaVersion := " 2.13.14"
6+ ThisBuild / versionScheme := Some (" early-semver" )
7+ ThisBuild / organization := " io.github.dataunitylab"
8+ ThisBuild / organizationName := " Rochester Institute of Technology"
99
1010inThisBuild(
1111 List (
@@ -20,11 +20,13 @@ inThisBuild(
2020 url(" https://michael.mior.ca" )
2121 )
2222 ),
23- sonatypeProjectHosting := Some (GitHubHosting (
24- " dataunitylab" ,
25- " jsonoid-discovery" ,
26- " mmior@mail.rit.edu"
27- )),
23+ sonatypeProjectHosting := Some (
24+ GitHubHosting (
25+ " dataunitylab" ,
26+ " jsonoid-discovery" ,
27+ " mmior@mail.rit.edu"
28+ )
29+ ),
2830 semanticdbEnabled := true ,
2931 semanticdbVersion := scalafixSemanticdb.revision
3032 )
@@ -43,10 +45,11 @@ val nonConsoleCompilerOptions = Seq(
4345 " -Ywarn-unused:imports" ,
4446 " -deprecation" ,
4547 " -release:8"
46- ) ++ {if (sys.env.get(" DISABLE_ASSERTIONS" ).isDefined)
47- Seq (" -Xdisable-assertions" )
48- else
49- Nil
48+ ) ++ {
49+ if (sys.env.get(" DISABLE_ASSERTIONS" ).isDefined)
50+ Seq (" -Xdisable-assertions" )
51+ else
52+ Nil
5053}
5154
5255val generateSchemas = taskKey[Unit ](" Generate example schemas" )
@@ -74,63 +77,64 @@ generateSchemas := {
7477 )
7578
7679 for (input <- inputs) {
77- r.run(" io.github.dataunitylab.jsonoid.discovery.DiscoverSchema" ,
78- data(cp),
79- Seq (
80- " src/test/resources/" + input,
81- " -p" ,
82- " Simple" ,
83- " -w" ,
84- schemaPath.resolve(input).toString
85- ),
86- (streams.value: @ sbtUnchecked).log)
80+ r.run(
81+ " io.github.dataunitylab.jsonoid.discovery.DiscoverSchema" ,
82+ data(cp),
83+ Seq (
84+ " src/test/resources/" + input,
85+ " -p" ,
86+ " Simple" ,
87+ " -w" ,
88+ schemaPath.resolve(input).toString
89+ ),
90+ (streams.value: @ sbtUnchecked).log
91+ )
8792 }
8893}
8994
9095lazy val root = (project in file(" ." ))
9196 .settings(
9297 name := " JSONoid Discovery" ,
93-
9498 libraryDependencies ++= Seq (
95- bloomFilter,
96- ddSketch,
97- json4s,
98- json4sScalaz,
99- dbscan,
100- fuzzySets,
101- hyperLogLog,
102- jsonSchemaValidator,
103- openLocationCode,
104- scopt,
105- scalaCsv,
106- validator,
107-
108- spark % " provided" ,
109- sparkSql % " provided" ,
110-
111- scalactic % Test ,
112- scalaTest % Test ,
113- scalaTestPlus % Test ,
114- scalaCheck % Test ,
99+ bloomFilter,
100+ ddSketch,
101+ json4s,
102+ json4sScalaz,
103+ dbscan,
104+ fuzzySets,
105+ hyperLogLog,
106+ jsonSchemaValidator,
107+ openLocationCode,
108+ scopt,
109+ scalaCsv,
110+ validator,
111+ spark % " provided" ,
112+ sparkSql % " provided" ,
113+ scalactic % Test ,
114+ scalaTest % Test ,
115+ scalaTestPlus % Test ,
116+ scalaCheck % Test
115117 ),
116118 dependencyOverrides ++= Seq (
117119 guava,
118120 jacksonDatabind,
119121 protobuf,
120- snappyJava,
122+ snappyJava
121123 ),
122124 javacOptions ++= Seq (" -source" , " 11" , " -target" , " 11" ),
123125 scalacOptions ++= nonConsoleCompilerOptions,
124126 buildInfoKeys := Seq [BuildInfoKey ](version),
125127 buildInfoPackage := " io.github.dataunitylab.jsonoid.discovery"
126128 )
127129
128- lazy val fuzz = (project in file(" fuzz" )).settings(
129- libraryDependencies ++= Seq (
130- jazzer,
131- json4s
132- )
133- ).dependsOn(root)
130+ lazy val fuzz = (project in file(" fuzz" ))
131+ .settings(
132+ libraryDependencies ++= Seq (
133+ jazzer,
134+ json4s
135+ )
136+ )
137+ .dependsOn(root)
134138
135139Compile / compile / wartremoverErrors ++= Seq (
136140 Wart .ArrayEquals ,
@@ -158,12 +162,11 @@ Compile / compile / wartremoverErrors ++= Seq(
158162 Wart .TripleQuestionMark ,
159163 Wart .TryPartial ,
160164 Wart .Var ,
161- Wart .While ,
165+ Wart .While
162166)
163167
164- Compile / console / scalacOptions := (console / scalacOptions)
165- .value.filterNot(opt =>
166- nonConsoleCompilerOptions.contains(opt)
168+ Compile / console / scalacOptions := (console / scalacOptions).value.filterNot(
169+ opt => nonConsoleCompilerOptions.contains(opt)
167170)
168171
169172enablePlugins(BuildInfoPlugin )
@@ -185,14 +188,14 @@ git.useGitDescribe := true
185188Test / fork := true
186189
187190assembly / assemblyMergeStrategy := {
188- case " module-info.class" => MergeStrategy .discard
191+ case " module-info.class" => MergeStrategy .discard
189192 case " META-INF/versions/9/module-info.class" => MergeStrategy .discard
190193 case x =>
191194 val oldStrategy = (assembly / assemblyMergeStrategy).value
192195 oldStrategy(x)
193196}
194197fuzz / assembly / assemblyMergeStrategy := (assembly / assemblyMergeStrategy).value
195- assembly / assemblyJarName := s " jsonoid-discovery- ${version.value}.jar "
198+ assembly / assemblyJarName := s " jsonoid-discovery- ${version.value}.jar "
196199fuzz / assembly / assemblyJarName := " fuzz.jar"
197200
198201import sbtassembly .AssemblyPlugin .defaultUniversalScript
@@ -203,7 +206,12 @@ run / connectInput := true
203206// See https://www.scala-sbt.org/1.x/docs/Using-Sonatype.html for instructions on how to publish to Sonatype.
204207
205208apiMappings ++= {
206- def mappingsFor (organization : String , names : List [String ], location : String , revision : (String ) => String = identity): Seq [(File , URL )] =
209+ def mappingsFor (
210+ organization : String ,
211+ names : List [String ],
212+ location : String ,
213+ revision : (String ) => String = identity
214+ ): Seq [(File , URL )] =
207215 for {
208216 entry : Attributed [File ] <- (Compile / fullClasspath).value
209217 module : ModuleID <- entry.get(moduleID.key)
@@ -212,7 +220,11 @@ apiMappings ++= {
212220 } yield entry.data -> url(location.format(revision(module.revision)))
213221
214222 val mappings : Seq [(File , URL )] =
215- mappingsFor(" org.scala-lang" , List (" scala-library" ), " http://scala-lang.org/api/%s/" )
223+ mappingsFor(
224+ " org.scala-lang" ,
225+ List (" scala-library" ),
226+ " http://scala-lang.org/api/%s/"
227+ )
216228
217229 mappings.toMap
218230}
0 commit comments