@@ -249,22 +249,22 @@ object Build {
249
249
// Compile using the non-bootstrapped and non-published dotty
250
250
managedScalaInstance := false ,
251
251
scalaInstance := {
252
- val updateResult = update.value
253
- val (libraryJar, compilerJar) =
254
- if (bootstrapFromPublishedJars.value) {
255
- val jars = updateResult.select(
252
+ val updateReport = update.value
253
+ var libraryJar = packageBin.in(`dotty-library`, Compile ).value
254
+ var compilerJar = packageBin.in(`dotty-compiler`, Compile ).value
255
+
256
+ if (bootstrapFromPublishedJars.value) {
257
+ val jars = updateReport.select(
256
258
configuration = configurationFilter(Configurations .ScalaTool .name),
257
259
module = moduleFilter(),
258
260
artifact = artifactFilter(extension = " jar" )
259
261
)
260
- (jars.find(_.getName.startsWith(" dotty-library_2.12" )).get,
261
- jars.find(_.getName.startsWith(" dotty-compiler_2.12" )).get)
262
- } else
263
- ((packageBin in (`dotty-library`, Compile )).value: @ sbtUnchecked,
264
- (packageBin in (`dotty-compiler`, Compile )).value: @ sbtUnchecked)
262
+ libraryJar = jars.find(_.getName.startsWith(" dotty-library_2.12" )).get
263
+ compilerJar = jars.find(_.getName.startsWith(" dotty-compiler_2.12" )).get
264
+ }
265
265
266
266
// All compiler dependencies except the library
267
- val otherDependencies = ( dependencyClasspath in (`dotty-compiler`, Compile ) ).value
267
+ val otherDependencies = dependencyClasspath.in (`dotty-compiler`, Compile ).value
268
268
.filterNot(_.get(artifact.key).exists(_.name == " dotty-library" ))
269
269
.map(_.data)
270
270
@@ -362,8 +362,8 @@ object Build {
362
362
val dottyInterfaces = jars(" dotty-interfaces" )
363
363
val otherDeps = (dependencyClasspath in Compile ).value.map(_.data).mkString(" :" )
364
364
val sources =
365
- ( unmanagedSources in (Compile , compile) ).value ++
366
- ( unmanagedSources in (`dotty-compiler`, Compile ) ).value
365
+ unmanagedSources.in (Compile , compile).value ++
366
+ unmanagedSources.in (`dotty-compiler`, Compile ).value
367
367
val args = Seq (
368
368
" -siteroot" , " docs" ,
369
369
" -project" , " Dotty" ,
@@ -488,7 +488,7 @@ object Build {
488
488
" org.scala-lang.modules" % " scala-asm" % " 6.0.0-scala-1" , // used by the backend
489
489
(" org.scala-lang.modules" %% " scala-xml" % " 1.0.6" ).withDottyCompat(scalaVersion.value),
490
490
" org.scala-lang" % " scala-library" % scalacVersion % " test" ,
491
- Dependencies .`compiler-interface` ,
491
+ Dependencies .compilerInterface(sbtVersion.value) ,
492
492
),
493
493
494
494
// For convenience, change the baseDirectory when running the compiler
@@ -675,19 +675,19 @@ object Build {
675
675
// packageAll packages all and then returns a map with the abs location
676
676
packageAll := {
677
677
Map (
678
- " dotty-interfaces" -> ( packageBin in (`dotty-interfaces`, Compile ) ).value,
679
- " dotty-compiler" -> ( packageBin in Compile ).value,
680
- " dotty-library" -> ( packageBin in (`dotty-library`, Compile ) ).value,
681
- " dotty-compiler-test" -> ( packageBin in Test ).value
678
+ " dotty-interfaces" -> packageBin.in (`dotty-interfaces`, Compile ).value,
679
+ " dotty-compiler" -> packageBin.in( Compile ).value,
680
+ " dotty-library" -> packageBin.in (`dotty-library`, Compile ).value,
681
+ " dotty-compiler-test" -> packageBin.in( Test ).value
682
682
).mapValues(_.getAbsolutePath)
683
683
}
684
684
)
685
685
686
686
lazy val bootstrapedDottyCompilerSettings = commonDottyCompilerSettings ++ Seq (
687
687
packageAll := {
688
- ( packageAll in `dotty-compiler`).value ++ Seq (
689
- ( " dotty-compiler" -> ( packageBin in Compile ).value.getAbsolutePath) ,
690
- ( " dotty-library" -> ( packageBin in (`dotty-library-bootstrapped`, Compile )) .value.getAbsolutePath)
688
+ packageAll.in( `dotty-compiler`).value ++ Seq (
689
+ " dotty-compiler" -> packageBin.in( Compile ).value.getAbsolutePath,
690
+ " dotty-library" -> packageBin.in (`dotty-library-bootstrapped`, Compile ).value.getAbsolutePath
691
691
)
692
692
}
693
693
)
@@ -738,8 +738,8 @@ object Build {
738
738
description := " sbt compiler bridge for Dotty" ,
739
739
resolvers += Resolver .typesafeIvyRepo(" releases" ), // For org.scala-sbt:api
740
740
libraryDependencies ++= Seq (
741
- Dependencies .`compiler-interface` ,
742
- (Dependencies .`zinc-apiinfo` % Test ).withDottyCompat(scalaVersion.value),
741
+ Dependencies .compilerInterface(sbtVersion.value) ,
742
+ (Dependencies .zincApiinfo(sbtVersion.value) % Test ).withDottyCompat(scalaVersion.value),
743
743
(" org.specs2" %% " specs2-core" % " 3.9.1" % Test ).withDottyCompat(scalaVersion.value),
744
744
(" org.specs2" %% " specs2-junit" % " 3.9.1" % Test ).withDottyCompat(scalaVersion.value)
745
745
),
@@ -836,7 +836,7 @@ object Build {
836
836
// Keep in sync with inject-sbt-dotty.sbt
837
837
libraryDependencies ++= Seq (
838
838
Dependencies .`jackson-databind`,
839
- Dependencies .`compiler-interface`
839
+ Dependencies .compilerInterface(sbtVersion.value)
840
840
),
841
841
unmanagedSourceDirectories in Compile +=
842
842
baseDirectory.value / " ../language-server/src/dotty/tools/languageserver/config" ,
@@ -871,12 +871,13 @@ object Build {
871
871
includeFilter in unmanagedSources := NothingFilter | " *.ts" | " **.json" ,
872
872
watchSources in Global ++= (unmanagedSources in Compile ).value,
873
873
compile in Compile := {
874
- val coursier = baseDirectory.value / " out/coursier"
875
- val packageJson = baseDirectory.value / " package.json"
874
+ val workingDir = baseDirectory.value
875
+ val coursier = workingDir / " out/coursier"
876
+ val packageJson = workingDir / " package.json"
876
877
if (! coursier.exists || packageJson.lastModified > coursier.lastModified)
877
- runProcess(Seq (" npm" , " run" , " update-all" ), wait = true , directory = baseDirectory.value : @ sbtUnchecked )
878
+ runProcess(Seq (" npm" , " run" , " update-all" ), wait = true , directory = workingDir )
878
879
val tsc = baseDirectory.value / " node_modules" / " .bin" / " tsc"
879
- runProcess(Seq (tsc.getAbsolutePath, " --pretty" , " --project" , baseDirectory.value .getAbsolutePath), wait = true )
880
+ runProcess(Seq (tsc.getAbsolutePath, " --pretty" , " --project" , workingDir .getAbsolutePath), wait = true )
880
881
881
882
// Currently, vscode-dotty depends on daltonjorge.scala for syntax highlighting,
882
883
// this is not automatically installed when starting the extension in development mode
0 commit comments