This repository was archived by the owner on Oct 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sbt
More file actions
111 lines (98 loc) · 3.54 KB
/
Copy pathbuild.sbt
File metadata and controls
111 lines (98 loc) · 3.54 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
lazy val scala212 = "2.12.13"
lazy val scala213 = "2.13.5"
lazy val supportedScalaVersions = List(scala212, scala213)
ThisBuild / organization := "net.reactivecore"
ThisBuild / version := "0.3.0"
ThisBuild / scalaVersion := scala212
ThisBuild / scalacOptions += "-feature"
ThisBuild / scalacOptions += "-deprecation"
val akkaVersion = "2.6.14"
val akkaHttpVersion = "10.2.4"
val scalaTestVersion = "3.0.9"
val circeVersion = "0.13.0"
val shapelessVersion = "2.3.4"
val macroParadiseVersion = "2.1.1"
// Releasing settings
ThisBuild / publishTo := sonatypePublishTo.value
// ThisBuild / publishMavenStyle := true
ThisBuild / licenses := Seq("APL2" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt"))
ThisBuild / homepage := Some(url("https://github.com/reactivecore/fhttp"))
ThisBuild / developers := List(
Developer(id="nob13", name="Norbert Schultz", email="norbert.schultz@reactivecore.de", url=url("https://www.reactivecore.de"))
)
usePgpKeyHex("77D0E9E04837F8CBBCD56429897A43978251C225")
import scalariform.formatter.preferences._
val scalariformSettings = {
scalariformPreferences := scalariformPreferences.value
.setPreference(AlignSingleLineCaseStatements, true)
.setPreference(DoubleIndentConstructorArguments, true)
.setPreference(DanglingCloseParenthesis, Preserve)
}
/** Returns yes if Scala version is < 2.13, no otherwise */
def priorTo213[T](scalaVersion: String)(yes: T*)(no: T*): Seq[T] = {
CrossVersion.partialVersion(scalaVersion) match {
case Some((2, minor)) if minor < 13 => yes
case _ => no
}
}
lazy val compilerDependentSettings: Seq[Setting[_]] = Seq(
libraryDependencies ++=
Seq(
scalaOrganization.value % "scala-compiler" % scalaVersion.value % Provided,
scalaOrganization.value % "scala-reflect" % scalaVersion.value % Provided
) ++ priorTo213(scalaVersion.value) (compilerPlugin(("org.scalamacros" % "paradise" % macroParadiseVersion).cross(CrossVersion.patch)))(),
scalacOptions ++= priorTo213(scalaVersion.value)(
"-Ypartial-unification"
)(
"-Ymacro-annotations"
)
)
lazy val core = (project in file("lib"))
.settings(
name := "fhttp-core",
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % scalaTestVersion % Test,
"com.chuusai" %% "shapeless" % shapelessVersion,
// For JSON
"io.circe" %% "circe-generic" % circeVersion,
"io.circe" %% "circe-parser" % circeVersion
),
scalariformSettings,
crossScalaVersions := supportedScalaVersions
)
lazy val akka = (project in file("akka"))
.dependsOn(core)
.settings(
name := "fhttp-akka",
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
"com.typesafe.akka" %% "akka-stream" % akkaVersion,
"com.typesafe.akka" %% "akka-http" % akkaHttpVersion,
"org.scalatest" %% "scalatest" % scalaTestVersion % Test
),
scalariformSettings,
crossScalaVersions := supportedScalaVersions
)
.settings(compilerDependentSettings)
lazy val example = (project in file("example"))
.dependsOn(core, akka)
.settings(
name := "fhttp-example",
scalariformSettings,
publish := {},
publishLocal := {},
publishArtifact := false,
crossScalaVersions := Nil
)
.settings(compilerDependentSettings)
lazy val root = (project in file("."))
.aggregate(core, akka, example)
.settings(
name := "fhttp-root",
publish := {},
publishLocal := {},
publishArtifact := false,
test := {},
crossScalaVersions := Nil
)
.settings(compilerDependentSettings)