forked from scalameta/metals
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
176 lines (166 loc) · 5.6 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
inThisBuild(
semanticdbSettings ++
List(
version ~= { old =>
if (sys.env.contains("CI")) old
else "0.1-SNAPSHOT" // to avoid manually updating extension.js
},
scalaVersion := V.scala212,
scalacOptions ++= List(
"-deprecation",
// -Xlint is unusable because of
// https://github.com/scala/bug/issues/10448
"-Ywarn-unused-import"
),
scalafixEnabled := false,
organization := "org.scalameta",
licenses := Seq(
"Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")
),
testFrameworks := new TestFramework("utest.runner.Framework") :: Nil,
libraryDependencies += "com.lihaoyi" %% "utest" % "0.6.0" % Test,
homepage := Some(url("https://github.com/scalameta/metals")),
developers := List(
Developer(
"laughedelic",
"Alexey Alekhin",
url("https://github.com/laughedelic")
),
Developer(
"gabro",
"Gabriele Petronella",
url("https://github.com/gabro")
),
Developer(
"jvican",
"Jorge Vicente Cantero",
url("https://jvican.github.io/")
),
Developer(
"olafurpg",
"Ólafur Páll Geirsson",
url("https://geirsson.com")
),
Developer(
"ShaneDelmore",
"Shane Delmore",
url("http://delmore.io")
)
),
scmInfo in ThisBuild := Some(
ScmInfo(
url("https://github.com/scalameta/metals"),
s"scm:git:[email protected]:scalameta/metals.git"
)
),
releaseEarlyWith := BintrayPublisher,
releaseEarlyEnableSyncToMaven := false,
publishMavenStyle := true,
bintrayOrganization := Some("scalameta"),
bintrayReleaseOnPublish := dynverGitDescribeOutput.value.isVersionStable,
// faster publishLocal:
publishArtifact in packageDoc := sys.env.contains("CI"),
publishArtifact in packageSrc := sys.env.contains("CI"),
addCompilerPlugin(
"org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full
)
)
)
name := "metalsRoot"
lazy val benchmarks = project
.dependsOn(metals)
.enablePlugins(JmhPlugin)
lazy val V = new {
val scala211 = SemanticdbEnable.scala211
val scala212 = SemanticdbEnable.scala212
val scalameta = SemanticdbEnable.semanticdbVersion
val scalafix = "0.5.7"
val enumeratum = "1.5.12"
val circe = "0.9.0"
val cats = "1.0.1"
val monix = "3.0.0-RC3"
}
lazy val noPublish = List(
publishTo := None,
publishArtifact := false,
skip in publish := true
)
// not publishing the root project
noPublish
lazy val jsonrpc = project
.settings(
crossScalaVersions := List(V.scala211, V.scala212),
libraryDependencies ++= List(
"ch.qos.logback" % "logback-classic" % "1.2.3",
"com.beachape" %% "enumeratum" % V.enumeratum,
"com.beachape" %% "enumeratum-circe" % "1.5.15",
"com.lihaoyi" %% "pprint" % "0.5.3",
"com.typesafe.scala-logging" %% "scala-logging" % "3.7.2",
"io.circe" %% "circe-core" % V.circe,
"io.circe" %% "circe-generic" % V.circe,
"io.circe" %% "circe-generic-extras" % V.circe,
"io.circe" %% "circe-parser" % V.circe,
"io.monix" %% "monix" % "2.3.0",
"org.codehaus.groovy" % "groovy" % "2.4.0",
"org.slf4j" % "slf4j-api" % "1.7.25",
"org.typelevel" %% "cats-core" % V.cats
)
)
lazy val lsp4s = project
.settings(crossScalaVersions := List(V.scala211, V.scala212))
.dependsOn(jsonrpc)
lazy val metals = project
.settings(
PB.targets.in(Compile) := Seq(
scalapb.gen(
flatPackage = true // Don't append filename to package
) -> sourceManaged.in(Compile).value./("protobuf")
),
fork in Test := true, // required for jni interrop with leveldb.
buildInfoKeys := Seq[BuildInfoKey](
"testWorkspaceBaseDirectory" ->
baseDirectory.in(testWorkspace).value
),
buildInfoPackage := "scala.meta.metals.internal",
libraryDependencies ++= List(
"org.scala-sbt.ipcsocket" % "ipcsocket" % "1.0.0", // for sbt server
"ch.epfl.scala" % "scalafix-reflect" % V.scalafix cross CrossVersion.full,
"com.googlecode.java-diff-utils" % "diffutils" % "1.3.0", // for edit-distance
"com.thoughtworks.qdox" % "qdox" % "2.0-M7", // for java mtags
"io.get-coursier" %% "coursier" % coursier.util.Properties.version, // for jars
"io.get-coursier" %% "coursier-cache" % coursier.util.Properties.version,
"io.github.soc" % "directories" % "5", // for cache location
"me.xdrop" % "fuzzywuzzy" % "1.1.9", // for workspace/symbol
"org.fusesource.leveldbjni" % "leveldbjni-all" % "1.8", // for caching classpath index
"org.scalameta" %% "semanticdb-scalac" % V.scalameta cross CrossVersion.full,
"org.scalameta" %% "testkit" % V.scalameta % Test
)
)
.dependsOn(
testWorkspace % "test->test",
lsp4s
)
.enablePlugins(BuildInfoPlugin)
lazy val integration = project
.in(file("tests/integration"))
.settings(
noPublish
)
.dependsOn(metals % "compile->compile;test->test")
lazy val testWorkspace = project
.in(file("test-workspace"))
.settings(
noPublish,
scalacOptions += {
// Need to fix source root so it matches the workspace folder.
s"-P:semanticdb:sourceroot:${baseDirectory.value}"
},
scalacOptions += "-Ywarn-unused-import",
scalacOptions -= "-Xlint"
)
.disablePlugins(ScalafixPlugin)