diff --git a/scalalib/src/mill/scalalib/JavaModule.scala b/scalalib/src/mill/scalalib/JavaModule.scala index ab4f8795a94..fc01dceb6d6 100644 --- a/scalalib/src/mill/scalalib/JavaModule.scala +++ b/scalalib/src/mill/scalalib/JavaModule.scala @@ -135,11 +135,12 @@ trait JavaModule extends mill.Module with TaskModule { outer => def allSources = T{ sources() ++ generatedSources() } def allSourceFiles = T{ + def isHiddenFile(path: Path) = path.segments.last.startsWith(".") for { root <- allSources() if exists(root.path) path <- (if (root.path.isDir) ls.rec(root.path) else Seq(root.path)) - if path.isFile && (path.ext == "scala" || path.ext == "java") + if path.isFile && ((path.ext == "scala" || path.ext == "java") && !isHiddenFile(path)) } yield PathRef(path) }