forked from zengularity/benji
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sbt
More file actions
207 lines (181 loc) · 7.48 KB
/
build.sbt
File metadata and controls
207 lines (181 loc) · 7.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
ThisBuild / organization := "com.zengularity"
ThisBuild / scalaVersion := "2.12.15"
ThisBuild / crossScalaVersions := Seq(
"2.11.12", scalaVersion.value, "2.13.6")
inThisBuild(
List(
//scalaVersion := "2.13.3",
semanticdbEnabled := true,
semanticdbVersion := scalafixSemanticdb.revision,
scalafixDependencies ++= Seq(
"com.github.liancheng" %% "organize-imports" % "0.5.0")
)
)
lazy val core = project.in(file("core")).settings(
name := "benji-core",
Compile / compile / scalacOptions ++= Seq(
// Silencer
"-P:silencer:globalFilters=constructor\\ deprecatedName\\ in\\ class\\ deprecatedName\\ is\\ deprecated",
"-language:higherKinds"
),
mimaBinaryIssueFilters ++= {
import com.typesafe.tools.mima.core._, ProblemFilters.{ exclude => x }
Seq(
x[ReversedMissingMethodProblem]("com.zengularity.benji.BucketRef#ListRequest.withPrefix"),
x[ReversedMissingMethodProblem]("com.zengularity.benji.BucketVersioning#VersionedListRequest.withPrefix"))
},
libraryDependencies ++= Dependencies.wsStream.value ++ Seq(
"commons-codec" % "commons-codec" % "1.15",
Dependencies.slf4jApi % Provided
)
)
val scalaXmlVer = Def.setting[String] {
val sv = scalaBinaryVersion.value
if (sv == "2.13") "1.3.0"
else "1.0.6"
}
import Dependencies.Version.{ play => playVer, playJson => playJsonVer }
lazy val playTest = Def.setting {
("com.typesafe.play" %% "play-test" % playVer.value % Test).
exclude("com.typesafe.akka", "*")
}
lazy val s3 = project.in(file("s3")).settings(
name := "benji-s3",
libraryDependencies ++= Seq(
Dependencies.playWSXml,
Dependencies.playAhcWS,
"org.scala-lang.modules" %% "scala-xml" % scalaXmlVer.value % Provided),
mimaBinaryIssueFilters ++= {
import com.typesafe.tools.mima.core._, ProblemFilters.{ exclude => x }
val pkg = "com.zengularity.benji.s3"
val wasPrivate = Seq(
x[MissingClassProblem](s"${pkg}.SignatureCalculator"),
x[IncompatibleMethTypeProblem](s"${pkg}.VirtualHostWSRequestBuilder.this"),
x[IncompatibleMethTypeProblem](s"${pkg}.PathStyleWSRequestBuilder.this"),
x[IncompatibleMethTypeProblem](s"${pkg}.WSRequestBuilder.build"),
x[MissingTypesProblem](s"${pkg}.WSS3BucketRef$$ObjectVersions$$"),
x[IncompatibleResultTypeProblem](s"${pkg}.WSS3BucketRef#ObjectVersions.<init>$$default$$2"),
x[DirectMissingMethodProblem](s"${pkg}.WSS3BucketRef#ObjectVersions.apply"),
x[IncompatibleResultTypeProblem](s"${pkg}.WSS3BucketRef#ObjectVersions.apply$$default$$2"),
x[DirectMissingMethodProblem](s"${pkg}.WSS3BucketRef#Objects.copy"),
x[DirectMissingMethodProblem](s"${pkg}.WSS3BucketRef#Objects.this"),
x[IncompatibleResultTypeProblem](s"${pkg}.WSS3BucketRef#ObjectVersions.copy$$default$$2"),
x[DirectMissingMethodProblem](s"${pkg}.WSS3BucketRef#ObjectVersions.copy"),
x[DirectMissingMethodProblem](s"${pkg}.WSS3BucketRef#ObjectVersions.this"),
x[MissingTypesProblem](s"${pkg}.WSS3BucketRef$$Objects$$"),
x[DirectMissingMethodProblem](s"${pkg}.WSS3BucketRef#Objects.apply"),
x[IncompatibleSignatureProblem]("com.zengularity.benji.s3.WSS3BucketRef#ObjectVersions.unapply"),
x[IncompatibleSignatureProblem]("com.zengularity.benji.s3.WSS3BucketRef#ObjectVersions.apply$default$1"),
x[IncompatibleSignatureProblem]("com.zengularity.benji.s3.WSS3BucketRef#ObjectVersions.<init>$default$1"),
x[IncompatibleSignatureProblem]("com.zengularity.benji.s3.WSS3BucketRef#Objects.copy$default$1"),
x[IncompatibleSignatureProblem]("com.zengularity.benji.s3.WSS3BucketRef#ObjectVersions.copy$default$1"),
x[IncompatibleSignatureProblem]("com.zengularity.benji.s3.WSS3BucketRef#Objects.unapply")
)
wasPrivate
}
).dependsOn(core % "test->test;compile->compile")
lazy val google = project.in(file("google")).settings(
name := "benji-google",
mimaPreviousArtifacts := {
if (scalaBinaryVersion.value == "2.12") {
Set(organization.value %% moduleName.value % "2.1.0")
} else {
Set.empty[ModuleID]
}
},
libraryDependencies ++= Seq(
Dependencies.playWSJson,
Dependencies.playAhcWS,
"com.google.auth" % "google-auth-library-oauth2-http" % "1.2.1",
"com.google.apis" % "google-api-services-storage" % "v1-rev20210127-1.31.0"
)
).dependsOn(core % "test->test;compile->compile")
lazy val vfs = project.in(file("vfs")).settings(
name := "benji-vfs",
mimaBinaryIssueFilters ++= {
import com.typesafe.tools.mima.core._, ProblemFilters.{ exclude => x }
val pkg = "com.zengularity.benji.vfs"
val wasPrivate = Seq(
x[DirectMissingMethodProblem](s"$pkg.BenjiFileSelector.this"),
x[DirectMissingMethodProblem](s"$pkg.VFSBucketRef.objects")
)
wasPrivate ++ Seq(
x[MissingClassProblem]("com.zengularity.benji.vfs.VFSBucketRef$objects$"))
},
libraryDependencies ++= Seq(
"org.apache.commons" % "commons-vfs2" % "2.9.0",
"com.typesafe.play" %% "play-json" % playJsonVer.value,
Dependencies.slf4jApi,
"commons-io" % "commons-io" % "2.7" % Test)
).dependsOn(core % "test->test;compile->compile")
lazy val play = project.in(file("play")).settings(
name := "benji-play",
version := {
val ver = (ThisBuild / version).value
val playMajor = playVer.value.split("\\.").take(2).mkString
if (ver endsWith "-SNAPSHOT") {
s"${ver.dropRight(9)}-play${playMajor}-SNAPSHOT"
} else {
s"${ver}-play${playMajor}"
}
},
mimaPreviousArtifacts := {
val playMajor = playVer.value.split("\\.").take(2).mkString
if (scalaBinaryVersion.value == "2.12") {
Set(organization.value %% moduleName.value % s"2.0.5-play${playMajor}")
} else {
Set.empty[ModuleID]
}
},
libraryDependencies ++= {
val playAhcWS = {
if (scalaBinaryVersion.value startsWith "2.13") {
Seq(
Dependencies.playAhcWS.
exclude("org.scala-lang.modules", "scala-java8-compat_2.13"),
"org.scala-lang.modules" %% "scala-java8-compat" % "0.9.1")
} else {
Seq(Dependencies.playAhcWS)
}
}
playAhcWS ++ Seq(
"com.typesafe.play" %% "play" % playVer.value % Provided,
playTest.value)
},
Test / unmanagedSourceDirectories += {
val v = playVer.value.split("\\.").take(2).mkString(".")
baseDirectory.value / "src" / "test" / s"play-$v"
},
Compile / doc / sources := {
val compiled = (Compile / sources).value
compiled.filter { _.getName endsWith "NamedStorage.java" }
}
).dependsOn(core % "test->test;compile->compile", vfs % "test->compile")
mimaPreviousArtifacts := Set.empty
lazy val benji = (project in file(".")).
enablePlugins(ScalaUnidocPlugin).
settings(Seq(
libraryDependencies += Dependencies.playAhcWS,
pomPostProcess := Common.transformPomDependencies { depSpec =>
// Filter in POM the dependencies only required to compile sample in doc
if ((depSpec \ "artifactId").text startsWith "benji-") {
Some(depSpec)
} else {
Option.empty
}
},
doc / excludeFilter := "play",
Compile / doc / scalacOptions ++= List(
"-skip-packages", "highlightextractor"),
ScalaUnidoc / unidoc / unidocAllSources ~= {
_.map(_.filterNot { f =>
val name = f.getName
name.startsWith("NamedStorage") ||
name.indexOf("-md-") != -1 ||
(name.startsWith("package") &&
f.getPath.indexOf("src_managed") != -1)
})
}
) ++ Publish.settings).
dependsOn(s3, google, vfs, play).
aggregate(core, s3, google, vfs, play)