-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sbt
128 lines (118 loc) · 3.8 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
import sbt._
import Keys._
import sbtrelease._
import ReleaseStateTransformations._
import xerial.sbt.Sonatype._
import scoverage._
val analogwebV = "0.11.0"
val specs2V = "4.13.1"
val circeV = "0.14.1"
val json4sV = "4.0.1"
val coreDependencies =
Seq(
"org.analogweb" % "analogweb-core" % analogwebV,
"org.specs2" %% "specs2-core" % specs2V % "test" cross CrossVersion.for3Use2_13,
"org.specs2" %% "specs2-mock" % specs2V % "test" cross CrossVersion.for3Use2_13,
"org.specs2" %% "specs2-junit" % specs2V % "test" cross CrossVersion.for3Use2_13
)
lazy val baseSettings =
Seq(
organization := "org.analogweb",
crossScalaVersions := Seq("2.12.14", "2.13.6", "3.0.2"),
scalaVersion := crossScalaVersions.value.head,
startYear := Some(2014),
isSnapshot := version.value.trim.endsWith("SNAPSHOT"),
description := "Analogweb Framework is tiny, simple, and pluggable web framework.",
scalacOptions ++= Seq(
"-deprecation",
"-unchecked",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions"
),
scalacOptions in (Compile, console) ~= (_ filterNot (_ == "-Ywarn-unused-import")),
scalacOptions in (Compile, console) += "-Yrepl-class-based",
resolvers ++= Seq(
Resolver.sonatypeRepo("releases"),
Resolver.sonatypeRepo("snapshots")
),
fork in Test := true,
libraryDependencies ++= coreDependencies
)
lazy val publishSettings =
Seq(
licenses := Seq("MIT" -> url("http://opensource.org/licenses/MIT")),
homepage := Some(url("http://analogweb.github.io/")),
publishArtifact in Test := false,
publishMavenStyle := true,
publishTo := {
val nexus =
"https://oss.sonatype.org/"
if (version.value.trim
.endsWith("SNAPSHOT"))
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
scmInfo := Some(
ScmInfo(
url("https://github.com/analogweb/analogweb-scala"),
"scm:git:git@github.com:analogweb/analogweb-scala.git"
)),
developers := List(
Developer("y2k2mt", "y2k2mt", "y2.k2mt@gmail.com", url("https://github.com/y2k2mt"))
),
releasePublishArtifactsAction := PgpKeys.publishSigned.value
)
lazy val allSettings = baseSettings ++ publishSettings ++ ReleasePlugin.projectSettings ++ sonatypeSettings ++ ScoverageSbtPlugin.projectSettings
lazy val noPublish = Seq(
publish := {},
publishLocal := {},
publishArtifact := false
)
lazy val analogweb =
project
.in(file("."))
.settings(allSettings: _*)
.settings(noPublish: _*)
.settings(
moduleName := "analogweb",
libraryDependencies ++= coreDependencies ++ Seq(
"org.analogweb" % "analogweb-netty" % analogwebV
)
)
.settings(
initialCommands in console :=
"""
|import analogweb._
|import analogweb.circe._
""".stripMargin
)
.aggregate(core, json4s, circe)
.dependsOn(core, circe)
lazy val core = project
.settings(moduleName := "analogweb-scala")
.settings(allSettings)
lazy val json4s = project
.settings(moduleName := "analogweb-json4s")
.settings(allSettings)
.settings(
moduleName := "analogweb-json4s",
libraryDependencies ++= coreDependencies ++ Seq(
"org.json4s" %% "json4s-jackson" % json4sV cross CrossVersion.for3Use2_13
)
)
.dependsOn(core)
lazy val circe = project
.settings(moduleName := "analogweb-circe")
.settings(allSettings)
.settings(
moduleName := "analogweb-circe",
libraryDependencies ++= coreDependencies ++ Seq(
"io.circe" %% "circe-core" % circeV,
"io.circe" %% "circe-jawn" % circeV,
"io.circe" %% "circe-generic" % circeV
)
)
.dependsOn(core)