Files
sbt/notes/2.0.0/migration.md
T
Jozef Koval 8e3c25c1f1 [2.x] fix: Make forked run inherit sbt's working directory (#9442)
forked run used the project's baseDirectory as the working directory, while non-forked execution inherits sbt's own working directory — so toggling fork silently changed how relative paths resolved.

forked run (and forked console) now inherit sbt's working directory, consistent with non-forked execution and `sbtn` expectations.
2026-07-26 14:48:37 -04:00

21 lines
508 B
Markdown

## Forked run working directory
Forked `run` no longer runs in the project's `baseDirectory`; it inherits sbt's
working directory, matching non-forked behavior. Forked `test` is unchanged. To
restore the sbt 1.x behavior:
```scala
Compile / run / forkOptions := Def.uncached(
(Compile / run / forkOptions).value.withWorkingDirectory(Some(baseDirectory.value))
)
```
## files extension on Classpath
```scala
+ given FileConverter = fileConverter.value
val cp = (Compile / classpath).value.files
```