forked from raquo/Airstream
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
143 lines (122 loc) · 3.97 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
enablePlugins(ScalaJSPlugin)
enablePlugins(ScalaJSBundlerPlugin)
libraryDependencies ++= Seq(
("org.scala-js" %%% "scalajs-dom" % Versions.ScalaJsDom).cross(CrossVersion.for3Use2_13),
"app.tulz" %%% "tuplez-full-light" % Versions.Tuplez,
"org.scalatest" %%% "scalatest" % Versions.ScalaTest % Test
)
scalaVersion := Versions.Scala_2_13
crossScalaVersions := Seq(Versions.Scala_2_12, Versions.Scala_2_13, Versions.Scala_3)
scalacOptions ~= { options: Seq[String] =>
options.filterNot(Set(
"-Ywarn-value-discard",
"-Wvalue-discard"
))
}
scalacOptions += {
val localSourcesPath = baseDirectory.value.toURI
val remoteSourcesPath = s"https://raw.githubusercontent.com/raquo/Airstream/${git.gitHeadCommit.value.get}/"
val sourcesOptionName = if (scalaVersion.value.startsWith("2.")) "-P:scalajs:mapSourceURI" else "-scalajs-mapSourceURI"
s"${sourcesOptionName}:$localSourcesPath->$remoteSourcesPath"
}
(Test / scalacOptions) ~= { options: Seq[String] =>
options.filterNot { o =>
o.startsWith("-Ywarn-unused") || o.startsWith("-Wunused")
}
}
(Compile / doc / scalacOptions) ~= (_.filterNot(
Set(
"-scalajs",
"-deprecation",
"-explain-types",
"-explain",
"-feature",
"-language:existentials,experimental.macros,higherKinds,implicitConversions",
"-unchecked",
"-Xfatal-warnings",
"-Ykind-projector",
"-from-tasty",
"-encoding",
"utf8",
)
))
(Compile / doc / scalacOptions) ++= Seq(
"-no-link-warnings" // Suppress scaladoc "Could not find any member to link for" warnings
)
(installJsdom / version) := Versions.JsDom
useYarn := true
(Test / requireJsDomEnv) := true
(Test / parallelExecution) := false
scalaJSUseMainModuleInitializer := true
(Compile / fastOptJS / scalaJSLinkerConfig) ~= { _.withSourceMap(false) }
// -- Code generators for N-arity functionality
val generateTupleCombinatorsFrom = 2
val generateTupleCombinatorsTo = 9
Compile / sourceGenerators += Def.task {
Seq.concat(
GenerateCombineEventStreams(
(Compile / sourceDirectory).value,
from = generateTupleCombinatorsFrom,
to = generateTupleCombinatorsTo
).run,
GenerateCombineSignals(
(Compile / sourceDirectory).value,
from = generateTupleCombinatorsFrom,
to = generateTupleCombinatorsTo
).run,
GenerateSampleCombineEventStreams(
(Compile / sourceDirectory).value,
from = generateTupleCombinatorsFrom,
to = generateTupleCombinatorsTo
).run,
GenerateSampleCombineSignals(
(Compile / sourceDirectory).value,
from = generateTupleCombinatorsFrom,
to = generateTupleCombinatorsTo
).run,
GenerateTupleEventStreams(
(Compile / sourceDirectory).value,
from = generateTupleCombinatorsFrom,
to = generateTupleCombinatorsTo
).run,
GenerateTupleSignals(
(Compile / sourceDirectory).value,
from = generateTupleCombinatorsFrom,
to = generateTupleCombinatorsTo
).run,
GenerateCombinableEventStream(
(Compile / sourceDirectory).value,
from = generateTupleCombinatorsFrom,
to = generateTupleCombinatorsTo
).run,
GenerateCombinableSignal(
(Compile / sourceDirectory).value,
from = generateTupleCombinatorsFrom,
to = generateTupleCombinatorsTo
).run,
GenerateStaticEventStreamCombineOps(
(Compile / sourceDirectory).value,
from = generateTupleCombinatorsFrom,
to = generateTupleCombinatorsTo
).run,
GenerateStaticSignalCombineOps(
(Compile / sourceDirectory).value,
from = generateTupleCombinatorsFrom,
to = generateTupleCombinatorsTo
).run
)
}.taskValue
Test / sourceGenerators += Def.task {
Seq.concat(
GenerateCombineSignalsTest(
(Test / sourceDirectory).value,
from = generateTupleCombinatorsFrom,
to = generateTupleCombinatorsTo
).run,
GenerateCombineEventStreamsTest(
(Test / sourceDirectory).value,
from = generateTupleCombinatorsFrom,
to = generateTupleCombinatorsTo
).run
)
}.taskValue