@@ -1093,19 +1093,23 @@ object Build {
10931093 IO .createDirectory(trgDir)
10941094 IO .unzip(scalaLibrarySourcesJar, trgDir)
10951095
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
10971111 } (Set (scalaLibrarySourcesJar)).toSeq
10981112 }.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- }),
11091113 (Compile / sources) := {
11101114 val files = (Compile / sources).value
11111115 val overwrittenSourcesDir = (Compile / scalaSource).value
0 commit comments