forked from DFiantHDL/DFHDL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
334 lines (295 loc) · 11 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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
val projectName = "dfiant"
inThisBuild(List(
homepage := Some(url("https://dfianthdl.github.io/")),
licenses := List("LGPL" -> url("https://www.gnu.org/licenses/lgpl-3.0.txt")),
developers := List(
Developer(
"soronpo",
"Oron Port",
"",
url("https://www.researchgate.net/profile/Oron_Port")
)
)))
name := projectName
ThisBuild / organization := "io.github.dfianthdl"
ThisBuild / scalaVersion := "2.13.5"
//ThisBuild / resolvers += "pr" at "https://scala-ci.typesafe.com/artifactory/scala-pr-validation-snapshots/"
ThisBuild / resolvers += "scala-integration" at
"https://scala-ci.typesafe.com/artifactory/scala-integration/"
//resolvers in ThisBuild += "Oscar Snapshots" at "http://artifactory.info.ucl.ac.be/artifactory/libs-snapshot/"
//version in ThisBuild := "0.0.20-SNAPSHOT"
//enablePlugins(ScalaJSPlugin)
// PROJECTS
lazy val root = project
.in(file("."))
.settings(settings)
.aggregate(
continuum,
internals,
core,
lib
)
//////////////////////////////////////////////////////////////////////////////////////
// Temporary replacements for libraries until all changes are merged into the masters
// * continuum
//////////////////////////////////////////////////////////////////////////////////////
lazy val continuum = (project in file("modLibs/continuum"))
.settings(
name := "continuum",
settings,
assemblySettings,
Compile / unmanagedSourceDirectories ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, v)) if v >= 13 =>
Seq(baseDirectory.value / "src" / "main" / "scala_2.13+")
case _ =>
Seq(baseDirectory.value / "src" / "main" / "scala_2.12-")
}},
Test / unmanagedSourceDirectories ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, v)) if v >= 13 =>
Seq(baseDirectory.value / "src" / "test" / "scala_2.13+")
case _ =>
Seq(baseDirectory.value / "src" / "test" / "scala_2.12-")
}},
)
//////////////////////////////////////////////////////////////////////////////////////
lazy val internals = project
.settings(
name := s"$projectName-internals",
settings,
macroSettings,
assemblySettings,
libraryDependencies ++= commonDependencies
)
.dependsOn(
continuum
)
lazy val core = project
.settings(
name := s"$projectName-core",
settings,
macroSettings,
assemblySettings,
libraryDependencies ++= commonDependencies
)
.dependsOn(
internals
)
lazy val lib = project
.settings(
name := projectName,
settings,
macroSettings,
assemblySettings,
libraryDependencies ++= commonDependencies
)
.dependsOn(
core % "test->test;compile->compile"
)
//////////////////////////////////////////////////////////////////////////////////////
// Examples
//////////////////////////////////////////////////////////////////////////////////////
lazy val `first-look` = (project in file("examples/first-look"))
.settings(
name := "first-look",
publish / skip := true,
settings,
assemblySettings,
libraryDependencies ++= commonDependencies
)
.dependsOn(
core,
lib
)
lazy val examples = project
.settings(
publish / skip := true,
settings
)
.aggregate(
`first-look`
)
//////////////////////////////////////////////////////////////////////////////////////
// DEPENDENCIES
lazy val dependencies =
new {
private val logbackV = "1.2.3"
private val logstashV = "4.11"
private val scalaLoggingV = "3.7.2"
private val typesafeConfigV = "1.3.1"
private val pureconfigV = "0.8.0"
private val akkaV = "2.6.14"
private val singletonOpsV = "0.5.2"
private val shapelessV = "2.3.4"
private val scodecV = "1.1.12"
private val oslibV = "0.7.4"
private val continuumV = "0.4-SNAPSHOT"
private val macroParadiseV = "2.1.1"
private val macroCompatV = "1.1.1"
private val ammoniteV = "2.3.8"
private val oscarV = "4.1.0-SNAPSHOT"
private val munitV = "0.7.22"
val logback = "ch.qos.logback" % "logback-classic" % logbackV
val logstash = "net.logstash.logback" % "logstash-logback-encoder" % logstashV
val scalaLogging = "com.typesafe.scala-logging" %% "scala-logging" % scalaLoggingV
val typesafeConfig = "com.typesafe" % "config" % typesafeConfigV
val akka = "com.typesafe.akka" %% "akka-stream" % akkaV
val pureconfig = "com.github.pureconfig" %% "pureconfig" % pureconfigV
val singletonOps = "eu.timepit" %% "singleton-ops" % singletonOpsV
val shapeless = "com.chuusai" %% "shapeless" % shapelessV
val scodec = "org.scodec" %% "scodec-bits" % scodecV
val oslib = "com.lihaoyi" %% "os-lib" % oslibV
val continuum = "danburkert" %% "continuum" % continuumV
val macroCompat = "org.typelevel" %% "macro-compat" % macroCompatV
val ammoniteOps = "com.lihaoyi" %% "ammonite-ops" % ammoniteV
val ammonite = "com.lihaoyi" % "ammonite" % ammoniteV % "test" cross CrossVersion.full
val oscar = "oscar" %% "oscar-cp" % oscarV
val munit = "org.scalameta" %% "munit" % munitV % Test
val macroParadise = compilerPlugin("org.scalamacros" % "paradise" % macroParadiseV cross CrossVersion.patch)
}
lazy val commonDependencies = Seq(
dependencies.singletonOps,
dependencies.oslib,
// dependencies.continuum,
dependencies.shapeless,
dependencies.scodec,
dependencies.akka,
// dependencies.oscar,
dependencies.ammoniteOps,
// dependencies.ammonite,
dependencies.munit
)
// SETTINGS
lazy val settings =
commonSettings
lazy val compilerOptions = Seq(
"-unchecked",
"-feature",
"-language:reflectiveCalls",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-deprecation",
// "-Vimplicits",
"-encoding",
"utf8"
)
lazy val macroSettings = Seq(
scalacOptions ++= Seq(
"-language:experimental.macros",
"-Ymacro-annotations"
),
scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, v)) if v >= 13 =>
Nil
case _ =>
Seq("-Xplugin-require:macroparadise")
}
},
libraryDependencies ++= Seq(scalaOrganization.value % "scala-compiler" % scalaVersion.value),
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
// if scala 2.13+ is used, macro annotations are merged into scala-reflect
// https://github.com/scala/scala/pull/6606
case Some((2, v)) if v >= 13 =>
Nil
case _ =>
Seq(dependencies.macroParadise)
}
}
)
lazy val commonSettings = Seq(
scalaOrganization := {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, v)) if v >= 13 =>
"org.scala-lang"
case _ =>
"org.typelevel"
}
},
scalacOptions ++= compilerOptions,
scalacOptions ++= Seq(
"-language:experimental.macros",
"-Ymacro-annotations"
),
scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, v)) if v >= 13 =>
Nil
case _ =>
Seq(
"-Yliteral-types", // enable SIP-23 implementation
"-Xsource:2.13", //https://github.com/scala/scala/commit/33478bdc9792ee13baa8208e326278695b1bd4e4
)
}
},
resolvers ++= Seq(
"Local Maven Repository" at "file://" + Path.userHome.absolutePath + "/.m2/repository",
Resolver.sonatypeRepo("releases"),
Resolver.sonatypeRepo("snapshots")
),
// libraryDependencies += dependencies.ammonite,
// sourceGenerators in Test += Def.task {
// val file = (sourceManaged in Test).value / "amm.scala"
// IO.write(file, """object amm extends App { ammonite.Main.main(args) }""")
// Seq(file)
// }.taskValue
)
lazy val assemblySettings = Seq(
assembly / assemblyJarName := name.value + ".jar",
assembly / assemblyMergeStrategy := {
case PathList("META-INF", xs @ _*) => MergeStrategy.discard
case _ => MergeStrategy.first
}
)
////////////////////////////////////////////////////////////////////
// Spire
////////////////////////////////////////////////////////////////////
//libraryDependencies += "org.spire-math" %% "spire" % "0.11.0"
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// Tagging
////////////////////////////////////////////////////////////////////
//libraryDependencies += "com.softwaremill.common" %% "tagging" % "1.0.0"
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// Oscar (constraints)
////////////////////////////////////////////////////////////////////
//libraryDependencies += "oscar" %% "oscar-linprog" % "3.0.0"
//
//libraryDependencies += "oscar" %% "oscar-cbls" % "3.0.0"
//
//libraryDependencies += "oscar" %% "oscar-dfo" % "3.0.0"
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// Configs (configuration)
////////////////////////////////////////////////////////////////////
//libraryDependencies += "com.github.kxbmap" %% "configs" % "0.4.2"
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// Scalatest
////////////////////////////////////////////////////////////////////
//libraryDependencies += "org.scalatest" % "scalatest_2.11" % "latest.release"
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// Chisel
////////////////////////////////////////////////////////////////////
//libraryDependencies += "edu.berkeley.cs" %% "chisel" % "latest.release"
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// SpinalHDL
////////////////////////////////////////////////////////////////////
//libraryDependencies ++= Seq(
// "com.github.spinalhdl" % "spinalhdl-core_2.12" % "latest.release",
// "com.github.spinalhdl" % "spinalhdl-lib_2.12" % "latest.release"
//)
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// Treehugger (code generation)
////////////////////////////////////////////////////////////////////
//libraryDependencies += "com.eed3si9n" %% "treehugger" % "0.4.1"
//
//resolvers += Resolver.sonatypeRepo("public")
////////////////////////////////////////////////////////////////////