-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
140 lines (124 loc) · 5.46 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
import sbtassembly.MergeStrategy
// find Version.scala in project/
ThisBuild / name := "so-testbed"
ThisBuild / version := Version.pkg
ThisBuild / scalaVersion := Version.scala
lazy val routingTestbed = project
.in(file("."))
// .settings(scalaVersion := Version.scala)
.aggregate(core, matsim)
lazy val core = project
.in(file("core"))
.settings(
name := "so-testbed-core",
// version := Version.pkg,
// scalaVersion := Version.scala,
scalacOptions ++= scalaCompilerSettings,
// javacOptions ++= javac,
libraryDependencies ++= coreDependencies ++ loggingDependencies,
assembly / assemblyMergeStrategy := {
case "META-INF/io.netty.versions.properties" => MergeStrategy.first
case x =>
val oldStrategy: String => MergeStrategy = (assembly / assemblyMergeStrategy).value
oldStrategy(x)
}
)
.dependsOn(mctsProject)
lazy val matsim = project
.in(file("matsim"))
.settings(
name := "so-testbed-matsim",
// version := Version.pkg,
// scalaVersion := Version.scala,
scalacOptions ++= scalaCompilerSettings,
// javacOptions ++= javac,
matsimAssemblyStrategy,
resolvers ++= matsimResolvers,
libraryDependencies ++= coreDependencies ++ matsimDependencies ++ loggingDependencies
)
.dependsOn(core)
lazy val mctsProject = RootProject(uri("https://github.com/robfitzgerald/mcts.git"))
lazy val matsimResolvers = Seq(
"MATSim release repository".at("https://repo.matsim.org/repository/matsim/"),
"OSGeo Release Repository".at("https://repo.osgeo.org/repository/release/")
// "Open Source Geospatial Foundation Repository".at("http://download.osgeo.org/webdav/geotools/"),
// "OpenGeo Maven Repository".at("http://repo.opengeo.org")
)
lazy val scalaCompilerSettings = List(
// "-target:jvm-1.8",
"-language:higherKinds", // Cats
// "-Ypartial-unification", // Cats to traverse things like List[Either[A, B]] -> Either[A, List[B]]
"-Xmacro-settings:materialize-derivations" // better PureConfig error messages
)
// External Dependencies
lazy val coreDependencies = List(
// REINFORCEMENT LEARNING LIBRARY
// "org.deeplearning4j" % "deeplearning4j-core" % "1.0.0-beta6",
// "org.nd4j" % "nd4j-native-platform" % "1.0.0-beta6",
// "org.deeplearning4j" % "rl4j-api" % "1.0.0-beta6",
// PURE FP LIBRARY
"org.typelevel" %% "cats-core" % "2.9.0",
"org.typelevel" %% "cats-effect" % "3.4.8",
// COMMAND LINE PARSING
"com.monovore" %% "decline" % "2.1.0",
"com.monovore" %% "decline-effect" % "2.1.0",
// CONFIG
"com.github.pureconfig" %% "pureconfig" % "0.14.1",
// GIS
"org.locationtech.proj4j" % "proj4j" % "1.1.1",
"org.locationtech.jts" % "jts-core" % "1.17.1",
"org.locationtech.jts.io" % "jts-io-common" % "1.17.1",
"com.uber" % "h3" % "3.0.3",
// XML
"org.scala-lang.modules" %% "scala-xml" % "1.2.0",
// CSV
"com.nrinaudo" %% "kantan.csv" % "0.6.0",
// "com.nrinaudo" %% "kantan.csv-generic" % "0.6.0",
// JSON
"io.circe" %% "circe-core" % Version.circe,
"io.circe" %% "circe-generic" % Version.circe,
"io.circe" %% "circe-parser" % Version.circe,
// MATH
"org.apache.commons" % "commons-math" % "2.2",
// TEST
"org.scalactic" %% "scalactic" % "3.0.8",
"org.scalatest" %% "scalatest" % "3.0.8" % "test",
// NETWORKING
"com.softwaremill.sttp.client3" %% "core" % "3.8.12",
"com.softwaremill.sttp.client3" %% "async-http-client-backend-cats" % "3.8.12",
"com.softwaremill.sttp.client3" %% "circe" % "3.8.12",
"com.google.protobuf" % "protobuf-java" % "3.17.2"
).map(_.exclude("org.slf4j", "*"))
lazy val matsimDependencies = List(
"org.geotools" % "gt-main" % "21.5",
"org.matsim" % "matsim" % "12.0" // most recent official release/tag
).map(_.exclude("org.slf4j", "*"))
lazy val loggingDependencies = List(
// LOGGING SYSTEM
"ch.qos.logback" % "logback-classic" % "1.2.3",
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.2"
)
/////////////////////////// sbt-assembly ///////////////////////////
lazy val matsimAssemblyStrategy = Seq(
Compile / mainClass := Some("edu.colorado.fitzgero.sotestbed.matsim.app.MATSimExperiment2021App"),
run / mainClass := Some("edu.colorado.fitzgero.sotestbed.matsim.app.MATSimExperiment2021App"),
packageBin / mainClass := Some("edu.colorado.fitzgero.sotestbed.matsim.app.MATSimExperiment2021App"),
assembly / mainClass := Some("edu.colorado.fitzgero.sotestbed.matsim.app.MATSimExperiment2021App"),
assembly / test := {},
assembly / assemblyMergeStrategy := {
// early 2020
case "tec/uom/se/format/messages.properties" => MergeStrategy.concat
// 20200711 - switched from lib/ matsim 12.0 jar to maven-loaded matsim 12.0
case "META-INF/sun-jaxb.episode" => MergeStrategy.first
case "META-INF/io.netty.versions.properties" => MergeStrategy.first
case PathList(ps @ _*) if ps.last == "Log4j2Plugins.dat" => MergeStrategy.discard
case PathList("javax", "validation", xs @ _*) => MergeStrategy.first
case PathList("javax", "activation", xs @ _*) => MergeStrategy.first
case "module-info.class" => MergeStrategy.discard
// 20210317 - too many logbacks!
case "logback.xml" => MergeStrategy.first
case x =>
val oldStrategy: String => MergeStrategy = (assembly / assemblyMergeStrategy).value
oldStrategy(x)
}
)