[2.x] fix: Create `project` directory if extra sbt files are added to the meta-build #8570 (#8586)

This commit is contained in:
azdrojowa123 2026-01-20 16:02:58 +01:00 committed by GitHub
parent 6f14de514b
commit 6493707d2f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 2 deletions

View File

@ -1411,9 +1411,12 @@ private[sbt] object Load {
val extraSbtFiles: Seq[VirtualFile] =
if (isMetaBuildContext(context)) s.get(BasicKeys.extraMetaSbtFiles).getOrElse(Nil)
else Nil
if (hasDefinition(dir) || extraSbtFiles.nonEmpty)
if (hasDefinition(dir) || extraSbtFiles.nonEmpty) {
if (extraSbtFiles.nonEmpty && !dir.exists()) {
IO.createDirectory(dir)
}
buildPlugins(dir, s, enableSbtPlugin(activateGlobalPlugin(config)))
else
} else
noPlugins(dir, config)
}