From ea4f04d3d2b706ca65d8298327d8ac9d9504adda Mon Sep 17 00:00:00 2001 From: Tobias Roeser Date: Tue, 5 Nov 2019 18:05:52 +0100 Subject: 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 --- scalalib/src/GenIdeaImpl.scala | 16 ++++++++++------ .../idea_modules/helloworld.iml | 4 +++- .../idea_modules/helloworld.test.iml | 4 +++- .../gen-idea-hello-world/idea_modules/helloworld.iml | 4 +++- .../idea_modules/helloworld.test.iml | 4 +++- 5 files changed, 22 insertions(+), 10 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, } - + { + for { + generatedSourcePath <- (generatedSourcePaths.toSeq ++ Seq(generatedSourceOutputPath)).distinct.sorted + path <- Seq(relify(generatedSourcePath)) + } yield + + + + } { + // keep the "real" base path as last content, to ensure, Idea picks it up as "main" module dir for (normalSourcePath <- normalSourcePaths.toSeq.sorted) yield } { - for (generatedSourcePath <- generatedSourcePaths.toSeq.sorted) - yield - - } - { val resourceType = if (isTest) "java-test-resource" else "java-resource" for (resourcePath <- resourcePaths.toSeq.sorted) yield diff --git a/scalalib/test/resources/gen-idea-extended-hello-world/idea_modules/helloworld.iml b/scalalib/test/resources/gen-idea-extended-hello-world/idea_modules/helloworld.iml index 8d00490f..e0ebc89c 100644 --- a/scalalib/test/resources/gen-idea-extended-hello-world/idea_modules/helloworld.iml +++ b/scalalib/test/resources/gen-idea-extended-hello-world/idea_modules/helloworld.iml @@ -2,7 +2,9 @@ - + + + diff --git a/scalalib/test/resources/gen-idea-extended-hello-world/idea_modules/helloworld.test.iml b/scalalib/test/resources/gen-idea-extended-hello-world/idea_modules/helloworld.test.iml index 79be6671..138fa7ea 100644 --- a/scalalib/test/resources/gen-idea-extended-hello-world/idea_modules/helloworld.test.iml +++ b/scalalib/test/resources/gen-idea-extended-hello-world/idea_modules/helloworld.test.iml @@ -2,7 +2,9 @@ - + + + diff --git a/scalalib/test/resources/gen-idea-hello-world/idea_modules/helloworld.iml b/scalalib/test/resources/gen-idea-hello-world/idea_modules/helloworld.iml index cc3c0ce2..a4f3e9bd 100644 --- a/scalalib/test/resources/gen-idea-hello-world/idea_modules/helloworld.iml +++ b/scalalib/test/resources/gen-idea-hello-world/idea_modules/helloworld.iml @@ -2,7 +2,9 @@ - + + + diff --git a/scalalib/test/resources/gen-idea-hello-world/idea_modules/helloworld.test.iml b/scalalib/test/resources/gen-idea-hello-world/idea_modules/helloworld.test.iml index 79be6671..138fa7ea 100644 --- a/scalalib/test/resources/gen-idea-hello-world/idea_modules/helloworld.test.iml +++ b/scalalib/test/resources/gen-idea-hello-world/idea_modules/helloworld.test.iml @@ -2,7 +2,9 @@ - + + + -- cgit v1.2.3