This repository has been archived by the owner on Jul 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.sbt
133 lines (115 loc) · 3.45 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
import play.api.libs.json._
import org.scalajs.core.tools.linker.standard._
name := "atom-ide-scala"
organization := "laughedelic"
description := "Scala & Dotty language support for Atom IDE"
homepage := Some(url(s"https://github.com/${organization.value}/${name.value}"))
scmInfo in ThisBuild := Some(ScmInfo(
homepage.value.get,
s"scm:git:git@github.com:${organization.value}/${name.value}.git"
))
licenses := Seq(
"MIT" -> url("https://opensource.org/licenses/MIT")
)
developers := List(Developer(
"laughedelic",
"Alexey Alekhin",
"laughedelic@gmail.com",
url("https://github.com/laughedelic")
))
scalaVersion := "2.12.8"
scalacOptions ++= Seq(
"-encoding", "utf8",
"-feature",
"-language:postfixOps",
"-language:implicitConversions",
"-language:higherKinds",
"-unchecked",
"-deprecation",
"-Yrangepos",
"-Ywarn-unused-import",
"-P:scalajs:sjsDefinedByDefault"
)
enablePlugins(AtomPackage)
resolvers += Resolver.jcenterRepo
resolvers += Resolver.bintrayRepo("laughedelic", "maven")
libraryDependencies ++= Seq(
"io.scalajs" %%% "nodejs" % "0.4.2",
"laughedelic" %%% "scalajs-atom-api" % "0.6.0+7-0c17704c",
)
scalaJSLinkerConfig ~= {
_.withSourceMap(true)
.withESFeatures(_.withUseECMAScript2015(true))
}
lazy val getCoursier = taskKey[File]("Get coursier binary if missing")
getCoursier := {
import sys.process._
val log = streams.value.log
val file = baseDirectory.value / "coursier"
if (!file.exists) {
log.info("Downloading coursier...")
val exitCode = (new java.net.URL("https://git.io/vgvpD") #> file).!(log)
if (exitCode != 0) sys.error("Couldn't download Coursier")
}
file
}
apmKeywords := Seq(
"scala",
"scalameta",
"ide",
"atom-ide",
"lsp",
"language-server",
"language-server-protocol",
"metals",
"dotty",
)
apmEngines := Map("atom" -> ">=1.25.0 <2.0.0")
apmDependencies := Map(
"atom-languageclient" -> "0.9.9",
"atom-package-deps" -> "5.0.0",
"@atom/source-map-support" -> "0.3.4",
"minimatch" -> "3.0.4",
)
apmConsumedServices := Map(
"linter-indie" -> Map("2.0.0" -> "consumeLinterV2"),
"datatip" -> Map("0.1.0" -> "consumeDatatip"),
"atom-ide-busy-signal" -> Map("0.1.0" -> "consumeBusySignal"),
"signature-help" -> Map("0.1.0" -> "consumeSignatureHelp"),
"console" -> Map("0.1.0" -> "consumeConsole"),
"status-bar" -> Map("^1.0.0" -> "consumeStatusBar"),
)
apmProvidedServices := Map(
"definitions" -> Map("0.1.0" -> "provideDefinitions"),
"code-highlight" -> Map("0.1.0" -> "provideCodeHighlight"),
"code-actions" -> Map("0.1.0" -> "provideCodeActions"),
"hyperclick" -> Map("0.1.0" -> "provideHyperclick"),
"find-references" -> Map("0.1.0" -> "provideFindReferences"),
"autocomplete.provider" -> Map("2.0.0" -> "provideAutocomplete"),
"code-format.range" -> Map("0.1.0" -> "provideCodeFormat"),
"outline-view" -> Map("0.1.0" -> "provideOutlines")
)
apmJsonExtra := Json.obj(
"enhancedScopes" -> Json.arr(
"source.scala"
),
"package-deps" -> Json.arr(
"language-scala",
"atom-ide-ui"
),
"activationHooks" -> Json.arr(
"language-scala:grammar-used"
)
)
apmExtraFiles ++= Seq(
getCoursier.value
)
// Main task that packages this Atom plugin
sbt.Keys.`package` in Compile :=
packageBin.in(Compile)
.dependsOn(getCoursier)
.value
ghreleaseAssets := Seq(
(artifactPath in (Compile, fullOptJS)).value,
packageJson.value
)