diff options
Diffstat (limited to 'scalaplugin')
-rw-r--r-- | scalaplugin/src/main/scala/mill/scalaplugin/GenIdea.scala | 19 | ||||
-rw-r--r-- | scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala | 1 |
2 files changed, 14 insertions, 6 deletions
diff --git a/scalaplugin/src/main/scala/mill/scalaplugin/GenIdea.scala b/scalaplugin/src/main/scala/mill/scalaplugin/GenIdea.scala index ca37c6dc..cb59bdba 100644 --- a/scalaplugin/src/main/scala/mill/scalaplugin/GenIdea.scala +++ b/scalaplugin/src/main/scala/mill/scalaplugin/GenIdea.scala @@ -1,7 +1,8 @@ package mill.scalaplugin import ammonite.ops._ -import mill.discover.Mirror.Segment +import mill.define.Target +import mill.discover.Mirror.{LabelledTarget, Segment} import mill.discover.{Discovered, Mirror} import mill.eval.{Evaluator, PathRef} import mill.util.{OSet, PrintLogger} @@ -13,16 +14,22 @@ object GenIdea { rm! pwd/".idea" rm! pwd/".idea_modules" - for((relPath, xml) <- xmlFileLayout(obj)){ + val discovered = implicitly[Discovered[T]] + val mapping = Discovered.mapping(obj)(discovered) + val workspacePath = pwd / 'out + + val evaluator = new Evaluator(workspacePath, mapping, new PrintLogger(true)) + + for((relPath, xml) <- xmlFileLayout(obj, evaluator, mapping)){ write.over(pwd/relPath, pp.format(xml)) } } - def xmlFileLayout[T: Discovered](obj: T): Seq[(RelPath, scala.xml.Node)] = { + def xmlFileLayout[T: Discovered](obj: T, + evaluator: Evaluator, + mapping: Map[Target[_], LabelledTarget[_]]): Seq[(RelPath, scala.xml.Node)] = { + val discovered = implicitly[Discovered[T]] - val mapping = Discovered.mapping(obj)(discovered) - val workspacePath = pwd / 'out - val evaluator = new Evaluator(workspacePath, mapping, new PrintLogger(true)) val modules = Mirror .traverse(obj, discovered.mirror){ (h, p) => diff --git a/scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala b/scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala index f7db3006..ca70cee5 100644 --- a/scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala +++ b/scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala @@ -181,6 +181,7 @@ trait ScalaModule extends Module with TaskModule{ outer => def allSources = T{ Seq(sources()) } def compile: T[CompilationResult] = T.persistent{ compileScala( + ZincWorker(), scalaVersion(), allSources().map(_.path), compileDepClasspath().map(_.path), |