-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.sbt
177 lines (160 loc) · 4.5 KB
/
build.sbt
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
val _version = "0.10.2-SNAPSHOT"
val _json4sVersion = "3.6.12"
val _playVersion = play.core.PlayVersion.current
val _scalatestVersion = "3.2.17"
val json4sCore = "org.json4s" %% "json4s-core" % _json4sVersion
val json4sNative = "org.json4s" %% "json4s-native" % _json4sVersion
val json4sJackson = "org.json4s" %% "json4s-jackson" % _json4sVersion
val scalatest = "org.scalatest" %% "scalatest" % _scalatestVersion
val playApi = "com.typesafe.play" %% "play" % _playVersion
val playTest = "com.typesafe.play" %% "play-test" % _playVersion
val playDependencies = Seq(playApi % Provided, playTest % Test)
val publishingSettings = Seq(
publishMavenStyle := true,
Test / publishArtifact := false,
pomExtra := _pomExtra
)
val nonPublishSettings = Seq(
publishArtifact := false,
publish := {},
publishLocal := {},
Test / parallelExecution := false
)
val baseSettings = Seq(
organization := "com.github.tototoshi",
version := _version,
scalaVersion := "2.12.19",
crossScalaVersions := Seq(scalaVersion.value, "2.13.14"),
scalacOptions ++= Seq("-feature", "-deprecation"),
resolvers += "typesafe" at "https://repo.typesafe.com/typesafe/releases",
publishTo := _publishTo(version.value),
)
lazy val api = project
.in(file("api"))
.settings(baseSettings)
.settings(publishingSettings)
.settings(
name := "play-json4s-api",
libraryDependencies ++= playDependencies ++ Seq(
json4sCore
)
)
lazy val core = project
.in(file("core"))
.settings(baseSettings)
.settings(publishingSettings)
.settings(
name := "play-json4s-core",
libraryDependencies ++= playDependencies ++ Seq(
json4sCore,
scalatest % Test
)
)
.dependsOn(api)
lazy val testCore = project
.in(file("test-core"))
.settings(baseSettings)
.settings(publishingSettings)
.settings(
name := "play-json4s-test-core",
libraryDependencies ++= Seq(
playApi % Provided,
playTest % Provided,
json4sCore
)
)
.dependsOn(core)
lazy val testNative = project
.in(file("test-native"))
.settings(baseSettings)
.settings(publishingSettings)
.settings(
name := "play-json4s-test-native",
libraryDependencies ++= Seq(
playApi % Provided,
playTest % Provided,
json4sNative
)
)
.dependsOn(core, testCore)
lazy val testJackson = project
.in(file("test-jackson"))
.settings(baseSettings)
.settings(publishingSettings)
.settings(
name := "play-json4s-test-jackson",
libraryDependencies ++= Seq(
playApi % Provided,
playTest % Provided,
json4sJackson
)
)
.dependsOn(core, testCore)
lazy val native = project
.in(file("native"))
.settings(baseSettings)
.settings(publishingSettings)
.settings(
name := "play-json4s-native",
libraryDependencies ++= playDependencies ++ Seq(
json4sNative,
scalatest % Test
)
)
.dependsOn(core % "test->test;compile->compile", api, testNative % Test)
lazy val jackson = project
.in(file("jackson"))
.settings(baseSettings)
.settings(publishingSettings)
.settings(
name := "play-json4s-jackson",
libraryDependencies ++= playDependencies ++ Seq(
json4sJackson,
scalatest % Test
)
)
.dependsOn(core % "test->test;compile->compile", testJackson % Test)
lazy val example = project
.in(file("example"))
.enablePlugins(PlayScala)
.settings(baseSettings)
.settings(nonPublishSettings)
.settings(
libraryDependencies ++= Seq(
guice
)
)
.dependsOn(jackson)
lazy val playJson4s = project
.in(file("."))
.settings(baseSettings)
.settings(nonPublishSettings)
.settings(
name := "json4s"
)
.aggregate(api, native, jackson, core, testCore, testNative, testJackson, example)
def _publishTo(v: String) = {
val nexus = "https://oss.sonatype.org/"
if (v.trim.endsWith("SNAPSHOT")) Some("snapshots" at nexus + "content/repositories/snapshots")
else Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
val _pomExtra =
<url>https://github.com/tototoshi/play-json4s</url>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0.html</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>[email protected]:tototoshi/play-json4s.git</url>
<connection>scm:git:[email protected]:tototoshi/play-json4s.git</connection>
</scm>
<developers>
<developer>
<id>tototoshi</id>
<name>Toshiyuki Takahashi</name>
<url>https://tototoshi.github.io</url>
</developer>
</developers>