Skip to content

Commit 421380c

Browse files
committed
fix build.sbt and windows tests
1 parent 122f36f commit 421380c

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
@@ -1132,11 +1132,30 @@ object Build {
11321132
case Bootstrapped => `scala3-presentation-compiler-bootstrapped`
11331133
}
11341134

1135+
def scala3PresentationCompilerBuildInfo(implicit mode: Mode) =
1136+
Seq(
1137+
ideTestsDependencyClasspath := {
1138+
val dottyLib = (dottyLibrary / Compile / classDirectory).value
1139+
val scalaLib =
1140+
(dottyLibrary / Compile / dependencyClasspath)
1141+
.value
1142+
.map(_.data)
1143+
.filter(_.getName.matches("scala-library.*\\.jar"))
1144+
.toList
1145+
dottyLib :: scalaLib
1146+
// Nil
1147+
},
1148+
Compile / buildInfoPackage := "dotty.tools.pc.util",
1149+
Compile / buildInfoKeys := Seq(scalaVersion),
1150+
Test / buildInfoKeys := Seq(scalaVersion, ideTestsDependencyClasspath)
1151+
) ++ BuildInfoPlugin.buildInfoScopedSettings(Compile) ++
1152+
BuildInfoPlugin.buildInfoScopedSettings(Test) ++
1153+
BuildInfoPlugin.buildInfoDefaultSettings
1154+
11351155
lazy val presentationCompilerSettings = {
11361156
val mtagsVersion = "0.11.12+45-45df705d-SNAPSHOT" // Will be set to stable release after 0.11.13 is published
11371157

11381158
Seq(
1139-
moduleName := "scala3-presentation-compiler",
11401159
libraryDependencies ++= Seq(
11411160
"org.lz4" % "lz4-java" % "1.8.0",
11421161
"io.get-coursier" % "interface" % "1.0.13",
@@ -1177,22 +1196,7 @@ object Build {
11771196
mtagsSharedSources
11781197
} (Set(mtagsSharedSourceJar)).toSeq
11791198
}.taskValue,
1180-
ideTestsDependencyClasspath := {
1181-
val dottyLib = (`scala3-library-bootstrapped` / Compile / classDirectory).value
1182-
val scalaLib =
1183-
(`scala3-library-bootstrapped` / Compile / dependencyClasspath)
1184-
.value
1185-
.map(_.data)
1186-
.filter(_.getName.matches("scala-library.*\\.jar"))
1187-
.toList
1188-
dottyLib :: scalaLib
1189-
},
1190-
Compile / buildInfoPackage := "dotty.tools.pc.util",
1191-
Compile / buildInfoKeys := Seq(scalaVersion),
1192-
Test / buildInfoKeys := Seq(scalaVersion, ideTestsDependencyClasspath)
1193-
) ++ BuildInfoPlugin.buildInfoScopedSettings(Compile) ++
1194-
BuildInfoPlugin.buildInfoScopedSettings(Test) ++
1195-
BuildInfoPlugin.buildInfoDefaultSettings
1199+
)
11961200
}
11971201

11981202
lazy val `scala3-language-server` = project.in(file("language-server")).
@@ -1994,8 +1998,9 @@ object Build {
19941998
enablePlugins(JmhPlugin)
19951999

19962000
def asScala3PresentationCompiler(implicit mode: Mode): Project = project.withCommonSettings.
1997-
dependsOn(dottyCompiler).
1998-
settings(presentationCompilerSettings)
2001+
dependsOn(dottyCompiler, dottyLibrary).
2002+
settings(presentationCompilerSettings).
2003+
settings(scala3PresentationCompilerBuildInfo)
19992004

20002005
def asDist(implicit mode: Mode): Project = project.
20012006
enablePlugins(PackPlugin).

0 commit comments

Comments
 (0)