Skip to content

Commit

Permalink
Configure Idea project generator per module (com-lihaoyi#458)
Browse files Browse the repository at this point in the history
* Sketched how to skip some projects from Idea project generator

* Better trait comment

* Moved skipIdea flag into JavaModule
  • Loading branch information
lefou authored and ucbjrl committed Oct 9, 2018
1 parent a31509b commit a437ba5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scalalib/src/mill/scalalib/GenIdeaImpl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ object GenIdea extends ExternalModule {
implicit def millScoptEvaluatorReads[T] = new mill.main.EvaluatorScopt[T]()
lazy val millDiscover = Discover[this.type]
}

object GenIdeaImpl {

def apply(ctx: Log with Home,
Expand Down Expand Up @@ -225,8 +226,9 @@ object GenIdeaImpl {
Tuple2(
".idea"/"modules.xml",
allModulesXmlTemplate(
for((path, mod) <- modules)
yield moduleName(path)
modules
.filter(!_._2.skipIdea)
.map { case (path, mod) => moduleName(path) }
)
),
Tuple2(
Expand Down
5 changes: 5 additions & 0 deletions scalalib/src/mill/scalalib/JavaModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,11 @@ trait JavaModule extends mill.Module with TaskModule { outer =>
def intellijModulePath: Path = millSourcePath

def forkWorkingDir = T{ ammonite.ops.pwd }

/**
* Skip Idea project file generation.
*/
def skipIdea: Boolean = false
}

trait TestModule extends JavaModule with TaskModule {
Expand Down

0 comments on commit a437ba5

Please sign in to comment.