Skip to content

Commit cf6eee4

Browse files
committed
Fix discovery of project file for exclude
pick the outermost project file, so that if an excluded directory is itself a scala-cli project then it is ignored. fixes #3546
1 parent 020e601 commit cf6eee4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/build/src/main/scala/scala/build/CrossSources.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,9 @@ object CrossSources {
190190

191191
val flattenedInputs = inputs.flattened()
192192
val allExclude = { // supports only one exclude directive in one source file, which should be the project file.
193-
val projectScalaFileOpt = flattenedInputs.collectFirst {
193+
val projectScalaFileOpt = flattenedInputs.collect {
194194
case f: ProjectScalaFile => f
195-
}
195+
}.sortBy(_.subPath.segments.size).headOption
196196
val excludeFromProjectFile =
197197
value(preprocessSources(projectScalaFileOpt.toSeq))
198198
.flatMap(_.options).flatMap(_.internal.exclude)

0 commit comments

Comments
 (0)