-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathbuild.sbt
More file actions
147 lines (127 loc) · 4.68 KB
/
build.sbt
File metadata and controls
147 lines (127 loc) · 4.68 KB
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
ThisBuild / organization := "ch.epfl.data"
ThisBuild / scalaVersion := "2.12.18"
ThisBuild / version := "2.0-SNAPSHOT"
val project_name = "CloudCity"
name := project_name
val paradiseVersion = "2.1.1"
val breezeVersion = "2.1.0"
val scalaTestVersion = "3.1.2"
val squidVersion = "0.4.1-SNAPSHOT"
val graphVizVersion = "0.10.0"
val akkaVersion = "2.6.14"
// val scalapbVersion = "1.0.6"
run / fork := true
val pubLocal = Option(System.getProperty("pubLocal")).getOrElse("false")
initialize := {
val _ = initialize.value // run the previous initialization
val java8 = "1.8"
val java11 = "11"
val current = sys.props("java.specification.version")
assert(current == java8 || current == java11, s"Unsupported JDK: java.specification.version $current != $java8 or $java11")
}
lazy val commonSettings = Seq(
libraryDependencies += "org.scalatest" %% "scalatest" % scalaTestVersion % "test",
libraryDependencies += "org.scalanlp" %% "breeze" % breezeVersion,
libraryDependencies += "org.scalanlp" %% "breeze-natives" % breezeVersion,
libraryDependencies += "org.scalanlp" %% "breeze-viz" % breezeVersion,
)
lazy val squidSettings = Seq(
autoCompilerPlugins := true,
addCompilerPlugin(
"org.scalamacros" % "paradise" % paradiseVersion cross CrossVersion.full
),
unmanagedBase := (unmanagedBase in LocalRootProject).value
)
lazy val akkaSettings = Seq(
libraryDependencies += "com.typesafe.akka" %% "akka-actor-typed" % akkaVersion,
libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.2.3",
libraryDependencies += "com.typesafe.akka" %% "akka-actor-testkit-typed" % akkaVersion % Test,
libraryDependencies += "com.typesafe.akka" %% "akka-cluster-typed" % akkaVersion,
)
// Enable graph drawing when debugging
lazy val graphSettings = Seq(
libraryDependencies += "guru.nidi" % "graphviz-java" % graphVizVersion,
)
lazy val noMessaging = (project in file("ecosim"))
.settings(
name := f"${project_name}-noMessaging",
commonSettings)
lazy val core = (project in file("core"))
.settings(
name := f"${project_name}-core",
commonSettings, squidSettings, graphSettings,
scalacOptions ++= Seq("-Xlint"),
libraryDependencies += "org.scalameta" %% "scalameta" % "4.4.20",
libraryDependencies += "com.typesafe.akka" %% "akka-serialization-jackson" % akkaVersion,
Test / parallelExecution := false,
)
lazy val genCore = (project in file("gen-core"))
.settings(
name := f"${project_name}-genCore",
Test / parallelExecution := false,
).dependsOn(core % "compile->compile;compile->test")
lazy val akka = if (pubLocal == "true") {
(project in file("Akka"))
.settings(
name := f"${project_name}-akka",
commonSettings, akkaSettings,
Test / parallelExecution := false,
).dependsOn(core % "compile->compile;compile->test")
} else {
(project in file("Akka"))
.settings(
name := f"${project_name}-akka",
commonSettings, akkaSettings,
Test / parallelExecution := false,
).dependsOn(core % "compile->compile;compile->test", genCore, genExample)
}
lazy val base = if (pubLocal == "true") {
(project in file("Base"))
.settings(
name := f"${project_name}-base",
commonSettings,
Test / parallelExecution := false,
).dependsOn(core % "compile->compile;compile->test")
} else {
(project in file("Base"))
.settings(
name := f"${project_name}-base",
commonSettings,
Test / parallelExecution := false,
).dependsOn(core % "compile->compile;compile->test", genCore, genExample)
}
lazy val library = (project in file("library"))
.settings(
name := f"${project_name}-library",
commonSettings,
).dependsOn(core)
lazy val gui = (project in file("GUI"))
.enablePlugins(ScalaJSPlugin)
.settings(
name := f"${project_name}-GUI",
commonSettings,
libraryDependencies += "org.scala-js" %%% "scalajs-dom" % "1.1.0",
).dependsOn(core)
lazy val runAll = taskKey[Unit]("run-all, for compiling all meta examples")
def runAllIn(config: Configuration) = Def.task {
val s = streams.value
val cp = (config / fullClasspath).value
val r = (run / runner).value
(config / discoveredMainClasses).value.foreach(c =>
r.run(c, cp.files, Seq(), s.log))
}
lazy val example = (project in file("example"))
.settings(
name := f"${project_name}-example",
commonSettings, squidSettings,
runAll := runAllIn(Compile).value,
Test / parallelExecution := false
)
.dependsOn(core, library)
lazy val genExample = (project in file("generated"))
.settings(
name := f"${project_name}-genExample",
Test / parallelExecution := false,
// libraryDependencies += "org.plotly-scala" %%% "plotly-render" % "0.8.2",
commonSettings
).dependsOn(core, library, example)