Repository navigation
Expand file tree
/
Copy pathbuild.sbt
More file actions
140 lines (125 loc) · 5.32 KB
/
Copy pathbuild.sbt
File metadata and controls
140 lines (125 loc) · 5.32 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
import sbt._
ThisBuild / version := "wk"
ThisBuild / scalaVersion := "3.8.4"
ThisBuild / semanticdbEnabled := false
// fix jni for scala version 3
sbtJniCoreScope := Compile
val failOnWarning = if (sys.props.contains("failOnWarning")) Seq("-Werror") else Seq()
ThisBuild / scalacOptions ++= Seq(
"-explain", // More detailed compiler output
"-explain-types", // Explain type errors in detail
"-release:17",
"-feature",
"-deprecation",
"-Wunused:imports,privates,locals,implicits,linted",
"-language:postfixOps",
"-Wconf:src=target/.*:s",
"-Wconf:src=webknossos-datastore/target/.*:s",
"-Wconf:src=webknossos-tracingstore/target/.*:s"
) ++ failOnWarning
ThisBuild / javacOptions ++= Seq(
"-Xlint:unchecked",
"-Xlint:deprecation"
)
// Keep asset timestamps when assembling jar
ThisBuild / packageOptions += Package.FixedTimestamp(Package.keepTimestamps)
// Allow Ctrl+C in interactive sbt to cancel commands, not sbt itself
cancelable in Global := true
PlayKeys.devSettings := Seq("play.server.pekko.requestTimeout" -> "10000s", "play.server.http.idleTimeout" -> "10000s")
// Disable unused import warnings, only in sbt console REPL
Compile / console / scalacOptions -= "-Xlint:unused"
lazy val commonSettings = Seq(
resolvers ++= Dependencies.dependencyResolvers,
Compile / doc / sources := Seq.empty,
Compile / packageDoc / publishArtifact := false,
coverageExcludedFiles := ".*/target/.*;.*/MarchingCubesTable"
)
lazy val protocolBufferSettings = Seq(
Compile / PB.protoSources := Seq(baseDirectory.value / "proto"),
Compile / PB.targets := Seq(
scalapb.gen() -> (Compile / sourceManaged).value / "proto"
)
)
lazy val util = (project in file("util")).settings(
commonSettings,
libraryDependencies ++= Dependencies.utilDependencies,
dependencyOverrides ++= Dependencies.dependencyOverrides
)
// Standalone slick code generator. Not part of the app; its compiled classpath is used by the
// slick schema generation task to produce one Tables source file per table (see AssetCompilation).
lazy val webknossosSlickCodegen = (project in file("webknossos-slick-codegen")).settings(
commonSettings,
libraryDependencies ++= Dependencies.slickCodegenDependencies
)
lazy val webknossosJni = (project in file("webknossos-jni"))
.settings(nativeCompile / sourceDirectory := sourceDirectory.value)
.enablePlugins(JniNative)
lazy val webknossosDatastore = (project in file("webknossos-datastore"))
.dependsOn(util)
.dependsOn(webknossosJni)
.enablePlugins(play.sbt.PlayScala)
.enablePlugins(BuildInfoPlugin)
.enablePlugins(ProtocPlugin)
.settings(javah / target := (webknossosJni / nativeCompile / sourceDirectory).value / "include")
.settings(
name := "webknossos-datastore",
commonSettings,
generateReverseRouter := false,
BuildInfoSettings.webknossosDatastoreBuildInfoSettings,
libraryDependencies ++= Dependencies.webknossosDatastoreDependencies,
dependencyOverrides ++= Dependencies.dependencyOverrides,
protocolBufferSettings,
Compile / unmanagedJars ++= {
val libs = baseDirectory.value / "lib"
val subs = (libs ** "*") filter { _.isDirectory }
val targets = ((subs / "target") ** "*") filter { f =>
f.name.startsWith("scala-") && f.isDirectory
}
((libs +++ subs +++ targets) ** "*.jar").classpath
},
routesImport += "com.scalableminds.util.objectid.ObjectId"
)
lazy val webknossosTracingstore = (project in file("webknossos-tracingstore"))
.dependsOn(webknossosDatastore)
.enablePlugins(play.sbt.PlayScala)
.enablePlugins(BuildInfoPlugin)
.settings(
name := "webknossos-tracingstore",
commonSettings,
routesImport += "com.scalableminds.util.objectid.ObjectId",
generateReverseRouter := false,
BuildInfoSettings.webknossosTracingstoreBuildInfoSettings,
libraryDependencies ++= Dependencies.webknossosTracingstoreDependencies,
dependencyOverrides ++= Dependencies.dependencyOverrides
)
lazy val webknossos = (project in file("."))
.dependsOn(util, webknossosTracingstore)
.enablePlugins(play.sbt.PlayScala)
.enablePlugins(BuildInfoPlugin)
.settings(
name := "webknossos",
commonSettings,
routesImport += "com.scalableminds.util.objectid.ObjectId",
generateReverseRouter := false,
AssetCompilation.settings,
BuildInfoSettings.webknossosBuildInfoSettings,
libraryDependencies ++= Dependencies.webknossosDependencies,
dependencyOverrides ++= Dependencies.dependencyOverrides,
Assets / sourceDirectory := file("none"),
// The following two assignments avoid that the public assets
// appear in two output jars. Namely, target/universal/stage/lib/webknossos.webknossos-wk-sans-externalized.jar
// does not need to contain them. Might be fixed automatically with Play 2.9.4 and 3.0.4
// See this discussion for context:
// https://github.com/playframework/playframework/issues/5765#issuecomment-1996991474
Assets / WebKeys.exportedMappings := Seq(),
TestAssets / WebKeys.exportedMappings := Seq(),
updateOptions := updateOptions.value.withLatestSnapshots(true),
Compile / unmanagedJars ++= {
val libs = baseDirectory.value / "lib"
val subs = (libs ** "*") filter { _.isDirectory }
val targets = ((subs / "target") ** "*") filter { f =>
f.name.startsWith("scala-") && f.isDirectory
}
((libs +++ subs +++ targets) ** "*.jar").classpath
}
)