File tree 1 file changed +5
-6
lines changed
sbt-dotty/src/dotty/tools/sbtplugin 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -79,15 +79,15 @@ object DottyPlugin extends AutoPlugin {
79
79
}
80
80
}
81
81
82
- /** Patches the IncOptions so that .tasty files are pruned as needed.
82
+ /** Patches the IncOptions so that .tasty and .hasTasty files are pruned as needed.
83
83
*
84
84
* This code is adapted from `scalaJSPatchIncOptions` in Scala.js, which needs
85
85
* to do the exact same thing but for classfiles.
86
86
*
87
87
* This complicated logic patches the ClassfileManager factory of the given
88
- * IncOptions with one that is aware of .tasty files emitted by the Dotty
88
+ * IncOptions with one that is aware of .tasty and .hasTasty files emitted by the Dotty
89
89
* compiler. This makes sure that, when a .class file must be deleted, the
90
- * corresponding .tasty file is also deleted.
90
+ * corresponding .tasty and .hasTasty file is also deleted.
91
91
*/
92
92
def dottyPatchIncOptions (incOptions : IncOptions ): IncOptions = {
93
93
val inheritedNewClassfileManager = incOptions.newClassfileManager
@@ -97,9 +97,8 @@ object DottyPlugin extends AutoPlugin {
97
97
def delete (classes : Iterable [File ]): Unit = {
98
98
inherited.delete(classes flatMap { classFile =>
99
99
val dottyFiles = if (classFile.getPath endsWith " .class" ) {
100
- val f = new File (classFile.getAbsolutePath.stripSuffix(" .class" ) + " .tasty" )
101
- if (f.exists) List (f)
102
- else Nil
100
+ val prefix = classFile.getAbsolutePath.stripSuffix(" .class" )
101
+ List (" .tasty" , " .hasTasty" ).map(x => new File (prefix + x)).filter(_.exists)
103
102
} else Nil
104
103
classFile :: dottyFiles
105
104
})
You can’t perform that action at this time.
0 commit comments