-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.sbt
101 lines (90 loc) · 2.77 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
import com.typesafe.sbt.pgp.PgpKeys
crossScalaVersions in ThisBuild := Seq("2.12.1", "2.11.8")
lazy val core = project
.settings(publishSettings)
.settings(coreSettings)
.settings(compileSettings)
lazy val test = project
.dependsOn(core)
.settings(coreSettings)
.settings(compileSettings)
.settings(noPublishSettings)
.settings(
libraryDependencies ++= Seq(
"com.lihaoyi" %% "utest" % "0.4.4" % "test",
"com.github.alexarchambault" %% "argonaut-shapeless_6.2" % "1.2.0-M4"
),
testFrameworks += new TestFramework("utest.runner.Framework")
)
lazy val doc = project
.dependsOn(core)
.settings(compileSettings)
.settings(noPublishSettings)
.settings(tutSettings)
.settings(
tutSourceDirectory := baseDirectory.value,
tutTargetDirectory := baseDirectory.value / ".."
).settings(
libraryDependencies += "com.github.alexarchambault" %% "argonaut-shapeless_6.2" % "1.2.0-M4"
)
val shapelessVersion = "2.3.2"
lazy val coreName = "elmtypes"
lazy val coreSettings = Seq(
organization := "org.reactormonk",
name := coreName,
libraryDependencies ++= Seq(
"com.chuusai" %% "shapeless" % shapelessVersion
)
)
lazy val compileSettings = Seq(
scalaVersion := "2.12.1",
resolvers ++= Seq(
Resolver.sonatypeRepo("releases")
),
libraryDependencies +=
compilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full)
)
lazy val publishSettings = Seq(
licenses := Seq(
"BSD-3-Clause" -> url("http://www.opensource.org/licenses/BSD-3-Clause")
),
scmInfo := Some(ScmInfo(
url("https://github.com/reactormonk/scala-elm-types.git"),
"scm:git:github.com/reactormonk/scala-elm-types.git",
Some("scm:git:[email protected]:reactormonk/scala-elm-types.git")
)),
homepage := Some(url("https://github.com/reactormonk/scala-elm-types")),
developers := List(Developer(
"reactormonk",
"Simon Hafner",
"",
url("https://github.com/reactormonk")
)),
publishMavenStyle := true,
pomIncludeRepository := { _ => false },
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
credentials ++= {
Seq("SONATYPE_USER", "SONATYPE_PASS").map(sys.env.get) match {
case Seq(Some(user), Some(pass)) =>
Seq(Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", user, pass))
case _ =>
Seq.empty
}
}
)
lazy val noPublishSettings = Seq(
publish := (),
publishLocal := (),
publishArtifact := false
)
// build.sbt shamelessly inspired by https://github.com/fthomas/refined/blob/master/build.sbt
addCommandAlias("validate", Seq(
"test",
"tut"
).mkString(";", ";", ""))