summaryrefslogtreecommitdiff
path: root/scalalib
diff options
context:
space:
mode:
authorJeremy Apthorp <nornagon@nornagon.net>2018-03-05 20:23:12 -0800
committerLi Haoyi <haoyi.sg@gmail.com>2018-03-05 20:23:12 -0800
commita8885fe610eb48c11fc48ca47bfa1f2a295d5bc2 (patch)
tree118a8e7a8bffcb72323c5e0d4208a6e78af0fb89 /scalalib
parenteedd0b2eed3dc7259fcd6c9cef306e7e4972c62c (diff)
downloadmill-a8885fe610eb48c11fc48ca47bfa1f2a295d5bc2.tar.gz
mill-a8885fe610eb48c11fc48ca47bfa1f2a295d5bc2.tar.bz2
mill-a8885fe610eb48c11fc48ca47bfa1f2a295d5bc2.zip
Add out/{module_name} as a content root in generated IntelliJ project (#196)
Diffstat (limited to 'scalalib')
-rw-r--r--scalalib/src/mill/scalalib/GenIdea.scala11
-rw-r--r--scalalib/test/resources/gen-idea/idea_modules/iml1
2 files changed, 10 insertions, 2 deletions
diff --git a/scalalib/src/mill/scalalib/GenIdea.scala b/scalalib/src/mill/scalalib/GenIdea.scala
index 6304fb14..8d7bfc55 100644
--- a/scalalib/src/mill/scalalib/GenIdea.scala
+++ b/scalalib/src/mill/scalalib/GenIdea.scala
@@ -190,6 +190,10 @@ object GenIdea {
mod.compile.ctx.segments
)
val Seq(scalaVersion: String) = evaluator.evaluate(Agg(mod.scalaVersion)).values
+ val generatedSourceOutPath = Evaluator.resolveDestPaths(
+ evaluator.outPath,
+ mod.generatedSources.ctx.segments
+ )
val elem = moduleXmlTemplate(
mod.millModuleBasePath.value,
@@ -198,6 +202,7 @@ object GenIdea {
Strict.Agg.from(normalSourcePaths),
Strict.Agg.from(generatedSourcePaths),
paths.out,
+ generatedSourceOutPath.dest,
Strict.Agg.from(resolvedDeps.map(pathToLibName)),
Strict.Agg.from(mod.moduleDeps.map{ m => moduleName(moduleLabels(m))}.distinct)
)
@@ -291,13 +296,15 @@ object GenIdea {
resourcePaths: Strict.Agg[Path],
normalSourcePaths: Strict.Agg[Path],
generatedSourcePaths: Strict.Agg[Path],
- outputPath: Path,
+ compileOutputPath: Path,
+ generatedSourceOutputPath: Path,
libNames: Strict.Agg[String],
depNames: Strict.Agg[String]) = {
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager">
- <output url={"file://$MODULE_DIR$/" + relify(outputPath) + "/dest/classes"} />
+ <output url={"file://$MODULE_DIR$/" + relify(compileOutputPath) + "/dest/classes"} />
<exclude-output />
+ <content url={"file://$MODULE_DIR$/" + relify(generatedSourceOutputPath)} />
<content url={"file://$MODULE_DIR$/" + relify(basePath)}>
{
for (normalSourcePath <- normalSourcePaths.toSeq.sorted)
diff --git a/scalalib/test/resources/gen-idea/idea_modules/iml b/scalalib/test/resources/gen-idea/idea_modules/iml
index 1fe9be83..0124e06e 100644
--- a/scalalib/test/resources/gen-idea/idea_modules/iml
+++ b/scalalib/test/resources/gen-idea/idea_modules/iml
@@ -2,6 +2,7 @@
<component name="NewModuleRootManager">
<output url="file://$MODULE_DIR$/../target/workspace/mill/scalalib/GenIdeaTests/helloWorldEvaluator/compile/dest/classes"/>
<exclude-output/>
+ <content url="file://$MODULE_DIR$/../target/workspace/mill/scalalib/GenIdeaTests/helloWorldEvaluator/generatedSources/dest"/>
<content url="file://$MODULE_DIR$/../target/workspace/gen-idea">
<sourceFolder url="file://$MODULE_DIR$/../target/workspace/gen-idea/src" isTestSource="false"/>
<sourceFolder url="file://$MODULE_DIR$/../target/workspace/gen-idea/resources" isTestSource="false" type="java-resource"/>