summaryrefslogtreecommitdiff
path: root/scalalib
diff options
context:
space:
mode:
authorMinghao Liu <molikto@gmail.com>2018-01-19 19:48:50 +0800
committerLi Haoyi <haoyi.sg@gmail.com>2018-01-19 03:48:50 -0800
commita80201ad73fd9803da3a2e2d0a088766d4de4e1a (patch)
tree4b42feb645d1166c2faca342eb75bab0eb4ba505 /scalalib
parent1341e29629ec633a8d9db0e1717434ab560aab42 (diff)
downloadmill-a80201ad73fd9803da3a2e2d0a088766d4de4e1a.tar.gz
mill-a80201ad73fd9803da3a2e2d0a088766d4de4e1a.tar.bz2
mill-a80201ad73fd9803da3a2e2d0a088766d4de4e1a.zip
add resource folders, only one output folder is supported (#113)
Diffstat (limited to 'scalalib')
-rw-r--r--scalalib/src/main/scala/mill/scalalib/GenIdea.scala24
1 files changed, 15 insertions, 9 deletions
diff --git a/scalalib/src/main/scala/mill/scalalib/GenIdea.scala b/scalalib/src/main/scala/mill/scalalib/GenIdea.scala
index e9d8fac5..73699a9e 100644
--- a/scalalib/src/main/scala/mill/scalalib/GenIdea.scala
+++ b/scalalib/src/main/scala/mill/scalalib/GenIdea.scala
@@ -69,10 +69,11 @@ object GenIdea {
val moduleFiles = resolved.map{ case (path, resolvedDeps, mod) =>
val Seq(
+ resoucesPathRefs: Loose.Agg[PathRef],
sourcesPathRef: Loose.Agg[PathRef],
generatedSourcePathRefs: Loose.Agg[PathRef],
allSourcesPathRefs: Loose.Agg[PathRef]
- ) = evaluator.evaluate(Agg(mod.sources, mod.generatedSources, mod.allSources)).values
+ ) = evaluator.evaluate(Agg(mod.resources, mod.sources, mod.generatedSources, mod.allSources)).values
val generatedSourcePaths = generatedSourcePathRefs.map(_.path)
val normalSourcePaths = (allSourcesPathRefs.map(_.path).toSet -- generatedSourcePaths.toSet).toSeq
@@ -83,9 +84,10 @@ object GenIdea {
)
val elem = moduleXmlTemplate(
+ Strict.Agg.from(resoucesPathRefs.map(_.path)),
Strict.Agg.from(normalSourcePaths),
Strict.Agg.from(generatedSourcePaths),
- Strict.Agg(paths.out),
+ paths.out,
Strict.Agg.from(resolvedDeps.map(pathToLibName)),
Strict.Agg.from(mod.moduleDeps.map{ m => moduleName(moduleLabels(m))}.distinct)
)
@@ -152,18 +154,15 @@ object GenIdea {
</library>
</component>
}
- def moduleXmlTemplate(normalSourcePaths: Strict.Agg[Path],
+ def moduleXmlTemplate(resourcePaths: Strict.Agg[Path],
+ normalSourcePaths: Strict.Agg[Path],
generatedSourcePaths: Strict.Agg[Path],
- outputPaths: Strict.Agg[Path],
+ outputPath: Path,
libNames: Strict.Agg[String],
depNames: Strict.Agg[String]) = {
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager">
- {
- for(outputPath <- outputPaths.toSeq)
- yield <output url={"file://$MODULE_DIR$/" + relify(outputPath) + "/dest/classes"} />
- }
-
+ <output url={"file://$MODULE_DIR$/" + relify(outputPath) + "/dest/classes"} />
<exclude-output />
{
for (normalSourcePath <- normalSourcePaths.toSeq)
@@ -179,6 +178,13 @@ object GenIdea {
<sourceFolder url={"file://$MODULE_DIR$/" + relify(generatedSourcePath)} isTestSource="false" generated="true" />
</content>
}
+ {
+ for (resourcePath <- resourcePaths.toSeq)
+ yield
+ <content url={"file://$MODULE_DIR$/" + relify(resourcePath)}>
+ <sourceFolder url={"file://$MODULE_DIR$/" + relify(resourcePath)} isTestSource="false" type="java-resource" />
+ </content>
+ }
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />