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
20
20
* temporary directory as class files.
21
21
*/
22
22
final 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
+ }
24
30
25
31
private [this ] val generatedTastyFiles = new mutable.HashSet [File ]
26
32
private [this ] val movedTastyFiles = new mutable.HashMap [File , File ]
@@ -42,7 +48,10 @@ final class TastyFileManager extends ClassFileManager {
42
48
IO .deleteFilesEmptyDirs(generatedTastyFiles)
43
49
for ((orig, tmp) <- movedTastyFiles) IO .move(tmp, orig)
44
50
}
45
- IO .delete(tempDir)
51
+ if (_tempDir != null ) {
52
+ IO .delete(tempDir)
53
+ _tempDir = null
54
+ }
46
55
}
47
56
48
57
private def tastyFiles (classes : Array [File ]): Array [File ] = {
You can’t perform that action at this time.
0 commit comments