Skip to content

Commit 197f8b4

Browse files
committed
Fix sbt 0.13 support
1 parent a0eb674 commit 197f8b4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

launcher-implementation/src/main/scala/xsbt/boot/CoursierUpdate.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,12 @@ class CousierUpdate(config: UpdateConfiguration):
204204
val depVersion: Option[String] = target match
205205
case _: UpdateScala => scalaVersion
206206
case u: UpdateApp => Some(Value.get(u.id.version))
207+
val isSbt = target match
208+
case _: UpdateScala => false
209+
case u: UpdateApp => Some(Value.get(u.id.name)) == Some("sbt")
210+
val isZeroDot = depVersion match
211+
case Some(v) => v.startsWith("0.")
212+
case _ => false
207213
if !retrieveDir.exists then Files.createDirectories(retrieveDir.toPath)
208214
val downloadedJars = Fetch()
209215
.withCache(coursierCache)
@@ -220,6 +226,10 @@ class CousierUpdate(config: UpdateConfiguration):
220226
case n if n.startsWith("scala-reflect") => "scala-reflect.jar"
221227
case n => n
222228
new File(retrieveDir, name)
229+
else if isSbt && downloaded.getName == "interface.jar" && isZeroDot then
230+
val componentDir = new File(retrieveDir, "xsbti")
231+
Files.createDirectories(componentDir.toPath)
232+
new File(componentDir, downloaded.getName)
223233
else
224234
val name = downloaded.getName match
225235
// https://github.com/sbt/sbt/issues/6432

0 commit comments

Comments
 (0)