-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sbt
128 lines (117 loc) · 3.42 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 sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType}
import ReleaseTransformations._
ThisBuild / crossScalaVersions := Seq("2.12.13", "2.13.6")
ThisBuild / scalaVersion := crossScalaVersions.value.last
ThisBuild / organization := "com.github.takayahilton"
ThisBuild / githubWorkflowBuildPreamble ++= List(
WorkflowStep.Sbt(List("checkFmt"), name = Some("Check formatting"))
)
ThisBuild / githubWorkflowPublishTargetBranches := List()
Global / onChangedBuildSource := IgnoreSourceChanges
lazy val root = project
.in(file("."))
.settings(moduleName := "root")
.settings(publishingSettings)
.settings(noPublishSettings)
.aggregate(eff_zioJVM, eff_zioJS)
.dependsOn(eff_zioJVM, eff_zioJS)
lazy val eff_zio = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Full)
.in(file("."))
.settings(moduleName := "eff-zio")
.settings(sharedSettings)
.settings(publishingSettings)
lazy val eff_zioJVM = eff_zio.jvm
lazy val eff_zioJS = eff_zio.js
lazy val commonScalacOptions = Def.setting {
Seq(
"-deprecation",
"-encoding",
"UTF-8",
"-feature",
"-language:_",
"-unchecked",
"-Xlint",
"-Xlint:-nullary-unit",
"-Ywarn-numeric-widen",
"-Ywarn-value-discard"
) ++ {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, v)) if v >= 13 =>
Seq(
"-Ymacro-annotations"
)
case _ =>
Seq(
"-Xfatal-warnings",
"-Yno-adapted-args",
"-Ypartial-unification",
"-Xfuture"
)
}
}
}
lazy val sharedSettings = Seq(
scalafmtOnCompile := true,
scalacOptions ++= commonScalacOptions.value,
(Test / scalacOptions) ~= (_.filterNot(_ == "-Xfatal-warnings")),
addCompilerPlugin("org.typelevel" % "kind-projector" % "0.13.0" cross CrossVersion.full),
libraryDependencies ++= Seq(
"dev.zio" %%% "zio" % "1.0.8",
"org.atnos" %%% "eff" % "5.16.0",
"org.scalatest" %%% "scalatest" % "3.2.9" % "test"
)
)
lazy val publishingSettings = Seq(
publishMavenStyle := true,
Test / publishArtifact := false,
pomIncludeRepository := { _ =>
false
},
publishTo := Some(
if (isSnapshot.value)
Opts.resolver.sonatypeSnapshots
else
Opts.resolver.sonatypeStaging
),
licenses := Seq("MIT" -> url("https://opensource.org/licenses/MIT")),
homepage := Some(url("https://github.com/takayahilton/eff-zio")),
scmInfo := Some(
ScmInfo(
url("https://github.com/takayahilton/eff-zio"),
"scm:[email protected]:takayahilton/eff-zio.git"
)
),
developers := List(
Developer(
id = "takayahilton",
name = "Takaya Tanaka",
email = "[email protected]",
url = url("https://github.com/takayahilton")
)
)
) ++ sharedReleaseProcess
lazy val sharedReleaseProcess = Seq(
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
releaseStepCommandAndRemaining("check"),
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
releaseStepCommandAndRemaining("+publishSigned"),
setNextVersion,
commitNextVersion,
releaseStepCommand("sonatypeReleaseAll"),
pushChanges
)
)
lazy val noPublishSettings = Seq(
publish := {},
publishLocal := {},
publishArtifact := false
)
addCommandAlias("checkFmt", ";scalafmtCheckAll;scalafmtSbtCheck")
addCommandAlias("fmt", ";scalafmtAll;scalafmtSbt")