-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
executable file
·126 lines (116 loc) · 3.72 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
lazy val theVersion = "0.1.0"
lazy val theScalaVersion = "2.11.11"
lazy val root = Project(id = "freast-root", base = file("."))
.settings(
name := "freast-root",
crossVersion := CrossVersion.binary,
publishSettings,
// Do not publish the root project (it just serves as an aggregate)
publishArtifact := false,
publishLocal := {}
)
.aggregate(core, cats, scalaz)
lazy val core = project.settings(
name := "freast-core",
commonSettings,
metaMacroSettings,
publishSettings,
// A dependency on scala.meta is required to write new-style macros, but not
// to expand such macros. This is similar to how it works for old-style
// macros and a dependency on scala.reflect.
libraryDependencies ++= commonDependencies
)
lazy val cats = project
.settings(
name := "freast-cats",
commonSettings,
metaMacroSettings,
publishSettings,
libraryDependencies ++= {
commonDependencies :+ "org.typelevel" %% "cats" % "0.9.0"
}
)
.dependsOn(core)
lazy val scalaz = project
.settings(
name := "freast-scalaz",
commonSettings,
metaMacroSettings,
publishSettings,
libraryDependencies ++= {
commonDependencies :+ "org.scalaz" %% "scalaz-core" % "7.2.16"
}
)
.dependsOn(core)
lazy val commonSettings: Seq[Def.Setting[_]] = Seq(
organization := "com.beachape",
version := theVersion,
scalaVersion := theScalaVersion,
crossScalaVersions := Seq("2.11.11", "2.12.3"),
scalacOptions ++= Seq(
"-deprecation",
"-encoding",
"UTF-8",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-unchecked",
// "-Xfatal-warnings",
// "-Xlint",
"-Yno-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Ywarn-value-discard",
"-Xfuture"
)
)
lazy val metaMacroSettings: Seq[Def.Setting[_]] = Seq(
// temporary workaround for https://github.com/scalameta/paradise/issues/10
addCompilerPlugin("org.scalameta" % "paradise" % "3.0.0-M10" cross CrossVersion.full),
scalacOptions += "-Xplugin-require:macroparadise",
scalacOptions in (Compile, console) ~= (_ filterNot (_ contains "paradise")), // macroparadise plugin doesn't work in repl yet.
scalacOptions in (Compile, console) := Seq(), // macroparadise plugin doesn't work in repl yet.
// temporary workaround for https://github.com/scalameta/paradise/issues/55
sources in (Compile, doc) := Nil // macroparadise doesn't work with scaladoc yet.
)
lazy val commonDependencies = Seq(
"org.scalatest" %% "scalatest" % "3.0.4" % Test,
"org.scalameta" %% "scalameta" % "1.8.0" % Provided
)
// Settings for publishing to Maven Central
lazy val publishSettings: Seq[Def.Setting[_]] = Seq(
pomExtra :=
<url>https://github.com/lloydmeta/freast</url>
<licenses>
<license>
<name>MIT</name>
<url>http://opensource.org/licenses/MIT</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>[email protected]:lloydmeta/freast.git</url>
<connection>scm:git:[email protected]:lloydmeta/freast.git</connection>
</scm>
<developers>
<developer>
<id>lloydmeta</id>
<name>Lloyd Chan</name>
<url>https://beachape.com</url>
</developer>
</developers>,
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (version.value.trim.endsWith("SNAPSHOT"))
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := { _ =>
false
}
)
scalafmtOnCompile in ThisBuild := true