-
Notifications
You must be signed in to change notification settings - Fork 15
/
build.sbt
154 lines (140 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
150
151
152
153
154
lazy val commonSettings = Seq(
scalaVersion := "2.12.20",
version := "0.4-SNAPSHOT",
organization := "de.b-studios",
crossScalaVersions := Seq("2.12.20", "2.13.15", "3.6.1"),
scalacOptions ++= Seq(
"-deprecation",
"-encoding", "UTF-8",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-unchecked",
),
scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, v)) if v <= 12 =>
Seq(
"-Xfuture",
"-Yno-adapted-args"
)
case _ =>
Nil
}
},
scalacOptions ++= {
if (scalaBinaryVersion.value == "3") {
Nil
} else {
Seq(
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Ywarn-value-discard"
)
}
},
run / fork := true,
test / fork := true,
Test / parallelExecution := 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,
makeSite / includeFilter := "*.html" | "*.css" | "*.png" | "*.jpg" | "*.gif" | "*.js" | "*.swf" | "*.md",
micrositePalette := greenTheme,
micrositeCssDirectory := (Compile / resourceDirectory).value / "microsite" / "styles",
micrositeJsDirectory := (Compile / resourceDirectory).value / "microsite" / "js",
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 = Def.settings()
lazy val commonJsSettings = Seq(
scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.CommonJSModule) },
Global / scalaJSStage := 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.12.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,
Test / publishArtifact := 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("https://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("https://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
)