From 50fccd4995d818c0469ff8a16f45817de7c2201c Mon Sep 17 00:00:00 2001 From: rockjam <5min4eq.unity@gmail.com> Date: Thu, 19 Apr 2018 02:26:29 +0300 Subject: [PATCH] fixes #201 change mill project path for sbt and maven tests --- scalalib/src/mill/scalalib/GenIdeaImpl.scala | 2 +- scalalib/src/mill/scalalib/JavaModule.scala | 2 ++ scalalib/src/mill/scalalib/MiscModule.scala | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/scalalib/src/mill/scalalib/GenIdeaImpl.scala b/scalalib/src/mill/scalalib/GenIdeaImpl.scala index 40437164f40..7ab6ffb7945 100644 --- a/scalalib/src/mill/scalalib/GenIdeaImpl.scala +++ b/scalalib/src/mill/scalalib/GenIdeaImpl.scala @@ -217,7 +217,7 @@ object GenIdeaImpl { val isTest = mod.isInstanceOf[TestModule] val elem = moduleXmlTemplate( - mod.millModuleBasePath.value, + mod.intellijModulePath, scalaVersionOpt, Strict.Agg.from(resourcesPathRefs.map(_.path)), Strict.Agg.from(normalSourcePaths), diff --git a/scalalib/src/mill/scalalib/JavaModule.scala b/scalalib/src/mill/scalalib/JavaModule.scala index 4b90331c946..740bca2b240 100644 --- a/scalalib/src/mill/scalalib/JavaModule.scala +++ b/scalalib/src/mill/scalalib/JavaModule.scala @@ -289,6 +289,8 @@ trait JavaModule extends mill.Module with TaskModule { outer => def artifactName: T[String] = millModuleSegments.parts.mkString("-") def artifactId: T[String] = artifactName() + + def intellijModulePath: Path = millSourcePath } trait TestModule extends JavaModule with TaskModule { diff --git a/scalalib/src/mill/scalalib/MiscModule.scala b/scalalib/src/mill/scalalib/MiscModule.scala index 0e8bde3e638..02a6ebf926e 100644 --- a/scalalib/src/mill/scalalib/MiscModule.scala +++ b/scalalib/src/mill/scalalib/MiscModule.scala @@ -66,12 +66,14 @@ trait MavenModule extends JavaModule{outer => override def resources = T.sources{ millSourcePath / 'src / 'main / 'resources } trait Tests extends super.Tests with MavenTests { override def millSourcePath = outer.millSourcePath + override def intellijModulePath = outer.millSourcePath / 'src / 'test } } trait SbtModule extends MavenModule with ScalaModule{ outer => trait Tests extends super.Tests with MavenTests { override def millSourcePath = outer.millSourcePath + override def intellijModulePath = outer.millSourcePath / 'src / 'test } }