forked from b-studios/scala-effekt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
149 lines (134 loc) · 4.66 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
import sbtcrossproject.CrossPlugin.autoImport.{ crossProject, CrossType }
lazy val commonSettings = Seq(
scalaVersion := "2.12.11",
version := "0.4-SNAPSHOT",
organization := "de.b-studios",
crossScalaVersions := Seq("2.11.12", "2.12.11", "2.13.1"),
scalacOptions ++= Seq(
"-deprecation",
"-encoding", "UTF-8",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-unchecked",
"-Xfatal-warnings",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Ywarn-value-discard"
),
scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, v)) if v <= 12 =>
Seq(
"-Xfuture",
"-Yno-adapted-args"
)
case _ =>
Nil
}
},
fork in test := true,
parallelExecution in Test := false
)
lazy val micrositeSettings = Seq(
micrositeName := "Scala Effekt",
micrositeDescription := "Extensible algebraic effects with handlers",
micrositeAuthor := "Jonathan Brachthäuser (@b-studios)",
micrositeBaseUrl := "/scala-effekt",
micrositeDocumentationUrl := "/scala-effekt/guides.html",
micrositeGithubOwner := "b-studios",
micrositeGithubRepo := "scala-effekt",
micrositeHighlightTheme := "atom-one-light",
micrositeOrganizationHomepage := "http://b-studios.de",
// micrositePushSiteWith := GitHub4s,
includeFilter in makeSite := "*.html" | "*.css" | "*.png" | "*.jpg" | "*.gif" | "*.js" | "*.swf" | "*.md",
micrositePalette := greenTheme,
micrositeCssDirectory := (resourceDirectory in Compile).value / "microsite" / "styles",
micrositeJsDirectory := (resourceDirectory in Compile).value / "microsite" / "js",
fork in tut := true,
git.remoteRepo := "[email protected]:b-studios/scala-effekt.git"
)
lazy val docs = (project in file("docs"))
.enablePlugins(MicrositesPlugin)
.settings(moduleName := "docs")
.settings(commonSettings)
.settings(micrositeSettings)
.settings(noPublishSettings)
.dependsOn(effektJVM)
lazy val effektSettings = commonSettings ++ publishSettings
lazy val root = project
.in(file("."))
.settings(moduleName := "root")
.settings(effektSettings)
.settings(noPublishSettings)
.aggregate(effektJVM, effektJS, effectsJVM, effectsJS)
.dependsOn(effektJVM, effektJS, effectsJVM, effectsJS)
lazy val effekt = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Full)
.in(file("."))
.settings(moduleName := "effekt", name := "effekt")
.settings(effektSettings:_*)
.jvmSettings(commonJvmSettings:_*)
.jsSettings(commonJsSettings:_*)
lazy val effektJVM = effekt.jvm
lazy val effektJS = effekt.js
lazy val commonJvmSettings = commonSettings
lazy val commonJsSettings = commonSettings ++ Seq(
scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.CommonJSModule) },
scalaJSStage in Global := FastOptStage
)
lazy val effects = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.in(file("effects"))
.settings(moduleName := "effekt-effects", name := "effect instances using Effekt")
.settings(effektSettings ++ effectsSettings:_*)
.jsSettings(commonJsSettings:_*)
.jvmSettings(commonJvmSettings:_*)
.dependsOn(effekt)
lazy val effectsJVM = effects.jvm
lazy val effectsJS = effects.js
lazy val effectsSettings = Seq(
libraryDependencies ++= Seq(
"org.typelevel" %% "cats-core" % "2.0.0"
)
)
lazy val greenTheme = Map(
"brand-primary" -> "#469E6B",
"brand-secondary" -> "#175341",
"brand-tertiary" -> "#103D33",
"gray-dark" -> "#394A4B",
"gray" -> "#4F5B5C",
"gray-light" -> "#CFE4E4",
"gray-lighter" -> "#F4F4F4",
"white-color" -> "#FFFFFF")
lazy val publishSettings = Seq(
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := (_ => false),
publishTo := {
if (version.value.trim endsWith "SNAPSHOT")
Some("Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/")
else
Some("Sonatype OSS Staging" at "https://oss.sonatype.org/service/local/staging/deploy/maven2/")
},
homepage := Some(url("http://b-studios.de/scala-effekt")),
licenses := Seq("MIT" -> url("http://opensource.org/licenses/MIT")),
scmInfo := Some(ScmInfo(url("https://github.com/b-studios/scala-effekt"), "scm:git:[email protected]:b-studios/scala-effekt.git")),
autoAPIMappings := true,
apiURL := Some(url("http://b-studios.de/scala-effekt")),
pomExtra := (
<developers>
<developer>
<id>b-studios</id>
<name>Jonathan Brachthäuser</name>
<url>https://github.com/b-studios/</url>
</developer>
</developers>
)
)
lazy val noPublishSettings = Seq(
publish := {},
publishLocal := {},
publishArtifact := false
)