@@ -2,10 +2,10 @@ import Dependencies._
2
2
import com .typesafe .sbt .packager .docker ._
3
3
import xerial .sbt .Sonatype ._
4
4
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"
9
9
10
10
inThisBuild(
11
11
List (
@@ -20,11 +20,13 @@ inThisBuild(
20
20
url(" https://michael.mior.ca" )
21
21
)
22
22
),
23
- sonatypeProjectHosting := Some (GitHubHosting (
24
- " dataunitylab" ,
25
- " jsonoid-discovery" ,
26
-
27
- )),
23
+ sonatypeProjectHosting := Some (
24
+ GitHubHosting (
25
+ " dataunitylab" ,
26
+ " jsonoid-discovery" ,
27
+
28
+ )
29
+ ),
28
30
semanticdbEnabled := true ,
29
31
semanticdbVersion := scalafixSemanticdb.revision
30
32
)
@@ -43,10 +45,11 @@ val nonConsoleCompilerOptions = Seq(
43
45
" -Ywarn-unused:imports" ,
44
46
" -deprecation" ,
45
47
" -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
50
53
}
51
54
52
55
val generateSchemas = taskKey[Unit ](" Generate example schemas" )
@@ -74,63 +77,64 @@ generateSchemas := {
74
77
)
75
78
76
79
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
+ )
87
92
}
88
93
}
89
94
90
95
lazy val root = (project in file(" ." ))
91
96
.settings(
92
97
name := " JSONoid Discovery" ,
93
-
94
98
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
115
117
),
116
118
dependencyOverrides ++= Seq (
117
119
guava,
118
120
jacksonDatabind,
119
121
protobuf,
120
- snappyJava,
122
+ snappyJava
121
123
),
122
124
javacOptions ++= Seq (" -source" , " 11" , " -target" , " 11" ),
123
125
scalacOptions ++= nonConsoleCompilerOptions,
124
126
buildInfoKeys := Seq [BuildInfoKey ](version),
125
127
buildInfoPackage := " io.github.dataunitylab.jsonoid.discovery"
126
128
)
127
129
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)
134
138
135
139
Compile / compile / wartremoverErrors ++= Seq (
136
140
Wart .ArrayEquals ,
@@ -158,12 +162,11 @@ Compile / compile / wartremoverErrors ++= Seq(
158
162
Wart .TripleQuestionMark ,
159
163
Wart .TryPartial ,
160
164
Wart .Var ,
161
- Wart .While ,
165
+ Wart .While
162
166
)
163
167
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)
167
170
)
168
171
169
172
enablePlugins(BuildInfoPlugin )
@@ -185,14 +188,14 @@ git.useGitDescribe := true
185
188
Test / fork := true
186
189
187
190
assembly / assemblyMergeStrategy := {
188
- case " module-info.class" => MergeStrategy .discard
191
+ case " module-info.class" => MergeStrategy .discard
189
192
case " META-INF/versions/9/module-info.class" => MergeStrategy .discard
190
193
case x =>
191
194
val oldStrategy = (assembly / assemblyMergeStrategy).value
192
195
oldStrategy(x)
193
196
}
194
197
fuzz / assembly / assemblyMergeStrategy := (assembly / assemblyMergeStrategy).value
195
- assembly / assemblyJarName := s " jsonoid-discovery- ${version.value}.jar "
198
+ assembly / assemblyJarName := s " jsonoid-discovery- ${version.value}.jar "
196
199
fuzz / assembly / assemblyJarName := " fuzz.jar"
197
200
198
201
import sbtassembly .AssemblyPlugin .defaultUniversalScript
@@ -203,7 +206,12 @@ run / connectInput := true
203
206
// See https://www.scala-sbt.org/1.x/docs/Using-Sonatype.html for instructions on how to publish to Sonatype.
204
207
205
208
apiMappings ++= {
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 )] =
207
215
for {
208
216
entry : Attributed [File ] <- (Compile / fullClasspath).value
209
217
module : ModuleID <- entry.get(moduleID.key)
@@ -212,7 +220,11 @@ apiMappings ++= {
212
220
} yield entry.data -> url(location.format(revision(module.revision)))
213
221
214
222
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
+ )
216
228
217
229
mappings.toMap
218
230
}
0 commit comments