@@ -1093,19 +1093,23 @@ object Build {
1093
1093
IO .createDirectory(trgDir)
1094
1094
IO .unzip(scalaLibrarySourcesJar, trgDir)
1095
1095
1096
- ((trgDir ** " *.scala" ) +++ (trgDir ** " *.java" )).get.toSet
1096
+ val (ignoredSources, sources) =
1097
+ ((trgDir ** " *.scala" ) +++ (trgDir ** " *.java" )).get.toSet
1098
+ .partition{file =>
1099
+ // sources from https://github.com/scala/scala/tree/2.13.x/src/library-aux
1100
+ val path = file.getPath.replace('\\ ' , '/' )
1101
+ path.endsWith(" scala-library-src/scala/Any.scala" ) ||
1102
+ path.endsWith(" scala-library-src/scala/AnyVal.scala" ) ||
1103
+ path.endsWith(" scala-library-src/scala/AnyRef.scala" ) ||
1104
+ path.endsWith(" scala-library-src/scala/Nothing.scala" ) ||
1105
+ path.endsWith(" scala-library-src/scala/Null.scala" ) ||
1106
+ path.endsWith(" scala-library-src/scala/Singleton.scala" )
1107
+ }
1108
+ // These sources should be never compiled, filtering them out was not working correctly sometimes
1109
+ ignoredSources.foreach(_.delete())
1110
+ sources
1097
1111
} (Set (scalaLibrarySourcesJar)).toSeq
1098
1112
}.taskValue,
1099
- (Compile / sources) ~= (_.filterNot { file =>
1100
- // sources from https://github.com/scala/scala/tree/2.13.x/src/library-aux
1101
- val path = file.getPath.replace('\\ ' , '/' )
1102
- path.endsWith(" scala-library-src/scala/Any.scala" ) ||
1103
- path.endsWith(" scala-library-src/scala/AnyVal.scala" ) ||
1104
- path.endsWith(" scala-library-src/scala/AnyRef.scala" ) ||
1105
- path.endsWith(" scala-library-src/scala/Nothing.scala" ) ||
1106
- path.endsWith(" scala-library-src/scala/Null.scala" ) ||
1107
- path.endsWith(" scala-library-src/scala/Singleton.scala" )
1108
- }),
1109
1113
(Compile / sources) := {
1110
1114
val files = (Compile / sources).value
1111
1115
val overwrittenSourcesDir = (Compile / scalaSource).value
0 commit comments