11import java .io .File
22import java .nio .file ._
33
4+ import Process ._
45import Modes ._
56import ScaladocGeneration ._
67import com .jsuereth .sbtpgp .PgpKeys
@@ -16,8 +17,6 @@ import xerial.sbt.pack.PackPlugin
1617import xerial .sbt .pack .PackPlugin .autoImport ._
1718import xerial .sbt .Sonatype .autoImport ._
1819import com .typesafe .tools .mima .plugin .MimaPlugin .autoImport ._
19- import dotty .tools .sbtplugin .DottyIDEPlugin .{installCodeExtension , prepareCommand , runProcess }
20- import dotty .tools .sbtplugin .DottyIDEPlugin .autoImport ._
2120import org .scalajs .sbtplugin .ScalaJSPlugin
2221import org .scalajs .sbtplugin .ScalaJSPlugin .autoImport ._
2322import sbtbuildinfo .BuildInfoPlugin
@@ -52,10 +51,6 @@ object DottyJSPlugin extends AutoPlugin {
5251
5352 // Typecheck the Scala.js IR found on the classpath
5453 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
5954 )
6055}
6156
@@ -154,9 +149,6 @@ object Build {
154149 // Compiles the documentation and static site
155150 val genDocs = inputKey[Unit ](" run scaladoc to generate static documentation site" )
156151
157- // Only available in vscode-dotty
158- val unpublish = taskKey[Unit ](" Unpublish a package" )
159-
160152 // Settings used to configure the test language server
161153 val ideTestsCompilerVersion = taskKey[String ](" Compiler version to use in IDE tests" )
162154 val ideTestsCompilerArguments = taskKey[Seq [String ]](" Compiler arguments to use in IDE tests" )
@@ -183,11 +175,6 @@ object Build {
183175
184176 (Compile / compile / javacOptions) ++= Seq (" -Xlint:unchecked" , " -Xlint:deprecation" ),
185177
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-
191178 // Avoid various sbt craziness involving classloaders and parallelism
192179 run / fork := true ,
193180 Test / fork := true ,
@@ -285,7 +272,6 @@ object Build {
285272 crossPaths := false ,
286273 // Do not depend on the Scala library
287274 autoScalaLibrary := false ,
288- excludeFromIDE := true ,
289275 disableDocSetting
290276 )
291277
@@ -315,7 +301,6 @@ object Build {
315301
316302 version := dottyNonBootstrappedVersion,
317303 scalaVersion := referenceVersion,
318- excludeFromIDE := true ,
319304
320305 disableDocSetting
321306 )
@@ -1033,23 +1018,6 @@ object Build {
10331018 // Work around https://github.com/eclipse/lsp4j/issues/295
10341019 dependencyOverrides += " org.eclipse.xtend" % " org.eclipse.xtend.lib" % " 2.16.0" ,
10351020 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
10531021 ).
10541022 settings(
10551023 ideTestsCompilerVersion := (`scala3-compiler` / version).value,
@@ -1456,60 +1424,6 @@ object Build {
14561424 ).evaluated
14571425 )
14581426
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-
15131427 lazy val `sbt-community-build` = project.in(file(" sbt-community-build" )).
15141428 enablePlugins(SbtPlugin ).
15151429 settings(commonSettings).
@@ -1902,4 +1816,4 @@ object ScaladocConfigs {
19021816 .add(ApiSubdirectory (true ))
19031817 .withTargets(roots)
19041818 }
1905- }
1819+ }
0 commit comments