forked from zio/zio-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
141 lines (126 loc) · 4.43 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
import BuildHelper._
inThisBuild(
List(
organization := "dev.zio",
homepage := Some(url("https://zio.github.io/zio-config/")),
licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
developers := List(
Developer(
"afsalthaj",
"Afsal Thaj",
"https://medium.com/@afsal.taj06",
url("https://github.com/afsalthaj")
),
Developer(
"jdegoes",
"John De Goes",
"john@degoes.net",
url("http://degoes.net")
)
),
pgpPassphrase := sys.env.get("PGP_PASSWORD").map(_.toArray),
pgpPublicRing := file("/tmp/public.asc"),
pgpSecretRing := file("/tmp/secret.asc"),
scmInfo := Some(
ScmInfo(url("https://github.com/zio/zio-config/"), "scm:git:git@github.com:zio/zio-config.git")
)
)
)
ThisBuild / publishTo := sonatypePublishToBundle.value
lazy val createProductBuilder = taskKey[Unit]("Generate code for ProductBuilder.scala")
createProductBuilder := {
val productBuilderFile = (sourceDirectory in zioConfig).value / "main" / "scala" / "zio" / "config" / "ProductBuilder.scala"
val resource = (resourceManaged in Compile).value / "scalaFmt" / "temporary"
val scalaFmt = baseDirectory.value / ".scalafmt.conf"
ProductBuilderCodeGen.replaceFileSection(
productBuilderFile,
"productbuilder",
ProductBuilderCodeGen.productBuilderCodes :+ "",
resource,
scalaFmt
)
}
addCommandAlias("fmt", "all scalafmtSbt scalafmt test:scalafmt")
addCommandAlias("check", "all scalafmtSbtCheck scalafmtCheck test:scalafmtCheck")
lazy val zioVersion = "1.0.0-RC17"
lazy val magnoliaVersion = "0.12.2"
lazy val refinedVersion = "0.9.12"
lazy val root =
project
.in(file("."))
.settings(skip in publish := true)
.aggregate(zioConfig, zioConfigMagnolia, examples, zioConfigRefined, zioConfigTypesafe)
lazy val zioConfig =
module("zio-config", "core")
.enablePlugins(BuildInfoPlugin)
.settings(buildInfoSettings)
.settings(
libraryDependencies ++= Seq(
"dev.zio" %% "zio-test" % zioVersion % Test,
"dev.zio" %% "zio-test-sbt" % zioVersion % Test
),
testFrameworks := Seq(new TestFramework("zio.test.sbt.ZTestFramework"))
)
lazy val zioConfigRefined =
module("zio-config-refined", "refined")
.settings(
libraryDependencies ++=
Seq(
"eu.timepit" %% "refined" % refinedVersion,
"dev.zio" %% "zio-test" % zioVersion % Test,
"dev.zio" %% "zio-test-sbt" % zioVersion % Test
),
testFrameworks := Seq(new TestFramework("zio.test.sbt.ZTestFramework"))
)
.dependsOn(zioConfig % "compile->compile;test->test")
lazy val examples = module("zio-config-examples", "examples")
.settings(
skip in publish := true,
fork := true,
libraryDependencies ++= Seq(
"eu.timepit" %% "refined" % refinedVersion,
"com.propensive" %% "magnolia" % magnoliaVersion
)
)
.dependsOn(zioConfig, zioConfigMagnolia, zioConfigRefined, zioConfigTypesafe)
lazy val zioConfigMagnolia = module("zio-config-magnolia", "magnolia")
.settings(
libraryDependencies ++= Seq(
"com.propensive" %% "magnolia" % magnoliaVersion,
"dev.zio" %% "zio-test" % zioVersion % Test,
"dev.zio" %% "zio-test-sbt" % zioVersion % Test
),
testFrameworks := Seq(new TestFramework("zio.test.sbt.ZTestFramework"))
)
.dependsOn(zioConfig % "compile->compile;test->test")
lazy val zioConfigTypesafe =
module("zio-config-typesafe", "typesafe")
.settings(
libraryDependencies ++= Seq(
"com.typesafe" % "config" % "1.4.0"
)
)
.dependsOn(zioConfig)
def module(moduleName: String, fileName: String): Project =
Project(moduleName, file(fileName))
.settings(stdSettings(moduleName))
.settings(
libraryDependencies ++= Seq(
"dev.zio" %% "zio" % zioVersion
)
)
lazy val docs = project
.in(file("zio-config-docs"))
.settings(
skip in publish := true,
moduleName := "zio-config-docs",
scalacOptions -= "-Yno-imports",
scalacOptions -= "-Xfatal-warnings",
libraryDependencies ++= Seq(
"eu.timepit" %% "refined" % refinedVersion,
"dev.zio" %% "zio" % zioVersion,
"com.propensive" %% "magnolia" % magnoliaVersion
)
)
.dependsOn(zioConfig, zioConfigMagnolia, zioConfigTypesafe, zioConfigRefined)
.enablePlugins(MdocPlugin, DocusaurusPlugin)