-
Notifications
You must be signed in to change notification settings - Fork 22
/
build.sbt
175 lines (153 loc) · 5.49 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
lazy val root = (project in file("."))
.settings(noPublishSettings)
.aggregate(coreJVM, coreJS)
.aggregate(scalacheckJVM, scalacheckJS)
.aggregate(testsJVM, testsJS)
.aggregate(examplesCatsJVM, examplesCatsJS)
.aggregate(examplesScalazJVM, examplesScalazJS)
.aggregate(bench)
.aggregate(corezJVM, corezJS)
.aggregate(scalacheckzJVM, scalacheckzJS)
.aggregate(testszJVM, testszJS)
.aggregate(readme, docs)
lazy val core = module("core", hideFolder = true)
.settings(macroSettings)
.settings(yax(file("modules/core/src/main/scala"), Compile,
flags = "cats" :: Nil,
yaxScala = true))
.crossDepSettings(
%%("cats-core", "1.6.1"),
%%("cats-free", "1.6.1"))
lazy val coreJVM = core.jvm
lazy val coreJS = core.js
lazy val corez = module("core", hideFolder = true, prefixSuffix = "z")
.settings(macroSettings)
.settings(yax(file("modules/core/src/main/scala"), Compile,
flags = "scalaz" :: Nil,
yaxScala = true))
.crossDepSettings(
"org.scalaz" %% "scalaz-core" % "7.2.28")
lazy val corezJVM = corez.jvm
lazy val corezJS = corez.js
lazy val scalacheck = module("scalacheck", hideFolder = true)
.dependsOn(core)
.settings(macroSettings)
.settings(yax(file("modules/scalacheck/src/main/scala"), Compile,
flags = "cats" :: Nil,
yaxScala = true))
.crossDepSettings(
%%("scalacheck"))
lazy val scalacheckJVM = scalacheck.jvm
lazy val scalacheckJS = scalacheck.js
lazy val scalacheckz = module("scalacheck", hideFolder = true, prefixSuffix = "z")
.dependsOn(corez)
.settings(macroSettings)
.settings(yax(file("modules/scalacheck/src/main/scala"), Compile,
flags = "scalaz" :: Nil,
yaxScala = true))
.crossDepSettings(
%%("scalacheck"))
lazy val scalacheckzJVM = scalacheckz.jvm
lazy val scalacheckzJS = scalacheckz.js
lazy val tests = module("tests", hideFolder = true)
.dependsOn(core)
.dependsOn(scalacheck)
.settings(noPublishSettings)
.settings(macroSettings)
.settings(yax(file("modules/tests/src/main/scala"), Compile,
flags = "cats" :: Nil,
yaxPlatform = true))
.settings(yax(file("modules/tests/src/test/scala"), Test,
flags = "cats" :: Nil,
yaxPlatform = true))
.crossDepSettings(
%%("scalacheck") % "test",
%%("shapeless") % "test",
%%("scheckShapeless") % "test")
lazy val testsJVM = tests.jvm
lazy val testsJS = tests.js
lazy val testsz = module("tests", hideFolder = true, prefixSuffix = "z")
.dependsOn(corez)
.dependsOn(scalacheckz)
.settings(noPublishSettings)
.settings(macroSettings)
.settings(yax(file("modules/tests/src/main/scala"), Compile,
flags = "scalaz" :: Nil,
yaxPlatform = true))
.settings(yax(file("modules/tests/src/test/scala"), Test,
flags = "scalaz" :: Nil,
yaxPlatform = true))
.crossDepSettings(
%%("scalacheck") % "test",
%%("shapeless") % "test",
%%("scheckShapeless") % "test")
lazy val testszJVM = testsz.jvm.settings(
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.8" % "test"
)
lazy val testszJS = testsz.js.settings(
libraryDependencies += "org.scalatest" %%% "scalatest" % "3.0.8" % "test"
)
lazy val examplesCats = module("examples-cats")
.dependsOn(core)
.settings(noPublishSettings)
.settings(macroSettings)
lazy val examplesCatsJVM = examplesCats.jvm
lazy val examplesCatsJS = examplesCats.js
lazy val examplesScalaz = module("examples-scalaz")
.dependsOn(corez)
.settings(noPublishSettings)
.settings(macroSettings)
.crossDepSettings(
"org.scalaz" %% "scalaz-effect" % "7.2.28")
lazy val examplesScalazJVM = examplesScalaz.jvm
lazy val examplesScalazJS = examplesScalaz.js
lazy val readme = jvmModule("readme")
.dependsOn(coreJVM)
.dependsOn(corezJVM)
.enablePlugins(TutPlugin)
.settings(noPublishSettings)
.settings(macroSettings)
.settings(
scalacOptions in Tut := Nil,
tutTargetDirectory := (baseDirectory in LocalRootProject).value)
lazy val docs = jvmModule("docs")
.dependsOn(coreJVM)
.dependsOn(corezJVM)
.enablePlugins(TutPlugin)
.settings(noPublishSettings)
.settings(macroSettings)
.settings(
scalacOptions in Tut := Nil,
tutTargetDirectory := (baseDirectory in LocalRootProject).value / "docs")
.settings(libraryDependencies +=
"org.scalaz" %% "scalaz-effect" % "7.2.28")
lazy val bench = jvmModule("bench")
.enablePlugins(JmhPlugin)
.dependsOn(coreJVM)
.configs(Codegen)
.settings(inConfig(Codegen)(Defaults.configSettings))
.settings(classpathConfiguration in Codegen := Compile)
.settings(noPublishSettings)
.settings(macroSettings)
.settings(libraryDependencies ++= Seq(
%%("scalacheck")))
.settings(inConfig(Compile)(
sourceGenerators += Def.task {
val path = (sourceManaged in(Compile, compile)).value / "bench.scala"
(runner in (Codegen, run)).value.run(
"iota.bench.BenchBoiler",
Attributed.data((fullClasspath in Codegen).value),
path.toString :: Nil,
streams.value.log)
path :: Nil
}
))
lazy val Codegen = config("codegen").hide
pgpPassphrase := Some(getEnvVar("PGP_PASSPHRASE").getOrElse("").toCharArray)
pgpPublicRing := file(s"$gpgFolder/pubring.asc")
pgpSecretRing := file(s"$gpgFolder/secring.asc")
lazy val macroSettings: Seq[Setting[_]] = Seq(
libraryDependencies ++= Seq(
scalaOrganization.value % "scala-compiler" % scalaVersion.value % Provided,
scalaOrganization.value % "scala-reflect" % scalaVersion.value % Provided,
compilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.patch)))