Skip to content

Commit a213301

Browse files
committed
fix build.sbt and windows tests
1 parent 5d7a160 commit a213301

File tree

3 files changed

+30
-31
lines changed

3 files changed

+30
-31
lines changed

presentation-compiler/test/dotty/tools/pc/base/BasePcDefinitionSuite.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ import dotty.tools.pc.utils.TextEdits
1212

1313
import org.eclipse.lsp4j.TextEdit
1414
import org.eclipse.lsp4j as l
15+
import java.nio.file.Paths
1516

1617
abstract class BasePcDefinitionSuite extends BasePCSuite:
1718

1819
def definitions(offsetParams: OffsetParams): List[l.Location]
1920

2021
def check(original: String): Unit =
2122
val filename = "A.scala"
22-
val uri = s"file:///$filename"
23+
val uri = Paths.get(filename).toUri
2324

2425
val (_, offset) = params(original.removeRanges, filename)
2526
val cleanedCode = original.removeRanges.removePos
@@ -30,10 +31,10 @@ abstract class BasePcDefinitionSuite extends BasePCSuite:
3031
).toLsp
3132

3233
val locs = definitions(
33-
CompilerOffsetParams(URI.create(uri), cleanedCode, offset)
34+
CompilerOffsetParams(uri, cleanedCode, offset)
3435
)
3536
val edits = locs.flatMap { location =>
36-
if (location.getUri() == uri) {
37+
if (location.getUri() == uri.toString) {
3738
List(
3839
new TextEdit(
3940
new l.Range(

presentation-compiler/test/dotty/tools/pc/tests/completion/CompletionSuite.scala

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -256,16 +256,9 @@ class CompletionSuite extends BaseCompletionSuite:
256256
|""".stripMargin,
257257
"""|Path - java.nio.file
258258
|Paths - java.nio.file
259-
|XPath - javax.xml.xpath
260-
|Path2D - java.awt.geom
261-
|CertPath - java.security.cert
262-
|TreePath - javax.swing.tree
263-
|XPathType - javax.xml.crypto.dsig.spec
264-
|LayoutPath - java.awt.font
265-
|XPathNodes - javax.xml.xpath
266259
|PathMatcher - java.nio.file
267-
|XPathResult - org.w3c.dom.xpath
268-
|""".stripMargin
260+
|""".stripMargin,
261+
filter = _.contains("java.nio.file")
269262
)
270263

271264
@Test def import4 =

project/Build.scala

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,11 +1076,30 @@ object Build {
10761076
case Bootstrapped => `scala3-presentation-compiler-bootstrapped`
10771077
}
10781078

1079+
def scala3PresentationCompilerBuildInfo(implicit mode: Mode) =
1080+
Seq(
1081+
ideTestsDependencyClasspath := {
1082+
val dottyLib = (dottyLibrary / Compile / classDirectory).value
1083+
val scalaLib =
1084+
(dottyLibrary / Compile / dependencyClasspath)
1085+
.value
1086+
.map(_.data)
1087+
.filter(_.getName.matches("scala-library.*\\.jar"))
1088+
.toList
1089+
dottyLib :: scalaLib
1090+
// Nil
1091+
},
1092+
Compile / buildInfoPackage := "dotty.tools.pc.util",
1093+
Compile / buildInfoKeys := Seq(scalaVersion),
1094+
Test / buildInfoKeys := Seq(scalaVersion, ideTestsDependencyClasspath)
1095+
) ++ BuildInfoPlugin.buildInfoScopedSettings(Compile) ++
1096+
BuildInfoPlugin.buildInfoScopedSettings(Test) ++
1097+
BuildInfoPlugin.buildInfoDefaultSettings
1098+
10791099
lazy val presentationCompilerSettings = {
10801100
val mtagsVersion = "0.11.12+45-45df705d-SNAPSHOT" // Will be set to stable release after 0.11.13 is published
10811101

10821102
Seq(
1083-
moduleName := "scala3-presentation-compiler",
10841103
libraryDependencies ++= Seq(
10851104
"org.lz4" % "lz4-java" % "1.8.0",
10861105
"io.get-coursier" % "interface" % "1.0.13",
@@ -1121,22 +1140,7 @@ object Build {
11211140
mtagsSharedSources
11221141
} (Set(mtagsSharedSourceJar)).toSeq
11231142
}.taskValue,
1124-
ideTestsDependencyClasspath := {
1125-
val dottyLib = (`scala3-library-bootstrapped` / Compile / classDirectory).value
1126-
val scalaLib =
1127-
(`scala3-library-bootstrapped` / Compile / dependencyClasspath)
1128-
.value
1129-
.map(_.data)
1130-
.filter(_.getName.matches("scala-library.*\\.jar"))
1131-
.toList
1132-
dottyLib :: scalaLib
1133-
},
1134-
Compile / buildInfoPackage := "dotty.tools.pc.util",
1135-
Compile / buildInfoKeys := Seq(scalaVersion),
1136-
Test / buildInfoKeys := Seq(scalaVersion, ideTestsDependencyClasspath)
1137-
) ++ BuildInfoPlugin.buildInfoScopedSettings(Compile) ++
1138-
BuildInfoPlugin.buildInfoScopedSettings(Test) ++
1139-
BuildInfoPlugin.buildInfoDefaultSettings
1143+
)
11401144
}
11411145

11421146
lazy val `scala3-language-server` = project.in(file("language-server")).
@@ -1938,8 +1942,9 @@ object Build {
19381942
enablePlugins(JmhPlugin)
19391943

19401944
def asScala3PresentationCompiler(implicit mode: Mode): Project = project.withCommonSettings.
1941-
dependsOn(dottyCompiler).
1942-
settings(presentationCompilerSettings)
1945+
dependsOn(dottyCompiler, dottyLibrary).
1946+
settings(presentationCompilerSettings).
1947+
settings(scala3PresentationCompilerBuildInfo)
19431948

19441949
def asDist(implicit mode: Mode): Project = project.
19451950
enablePlugins(PackPlugin).

0 commit comments

Comments
 (0)