forked from scalacenter/bloop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
194 lines (178 loc) · 6.67 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
import build.BuildImplementation.BuildDefaults
// Tell bloop to aggregate source deps (benchmark) config files in the same bloop config dir
bloopAggregateSourceDependencies in Global := true
/***************************************************************************************************/
/* This is the build definition of the source deps */
/***************************************************************************************************/
val benchmarkBridge = project
.in(file(".benchmark-bridge-compilation"))
.aggregate(BenchmarkBridgeCompilation)
.disablePlugins(ScriptedPlugin)
.settings(
releaseEarly := { () },
skip in publish := true
)
/***************************************************************************************************/
/* This is the build definition of the wrapper */
/***************************************************************************************************/
import build.Dependencies
val backend = project
.enablePlugins(BuildInfoPlugin)
.disablePlugins(ScriptedPlugin)
.settings(testSettings)
.settings(
name := "bloop-backend",
buildInfoPackage := "bloop.internal.build",
buildInfoKeys := BloopBackendInfoKeys,
buildInfoObject := "BloopScalaInfo",
libraryDependencies ++= List(
Dependencies.zinc,
Dependencies.nailgun,
Dependencies.scalazCore,
Dependencies.scalazConcurrent,
Dependencies.coursier,
Dependencies.coursierCache,
Dependencies.coursierScalaz,
Dependencies.libraryManagement,
Dependencies.configDirectories,
Dependencies.sourcecode,
Dependencies.sbtTestInterface,
Dependencies.sbtTestAgent,
Dependencies.monix,
Dependencies.directoryWatcher
)
)
// Needs to be called `jsonConfig` because of naming conflict with sbt universe...
val jsonConfig = project
.in(file("config"))
.disablePlugins(ScriptedPlugin)
.settings(testSettings)
.settings(
name := "bloop-config",
crossScalaVersions := List(Keys.scalaVersion.in(backend).value, "2.10.7"),
// We compile in both so that the maven integration can be tested locally
publishLocal := publishLocal.dependsOn(publishM2).value,
libraryDependencies ++= {
if (scalaBinaryVersion.value == "2.12") {
List(
Dependencies.typesafeConfig,
Dependencies.metaconfigCore,
Dependencies.metaconfigDocs,
Dependencies.metaconfigConfig,
Dependencies.circeDerivation,
Dependencies.nuprocess,
Dependencies.scalacheck % Test,
)
} else {
List(
Dependencies.typesafeConfig,
Dependencies.circeCore,
Dependencies.circeGeneric,
compilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full),
Dependencies.scalacheck % Test,
)
}
}
)
import build.BuildImplementation.jvmOptions
// For the moment, the dependency is fixed
val frontend = project
.dependsOn(backend, backend % "test->test", jsonConfig)
.disablePlugins(ScriptedPlugin)
.enablePlugins(BuildInfoPlugin)
.settings(testSettings, assemblySettings, releaseSettings, integrationTestSettings)
.settings(
name := s"bloop-frontend",
mainClass in Compile in run := Some("bloop.Cli"),
buildInfoPackage := "bloop.internal.build",
buildInfoKeys := BloopInfoKeys,
javaOptions in run ++= jvmOptions,
javaOptions in Test ++= jvmOptions,
libraryDependencies += Dependencies.graphviz % Test,
fork in run := true,
fork in Test := true,
parallelExecution in test := false,
libraryDependencies ++= List(
Dependencies.scalazCore,
Dependencies.bsp,
Dependencies.monix,
Dependencies.caseApp,
Dependencies.ipcsocket % Test
),
dependencyOverrides += Dependencies.shapeless
)
val benchmarks = project
.dependsOn(frontend % "compile->test", BenchmarkBridgeCompilation % "compile->jmh")
.disablePlugins(ScriptedPlugin)
.enablePlugins(BuildInfoPlugin, JmhPlugin)
.settings(benchmarksSettings(frontend))
.settings(
skip in publish := true,
)
lazy val sbtBloop = project
.enablePlugins(ScriptedPlugin)
.in(file("integrations") / "sbt-bloop")
.dependsOn(jsonConfig)
.settings(BuildDefaults.scriptedSettings)
.settings(
name := "sbt-bloop",
sbtPlugin := true,
scalaVersion := BuildDefaults.fixScalaVersionForSbtPlugin.value,
bintrayPackage := "sbt-bloop",
bintrayOrganization := Some("sbt"),
bintrayRepository := "sbt-plugin-releases",
publishMavenStyle := releaseEarlyWith.value == SonatypePublisher,
publishLocal := publishLocal.dependsOn(publishLocal in jsonConfig).value
)
val mavenBloop = project
.in(file("integrations") / "maven-bloop")
.disablePlugins(ScriptedPlugin)
.dependsOn(jsonConfig)
.settings(name := "maven-bloop")
.settings(BuildDefaults.mavenPluginBuildSettings)
val docs = project
.in(file("website"))
.enablePlugins(HugoPlugin, GhpagesPlugin, ScriptedPlugin)
.settings(
name := "bloop-website",
skip in publish := true,
websiteSettings
)
val allProjects = Seq(backend, benchmarks, frontend, jsonConfig, sbtBloop, mavenBloop)
val allProjectReferences = allProjects.map(p => LocalProject(p.id))
val bloop = project
.in(file("."))
.disablePlugins(ScriptedPlugin)
.aggregate(allProjectReferences: _*)
.settings(
releaseEarly := { () },
skip in publish := true,
crossSbtVersions := Seq("1.1.0", "0.13.16")
)
/***************************************************************************************************/
/* This is the corner for all the command definitions */
/***************************************************************************************************/
val publishLocalCmd = Keys.publishLocal.key.label
// Runs the scripted tests to setup integration tests
// ! This is used by the benchmarks too !
addCommandAlias(
"install",
Seq(
s"+${jsonConfig.id}/$publishLocalCmd",
s"^${sbtBloop.id}/$publishLocalCmd",
s"${mavenBloop.id}/$publishLocalCmd",
s"${backend.id}/$publishLocalCmd",
s"${frontend.id}/$publishLocalCmd"
).mkString(";", ";", "")
)
val releaseEarlyCmd = releaseEarly.key.label
val allBloopReleases = List(
s"${backend.id}/$releaseEarlyCmd",
s"${frontend.id}/$releaseEarlyCmd",
s"+${jsonConfig.id}/$publishLocalCmd", // Necessary because of a coursier bug?
s"+${jsonConfig.id}/$releaseEarlyCmd",
s"^${sbtBloop.id}/$releaseEarlyCmd",
s"${mavenBloop.id}/$releaseEarlyCmd",
)
val allReleaseActions = allBloopReleases ++ List("sonatypeReleaseAll")
addCommandAlias("releaseBloop", allReleaseActions.mkString(";", ";", ""))