From 1ee007e56b87b5bf83c24a084b769c71183bc741 Mon Sep 17 00:00:00 2001 From: Nikolay Tatarinov <5min4eq.unity@gmail.com> Date: Mon, 3 Sep 2018 20:30:35 +0300 Subject: [PATCH] don't compile hidden files. fixes #402 --- scalalib/src/mill/scalalib/JavaModule.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) }