-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.sbt
40 lines (36 loc) · 1.26 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
lazy val root = Project(
id = "root",
base = file(".")
).aggregate(plugin, main)
lazy val sharedSettings = Seq(
scalaVersion := "2.12.4",
organization := "demo",
name := "boxer",
scalacOptions ++= Seq("-deprecation", "-feature", "-unchecked", "-Xlint")
)
// This subproject contains a Scala compiler plugin that checks for
// value class boxing after Erasure.
lazy val plugin = Project(
id = "plugin",
base = file("plugin")
) settings (
libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value,
publishArtifact in Compile := false,
scalacOptions += "-Xfatal-warnings"
) settings (sharedSettings : _*)
// Scalac command line options to install our compiler plugin.
lazy val usePluginSettings = Seq(
scalacOptions in Compile ++= {
val jar = (Keys.`package` in (plugin, Compile)).value
val addPlugin = "-Xplugin:" + jar.getAbsolutePath
// add plugin timestamp to compiler options to trigger recompile of
// main after editing the plugin. (Otherwise a 'clean' is needed.)
val dummy = "-Jdummy=" + jar.lastModified
Seq(addPlugin, dummy)
}
)
// A regular module with the application code.
lazy val main = Project(
id = "main",
base = file("main")
) settings (sharedSettings ++ usePluginSettings: _*)