-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.sbt
113 lines (95 loc) · 3.66 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
name := "scala-repl-pp-root"
ThisBuild/organization := "com.michaelpollmeier"
publish/skip := true
lazy val scalaVersions = Seq("3.5.2", "3.6.4")
ThisBuild/scalaVersion := scalaVersions.max
lazy val Slf4jVersion = "2.0.16"
lazy val releasePackage = taskKey[File]("package up a downloadable release")
releasePackage := {
// same as in `.github/workflows/release.yml`
val releaseFile = target.value / "srp.zip"
IO.copyFile((core_364/Universal/packageBin).value, releaseFile)
streams.value.log.info(s"packaged up a release in $releaseFile")
releaseFile
}
lazy val core_364 = Build
.newProject("core", "3.6.4", "scala-repl-pp")
.dependsOn(shadedLibs)
.enablePlugins(JavaAppPackaging)
.settings(coreSettings)
lazy val core_352 = Build
.newProject("core", "3.5.2", "scala-repl-pp")
.dependsOn(shadedLibs)
.enablePlugins(JavaAppPackaging)
.settings(coreSettings)
lazy val coreSettings = commonSettings ++ Seq(
Compile/mainClass := Some("replpp.Main"),
executableScriptName := "srp",
Universal/topLevelDirectory := Some("srp"),
libraryDependencies += "org.scala-lang" %% "scala3-compiler" % scalaVersion.value,
)
lazy val shadedLibs = project.in(file("shaded-libs")).settings(
name := "scala-repl-pp-shaded-libs",
scalaVersion := scalaVersions.min,
Compile/compile/scalacOptions ++= Seq(
"-language:implicitConversions",
"-Wconf:any:silent", // silence warnings from shaded libraries
"-explain"
),
Compile/doc/scalacOptions += "-nowarn",
commonSettings,
)
lazy val server_364 = Build
.newProject("server", "3.6.4", "scala-repl-pp-server")
.dependsOn(core_364)
.enablePlugins(JavaAppPackaging)
.settings(serverSettings)
lazy val server_352 = Build
.newProject("server", "3.5.2", "scala-repl-pp-server")
.dependsOn(core_352)
.enablePlugins(JavaAppPackaging)
.settings(serverSettings)
lazy val serverSettings = commonSettings ++ Seq(
Compile/mainClass := Some("replpp.server.Main"),
libraryDependencies ++= Seq(
"com.lihaoyi" %% "cask" % "0.9.5",
"org.slf4j" % "slf4j-api" % Slf4jVersion,
"org.slf4j" % "slf4j-simple" % Slf4jVersion % Optional,
"com.lihaoyi" %% "requests" % "0.8.2" % Test,
),
executableScriptName := "srp-server",
fork := true, // important: otherwise we run into classloader issues
)
lazy val integrationTests = project.in(file("integration-tests"))
.dependsOn(server_364)
.settings(
name := "integration-tests",
fork := true, // important: otherwise we run into classloader issues
libraryDependencies += "org.slf4j" % "slf4j-simple" % Slf4jVersion % Optional,
publish/skip := true
)
lazy val commonSettings = Seq(maintainer.withRank(KeyRanks.Invisible) := "[email protected]")
ThisBuild/libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "3.2.19" % Test,
"com.lihaoyi" %% "os-lib" % "0.9.1" % Test,
)
ThisBuild/versionScheme := Some("strict")
ThisBuild/javacOptions ++= Seq(
"-g", //debug symbols
"--release", "11"
)
ThisBuild/scalacOptions ++= Seq(
"-release", "11",
"-deprecation",
"-feature",
)
ThisBuild/Test/fork := false
ThisBuild/publishTo := sonatypePublishToBundle.value
ThisBuild/scmInfo := Some(ScmInfo(url("https://github.com/mpollmeier/scala-repl-pp"),
"scm:[email protected]:mpollmeier/scala-repl-pp.git"))
ThisBuild/homepage := Some(url("https://github.com/mpollmeier/scala-repl-pp/"))
ThisBuild/licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0"))
ThisBuild/developers := List(
Developer("mpollmeier", "Michael Pollmeier", "[email protected]", url("http://www.michaelpollmeier.com/"))
)
Global/onChangedBuildSource := ReloadOnSourceChanges