forked from scalacenter/platform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
116 lines (106 loc) · 3.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
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
lazy val publishSettings = Seq(
publishMavenStyle := true,
publishArtifact in Test := false,
// Scala Center license... BSD 3-clause
licenses := Seq("BSD" -> url("http://opensource.org/licenses/BSD-3-Clause")),
homepage := Some(url("https://github.com/scalaplatform/platform")),
developers += Developer("jvican",
"Jorge Vicente Cantero",
url("https://jorge.vican.me"))
)
inThisBuild(
Seq(
organization := "org.scala-lang.platform",
resolvers += Resolver.jcenterRepo,
resolvers += Resolver.bintrayRepo("jvican", "releases"),
resolvers += Resolver.bintrayRepo("scalaplatform", "tools"),
updateOptions := updateOptions.value.withCachedResolution(true)
)
)
lazy val compilerOptions = Seq(
"-deprecation",
"-encoding",
"UTF-8",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-unchecked",
"-Yno-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Xfuture",
"-Xlint"
)
lazy val commonSettings = Seq(
triggeredMessage in ThisBuild := Watched.clearWhenTriggered,
watchSources += baseDirectory.value / "resources",
scalacOptions in (Compile, console) := compilerOptions,
testOptions in Test += Tests.Argument("-oD")
)
lazy val testDependencies = Seq(
"org.scalatest" %% "scalatest" % "3.0.4" % "test",
"junit" % "junit" % "4.12" % "test"
)
lazy val noPublish = Seq(
publishArtifact := false,
publish := {},
publishLocal := {}
)
lazy val allSettings = commonSettings ++ publishSettings
lazy val platform = project
.in(file("."))
.settings(allSettings)
.settings(noPublish)
.settings(scalaVersion := "2.12.3")
.aggregate(process, `release-manager`)
.dependsOn(process, `release-manager`)
lazy val process: Project = project
.in(file("process"))
.settings(allSettings)
.settings(scalaVersion := "2.12.3")
.settings(name := "platform-process")
lazy val `release-manager` = project
.in(file("release-manager"))
.settings(allSettings)
.settings(scalaVersion := "2.12.3")
.settings(
libraryDependencies ++= Seq(
"org.eclipse.jgit" % "org.eclipse.jgit" % "4.5.0.201609210915-r",
"me.vican.jorge" %% "stoml" % "0.4",
"org.typelevel" %% "cats" % "0.8.1"
) ++ testDependencies
)
lazy val `sbt-platform` = project
.in(file("sbt-platform"))
.enablePlugins(ScriptedPlugin)
.settings(allSettings)
.settings(
sbtPlugin := true,
scalaVersion := "2.12.3",
publishMavenStyle := false,
addSbtPlugin(("ohnosequences" % "sbt-github-release" % "0.5.1").classifier("fat").intransitive()),
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.18"),
addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.0.0-RC12"),
addSbtPlugin("ch.epfl.scala" % "sbt-release-early" % "2.0.0"),
addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "2.0.0"),
libraryDependencies ++= testDependencies,
scriptedBufferLog := false,
scriptedLaunchOpts := {
val name = Keys.name.value
val version = Keys.version.value
val baseDirectory = Keys.baseDirectory.in(platform).value
Seq(
s"-Dplugin.version=$version",
"-Xmx1g",
"-Xss16m",
s"-Dsourcedep.name=$name",
s"-Dsourcedep.basedir=${baseDirectory.getAbsolutePath()}",
) ++ {
// Pass along custom boot properties if specified
val bootProps = "sbt.boot.properties"
sys.props.get(bootProps).map(x => s"-D$bootProps=$x").toList
}
},
)