summaryrefslogtreecommitdiff
path: root/scalalib/src/GenIdeaImpl.scala
diff options
context:
space:
mode:
authorTobias Roeser <le.petit.fou@web.de>2019-11-05 18:05:52 +0100
committerGitHub <noreply@github.com>2019-11-05 18:05:52 +0100
commitea4f04d3d2b706ca65d8298327d8ac9d9504adda (patch)
treef68a22be31c101e308745a53bfc54a7b6d6726aa /scalalib/src/GenIdeaImpl.scala
parent1fea4221f68aeb3886a167c71699cfd316dc544f (diff)
downloadmill-ea4f04d3d2b706ca65d8298327d8ac9d9504adda.tar.gz
mill-ea4f04d3d2b706ca65d8298327d8ac9d9504adda.tar.bz2
mill-ea4f04d3d2b706ca65d8298327d8ac9d9504adda.zip
Create separate content entries for generated sources (#729)
* Create separate content entries for generated sources Fixes https://github.com/lihaoyi/mill/issues/728 * Fixed handling of duplictate entries * Updated tests for GenIdea
Diffstat (limited to 'scalalib/src/GenIdeaImpl.scala')
-rwxr-xr-xscalalib/src/GenIdeaImpl.scala16
1 files changed, 10 insertions, 6 deletions
diff --git a/scalalib/src/GenIdeaImpl.scala b/scalalib/src/GenIdeaImpl.scala
index c0e41426..03f38b62 100755
--- a/scalalib/src/GenIdeaImpl.scala
+++ b/scalalib/src/GenIdeaImpl.scala
@@ -545,19 +545,23 @@ case class GenIdeaImpl(evaluator: Evaluator,
<output url={outputUrl} />
}
<exclude-output />
- <content url={"file://$MODULE_DIR$/" + relify(generatedSourceOutputPath)} />
+ {
+ for {
+ generatedSourcePath <- (generatedSourcePaths.toSeq ++ Seq(generatedSourceOutputPath)).distinct.sorted
+ path <- Seq(relify(generatedSourcePath))
+ } yield
+ <content url={"file://$MODULE_DIR$/" + path}>
+ <sourceFolder url={"file://$MODULE_DIR$/" + path} isTestSource={isTest.toString} generated="true" />
+ </content>
+ }
<content url={"file://$MODULE_DIR$/" + relify(basePath)}>
{
+ // keep the "real" base path as last content, to ensure, Idea picks it up as "main" module dir
for (normalSourcePath <- normalSourcePaths.toSeq.sorted)
yield
<sourceFolder url={"file://$MODULE_DIR$/" + relify(normalSourcePath)} isTestSource={isTest.toString} />
}
{
- for (generatedSourcePath <- generatedSourcePaths.toSeq.sorted)
- yield
- <sourceFolder url={"file://$MODULE_DIR$/" + relify(generatedSourcePath)} isTestSource={isTest.toString} generated="true" />
- }
- {
val resourceType = if (isTest) "java-test-resource" else "java-resource"
for (resourcePath <- resourcePaths.toSeq.sorted)
yield