1
1
import java .io .File
2
2
import java .nio .file ._
3
3
4
+ import Process ._
4
5
import Modes ._
5
6
import ScaladocGeneration ._
6
7
import com .jsuereth .sbtpgp .PgpKeys
@@ -16,8 +17,6 @@ import xerial.sbt.pack.PackPlugin
16
17
import xerial .sbt .pack .PackPlugin .autoImport ._
17
18
import xerial .sbt .Sonatype .autoImport ._
18
19
import com .typesafe .tools .mima .plugin .MimaPlugin .autoImport ._
19
- import dotty .tools .sbtplugin .DottyIDEPlugin .{installCodeExtension , prepareCommand , runProcess }
20
- import dotty .tools .sbtplugin .DottyIDEPlugin .autoImport ._
21
20
import org .scalajs .sbtplugin .ScalaJSPlugin
22
21
import org .scalajs .sbtplugin .ScalaJSPlugin .autoImport ._
23
22
import sbtbuildinfo .BuildInfoPlugin
@@ -52,10 +51,6 @@ object DottyJSPlugin extends AutoPlugin {
52
51
53
52
// Typecheck the Scala.js IR found on the classpath
54
53
scalaJSLinkerConfig ~= (_.withCheckIR(true )),
55
-
56
- // Exclude all these projects from `configureIDE/launchIDE` since they
57
- // take time to compile, print a bunch of warnings, and are rarely edited.
58
- excludeFromIDE := true
59
54
)
60
55
}
61
56
@@ -154,9 +149,6 @@ object Build {
154
149
// Compiles the documentation and static site
155
150
val genDocs = inputKey[Unit ](" run scaladoc to generate static documentation site" )
156
151
157
- // Only available in vscode-dotty
158
- val unpublish = taskKey[Unit ](" Unpublish a package" )
159
-
160
152
// Settings used to configure the test language server
161
153
val ideTestsCompilerVersion = taskKey[String ](" Compiler version to use in IDE tests" )
162
154
val ideTestsCompilerArguments = taskKey[Seq [String ]](" Compiler arguments to use in IDE tests" )
@@ -183,11 +175,6 @@ object Build {
183
175
184
176
(Compile / compile / javacOptions) ++= Seq (" -Xlint:unchecked" , " -Xlint:deprecation" ),
185
177
186
- // Override `runCode` from DottyIDEPlugin to use the language-server and
187
- // vscode extension from the source repository of dotty instead of a
188
- // published version.
189
- runCode := (`scala3-language-server` / run).toTask(" " ).value,
190
-
191
178
// Avoid various sbt craziness involving classloaders and parallelism
192
179
run / fork := true ,
193
180
Test / fork := true ,
@@ -285,7 +272,6 @@ object Build {
285
272
crossPaths := false ,
286
273
// Do not depend on the Scala library
287
274
autoScalaLibrary := false ,
288
- excludeFromIDE := true ,
289
275
disableDocSetting
290
276
)
291
277
@@ -315,7 +301,6 @@ object Build {
315
301
316
302
version := dottyNonBootstrappedVersion,
317
303
scalaVersion := referenceVersion,
318
- excludeFromIDE := true ,
319
304
320
305
disableDocSetting
321
306
)
@@ -1033,23 +1018,6 @@ object Build {
1033
1018
// Work around https://github.com/eclipse/lsp4j/issues/295
1034
1019
dependencyOverrides += " org.eclipse.xtend" % " org.eclipse.xtend.lib" % " 2.16.0" ,
1035
1020
javaOptions := (`scala3-compiler-bootstrapped` / javaOptions).value,
1036
-
1037
- run := Def .inputTaskDyn {
1038
- val inputArgs = spaceDelimited(" <arg>" ).parsed
1039
-
1040
- val mainClass = " dotty.tools.languageserver.Main"
1041
- val extensionPath = (`vscode-dotty` / baseDirectory).value.getAbsolutePath
1042
-
1043
- val codeArgs =
1044
- s " --extensionDevelopmentPath= $extensionPath" +:
1045
- (if (inputArgs.isEmpty) List ((baseDirectory.value / " .." ).getAbsolutePath) else inputArgs)
1046
-
1047
- val clientCommand = prepareCommand(codeCommand.value ++ codeArgs)
1048
-
1049
- val allArgs = " -client_command" +: clientCommand
1050
-
1051
- runTask(Runtime , mainClass, allArgs : _* )
1052
- }.dependsOn((`vscode-dotty` / Compile / compile)).evaluated
1053
1021
).
1054
1022
settings(
1055
1023
ideTestsCompilerVersion := (`scala3-compiler` / version).value,
@@ -1456,60 +1424,6 @@ object Build {
1456
1424
).evaluated
1457
1425
)
1458
1426
1459
- lazy val `vscode-dotty` = project.in(file(" vscode-dotty" )).
1460
- settings(commonSettings).
1461
- settings(
1462
- version := " 0.1.17-snapshot" , // Keep in sync with package.json
1463
- autoScalaLibrary := false ,
1464
- publishArtifact := false ,
1465
- bspEnabled := false ,
1466
- (Compile / resourceGenerators) += Def .task {
1467
- // Resources that will be copied when bootstrapping a new project
1468
- val buildSbtFile = baseDirectory.value / " out" / " build.sbt"
1469
- IO .write(buildSbtFile,
1470
- s """ scalaVersion := " $publishedDottyVersion" """ )
1471
- val dottyPluginSbtFile = baseDirectory.value / " out" / " scala3-plugin.sbt"
1472
- IO .write(dottyPluginSbtFile,
1473
- s """ addSbtPlugin(" $dottyOrganization" % "sbt-dotty" % " $sbtDottyVersion") """ )
1474
- Seq (buildSbtFile, dottyPluginSbtFile)
1475
- },
1476
- Compile / compile := Def .task {
1477
- val workingDir = baseDirectory.value
1478
- val coursier = workingDir / " out" / " coursier"
1479
- val packageJson = workingDir / " package.json"
1480
- if (! coursier.exists || packageJson.lastModified > coursier.lastModified)
1481
- runProcess(Seq (" npm" , " install" ), wait = true , directory = Some (workingDir))
1482
- val tsc = workingDir / " node_modules" / " .bin" / " tsc"
1483
- runProcess(Seq (tsc.getAbsolutePath, " --pretty" , " --project" , workingDir.getAbsolutePath), wait = true )
1484
-
1485
- // vscode-dotty depends on scala-lang.scala for syntax highlighting,
1486
- // this is not automatically installed when starting the extension in development mode
1487
- // (--extensionDevelopmentPath=...)
1488
- installCodeExtension(codeCommand.value, " scala-lang.scala" )
1489
-
1490
- sbt.internal.inc.Analysis .Empty
1491
- }.dependsOn((Compile / managedResources)).value,
1492
- sbt.Keys .`package`:= {
1493
- runProcess(Seq (" vsce" , " package" ), wait = true , directory = Some (baseDirectory.value))
1494
-
1495
- baseDirectory.value / s " dotty- ${version.value}.vsix "
1496
- },
1497
- unpublish := {
1498
- runProcess(Seq (" vsce" , " unpublish" ), wait = true , directory = Some (baseDirectory.value))
1499
- },
1500
- publish := {
1501
- runProcess(Seq (" vsce" , " publish" ), wait = true , directory = Some (baseDirectory.value))
1502
- },
1503
- run := Def .inputTask {
1504
- val inputArgs = spaceDelimited(" <arg>" ).parsed
1505
- val codeArgs = if (inputArgs.isEmpty) List ((baseDirectory.value / " .." ).getAbsolutePath) else inputArgs
1506
- val extensionPath = baseDirectory.value.getAbsolutePath
1507
- val processArgs = List (s " --extensionDevelopmentPath= $extensionPath" ) ++ codeArgs
1508
-
1509
- runProcess(codeCommand.value ++ processArgs, wait = true )
1510
- }.dependsOn((Compile / compile)).evaluated
1511
- )
1512
-
1513
1427
lazy val `sbt-community-build` = project.in(file(" sbt-community-build" )).
1514
1428
enablePlugins(SbtPlugin ).
1515
1429
settings(commonSettings).
@@ -1902,4 +1816,4 @@ object ScaladocConfigs {
1902
1816
.add(ApiSubdirectory (true ))
1903
1817
.withTargets(roots)
1904
1818
}
1905
- }
1819
+ }
0 commit comments