This repository has been archived by the owner on Nov 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.sbt
85 lines (73 loc) · 2.52 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
import Scalaz._
cancelable in Global := true
inThisBuild(
List(
scalaVersion := "2.12.8",
crossScalaVersions := List("2.12.8", "2.12.7", "2.12.6", "2.12.4"),
organization := "org.scalaz",
homepage := Some(url("https://github.com/scalaz/scalaz-plugin")),
licenses := List("LGPL 3.0" -> url("https://www.gnu.org/licenses/lgpl-3.0.en.html")),
developers := List(
Developer(
"alexknvl",
"Alexander Konovalov",
url("https://alexknvl.com/")
),
Developer(
"hrhino",
"Harrison Houghton",
url("https://haromorphism.net/")
)
)
)
)
addCommandAlias("fmt", "all scalafmtSbt scalafmt test:scalafmt")
addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full)
scalacOptions ++= List("-Xplugin-require:macroparadise")
lazy val meta = crossProject.module
.settings(stdSettings("plugin-library"))
lazy val metaJVM = meta.jvm
lazy val metaJS = meta.js
lazy val plugin = (project in file("plugin"))
.settings(
name := "scalaz-plugin",
crossVersion := CrossVersion.full,
libraryDependencies ++= List(
scalaOrganization.value % "scala-reflect" % scalaVersion.value % Provided,
scalaOrganization.value % "scala-compiler" % scalaVersion.value % Provided
)
)
.dependsOn(metaJVM)
lazy val PluginDependency: List[Def.Setting[_]] = List(scalacOptions ++= {
val jar = (packageBin in Compile in plugin).value
Seq(s"-Xplugin:${jar.getAbsolutePath}", s"-Jdummy=${jar.lastModified}")
})
lazy val example = crossProject.module
.settings(stdSettings("example"))
.settings(publishArtifact := false, skip in publish := true)
.dependsOn(meta)
.settings(PluginDependency: _*)
lazy val tests = (project in file("test"))
.dependsOn(plugin)
.settings(publishArtifact := false, skip in publish := true)
.settings(
partestFramework,
libraryDependencies ++= List(
scalaOrganization.value % "scala-reflect" % scalaVersion.value % Provided,
scalaOrganization.value % "scala-compiler" % scalaVersion.value % Provided,
partestDependency(scalaVersion.value),
)
)
commands in Global ++= List(
Commandz.partestCommand(baseDirectory.value),
Commandz.replCommand,
)
lazy val exampleJVM = example.jvm
lazy val exampleJS = example.js
lazy val root = project
.in(file("."))
.settings(publishArtifact := false, skip in publish := true)
.aggregate(metaJS, metaJVM, plugin, exampleJS, exampleJVM, tests)
.enablePlugins(ScalaJSPlugin)