File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
sbt-dotty/src/dotty/tools/sbtplugin Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,13 @@ import scala.collection.mutable
2020 * temporary directory as class files.
2121 */
2222final class TastyFileManager extends ClassFileManager {
23- private [this ] val tempDir = Files .createTempDirectory(" backup" ).toFile
23+ private [this ] var _tempDir : File = null
24+ private [this ] def tempDir = {
25+ if (_tempDir == null ) {
26+ _tempDir = Files .createTempDirectory(" backup" ).toFile
27+ }
28+ _tempDir
29+ }
2430
2531 private [this ] val generatedTastyFiles = new mutable.HashSet [File ]
2632 private [this ] val movedTastyFiles = new mutable.HashMap [File , File ]
@@ -42,7 +48,10 @@ final class TastyFileManager extends ClassFileManager {
4248 IO .deleteFilesEmptyDirs(generatedTastyFiles)
4349 for ((orig, tmp) <- movedTastyFiles) IO .move(tmp, orig)
4450 }
45- IO .delete(tempDir)
51+ if (_tempDir != null ) {
52+ IO .delete(tempDir)
53+ _tempDir = null
54+ }
4655 }
4756
4857 private def tastyFiles (classes : Array [File ]): Array [File ] = {
You can’t perform that action at this time.
0 commit comments