forked from scalaz/scalaz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
129 lines (112 loc) · 3.73 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
import build._
import com.typesafe.sbt.osgi.OsgiKeys
import org.scalajs.sbtplugin.cross._
import sbtunidoc.Plugin.UnidocKeys._
import sbtcrossproject.CrossPlugin.autoImport.crossProject
lazy val jsProjects = Seq[ProjectReference](
coreJS, effectJS, iterateeJS, scalacheckBindingJS, testsJS
)
lazy val jvmProjects = Seq[ProjectReference](
coreJVM, effectJVM, iterateeJVM, scalacheckBindingJVM, testsJVM, concurrent, example
)
lazy val nativeProjects = Seq[ProjectReference](
coreNative, effectNative, iterateeNative, nativeTest
)
lazy val scalaz = Project(
id = "scalaz",
base = file("."),
settings = standardSettings ++ unidocSettings ++ Seq[Sett](
artifacts := Classpaths.artifactDefs(Seq(packageDoc in Compile)).value,
packagedArtifacts := Classpaths.packaged(Seq(packageDoc in Compile)).value,
unidocProjectFilter in (ScalaUnidoc, unidoc) := {
(jsProjects ++ nativeProjects).foldLeft(inAnyProject)((acc, a) => acc -- inProjects(a))
}
) ++ Defaults.packageTaskSettings(packageDoc in Compile, (unidoc in Compile).map(_.flatMap(Path.allSubpaths))),
aggregate = jvmProjects ++ jsProjects
)
lazy val rootNative = Project(
rootNativeId,
file("rootNative")
).settings(
standardSettings,
notPublish
).aggregate(nativeProjects: _*)
lazy val rootJS = Project(
"rootJS",
file("rootJS")
).settings(
standardSettings,
notPublish
).aggregate(jsProjects: _*)
lazy val rootJVM = Project(
"rootJVM",
file("rootJVM")
).settings(
standardSettings,
notPublish
).aggregate(jvmProjects: _*)
lazy val coreJVM = core.jvm
lazy val coreJS = core.js
lazy val coreNative = core.native
lazy val concurrent = Project(
id = "concurrent",
base = file("concurrent"),
settings = standardSettings ++ Seq(
name := ConcurrentName,
typeClasses := TypeClass.concurrent,
osgiExport("scalaz.concurrent"),
OsgiKeys.importPackage := Seq("javax.swing;resolution:=optional", "*")
),
dependencies = Seq(coreJVM, effectJVM)
)
lazy val effectJVM = effect.jvm
lazy val effectJS = effect.js
lazy val effectNative = effect.native
lazy val iterateeJVM = iteratee.jvm
lazy val iterateeJS = iteratee.js
lazy val iterateeNative = iteratee.native
lazy val example = Project(
id = "example",
base = file("example"),
dependencies = Seq(coreJVM, iterateeJVM, concurrent),
settings = standardSettings ++ Seq[Sett](
name := "scalaz-example",
publishArtifact := false
)
)
lazy val scalacheckBinding =
crossProject(JVMPlatform, JSPlatform).crossType(ScalazCrossType)
.in(file("scalacheck-binding"))
.settings(standardSettings)
.settings(
name := "scalaz-scalacheck-binding",
libraryDependencies += "org.scalacheck" %%% "scalacheck" % scalaCheckVersion.value,
osgiExport("scalaz.scalacheck"))
.dependsOn(core, iteratee)
.jvmConfigure(_ dependsOn concurrent)
.jsSettings(scalajsProjectSettings)
lazy val scalacheckBindingJVM = scalacheckBinding.jvm
lazy val scalacheckBindingJS = scalacheckBinding.js
lazy val tests = crossProject(JSPlatform, JVMPlatform).crossType(ScalazCrossType)
.settings(standardSettings)
.settings(
name := "scalaz-tests",
publishArtifact := false,
libraryDependencies += "org.scalacheck" %%% "scalacheck" % scalaCheckVersion.value % "test")
.dependsOn(core, effect, iteratee, scalacheckBinding)
.jvmConfigure(_ dependsOn concurrent)
.jsSettings(scalajsProjectSettings)
.jsSettings(
jsEnv := NodeJSEnv().value
)
lazy val testsJVM = tests.jvm
lazy val testsJS = tests.js
// can't use "sbt test"
// https://github.com/scala-native/scala-native/issues/339
lazy val nativeTest = Project(nativeTestId, file("nativeTest")).enablePlugins(ScalaNativePlugin)
.settings(
standardSettings,
nativeSettings,
notPublish
)
.dependsOn(iterateeNative)