Merge pull request #5109 from eatkins/meta-build-sources

Fix checkbuild sources for projects with meta-meta-build
This commit is contained in:
Ethan Atkins 2019-09-21 12:25:59 -07:00 committed by GitHub
commit d53eabf9a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -67,14 +67,14 @@ private[sbt] object CheckBuildSources {
@tailrec
def projectGlobs(projectDir: File, globs: Seq[Glob]): Seq[Glob] = {
val glob = projectDir.toGlob
val base = Seq(
val updatedGlobs = globs ++ Seq(
glob / "*.{sbt,scala,java}",
// We only want to recursively look in source because otherwise we have to search
// the project target directories which is expensive.
glob / "src" / ** / "*.{scala,java}"
)
val nextLevel = projectDir / "project"
if (nextLevel.exists) projectGlobs(nextLevel, base) else base
if (nextLevel.exists) projectGlobs(nextLevel, updatedGlobs) else updatedGlobs
}
projectGlobs(projectDir, baseDir.toGlob / "*.sbt" :: Nil)
} else Nil

View File

@ -29,3 +29,7 @@ $ copy-file changes/sub.sbt sub/build.sbt
$ copy-file changes/ScalafmtVersion.scala project/project/ScalafmtVersion.scala
> scalafmt
$ delete project/plugins.sbt
-> scalafmt