summaryrefslogtreecommitdiff
path: root/scalaplugin
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2017-11-15 10:26:09 -0800
committerLi Haoyi <haoyi.sg@gmail.com>2017-11-15 10:26:09 -0800
commit9c7f1930e839be67980e50c614f7c8582b8a707d (patch)
treef2856aae6b1da5f53eaeede21001e07e2a059211 /scalaplugin
parent3f768a3a0407c1b331199abea5fdd6d970da7615 (diff)
downloadmill-9c7f1930e839be67980e50c614f7c8582b8a707d.tar.gz
mill-9c7f1930e839be67980e50c614f7c8582b8a707d.tar.bz2
mill-9c7f1930e839be67980e50c614f7c8582b8a707d.zip
Avoid compiling code just to get access to compiled code output paths
Diffstat (limited to 'scalaplugin')
-rw-r--r--scalaplugin/src/main/scala/mill/scalaplugin/GenIdea.scala15
1 files changed, 10 insertions, 5 deletions
diff --git a/scalaplugin/src/main/scala/mill/scalaplugin/GenIdea.scala b/scalaplugin/src/main/scala/mill/scalaplugin/GenIdea.scala
index eca36184..f55efa4d 100644
--- a/scalaplugin/src/main/scala/mill/scalaplugin/GenIdea.scala
+++ b/scalaplugin/src/main/scala/mill/scalaplugin/GenIdea.scala
@@ -72,12 +72,13 @@ object GenIdea {
}
val moduleFiles = resolved.map{ case (path, resolvedDeps, mod) =>
- val Seq(sourcePath: PathRef, outputPath: PathRef) =
- evaluator.evaluate(OSet(mod.sources, mod.compile)).values
+ val Seq(sourcePath: PathRef) =
+ evaluator.evaluate(OSet(mod.sources)).values
+ val Some((destPath, jsonPath)) = evaluator.resolveDestPaths(mod.compile)
val elem = moduleXmlTemplate(
sourcePath.path,
- outputPath.path,
+ Seq(destPath, jsonPath),
resolvedDeps.map(pathToLibName),
for(m <- mod.projectDeps)
yield moduleLabels(m).mkString(".").toLowerCase
@@ -138,12 +139,16 @@ object GenIdea {
</component>
}
def moduleXmlTemplate(sourcePath: Path,
- outputPath: Path,
+ outputPaths: Seq[Path],
libNames: Seq[String],
depNames: Seq[String]) = {
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager">
- <output url={"file://$MODULE_DIR$/" + relify(outputPath)} />
+ {
+ for(outputPath <- outputPaths)
+ yield <output url={"file://$MODULE_DIR$/" + relify(outputPath)} />
+ }
+
<exclude-output />
<content url={"file://$MODULE_DIR$/" + relify(sourcePath)}>
<sourceFolder url={"file://$MODULE_DIR$/" + relify(sourcePath)} isTestSource="false" />