From 506fd24f5839d628f6e0fe1a508ec3c62a52f13b Mon Sep 17 00:00:00 2001 From: Nik Vanderhoof Date: Fri, 31 May 2019 18:41:30 -0400 Subject: [PATCH 1/2] Add test case that breaks via #622 Thanks to @kag0 for finding this! :) --- .../test/resources/hello-world/core/src/Greet.scala | 2 ++ .../test/resources/hello-world/other/src/Foo.scala | 1 + contrib/scoverage/test/src/HelloWorldTests.scala | 6 ++++++ 3 files changed, 9 insertions(+) create mode 100644 contrib/scoverage/test/resources/hello-world/other/src/Foo.scala diff --git a/contrib/scoverage/test/resources/hello-world/core/src/Greet.scala b/contrib/scoverage/test/resources/hello-world/core/src/Greet.scala index 608becc9640..90830bbc8e7 100644 --- a/contrib/scoverage/test/resources/hello-world/core/src/Greet.scala +++ b/contrib/scoverage/test/resources/hello-world/core/src/Greet.scala @@ -3,4 +3,6 @@ object Greet { case Some(p) => s"Hello, ${p} ${name}!" case None => s"Hello, ${name}!" } + + val foo = Foo // testing module deps } diff --git a/contrib/scoverage/test/resources/hello-world/other/src/Foo.scala b/contrib/scoverage/test/resources/hello-world/other/src/Foo.scala new file mode 100644 index 00000000000..d3c853cc044 --- /dev/null +++ b/contrib/scoverage/test/resources/hello-world/other/src/Foo.scala @@ -0,0 +1 @@ +object Foo diff --git a/contrib/scoverage/test/src/HelloWorldTests.scala b/contrib/scoverage/test/src/HelloWorldTests.scala index 433e413b360..3d5a51149bc 100644 --- a/contrib/scoverage/test/src/HelloWorldTests.scala +++ b/contrib/scoverage/test/src/HelloWorldTests.scala @@ -15,10 +15,16 @@ object HelloWorldTests extends utest.TestSuite { } object HelloWorld extends HelloBase { + object other extends ScalaModule { + def scalaVersion = "2.12.4" + } + object core extends ScoverageModule { def scalaVersion = "2.12.4" def scoverageVersion = "1.3.1" + def moduleDeps = Seq(other) + object test extends ScoverageTests { override def ivyDeps = Agg(ivy"org.scalatest::scalatest:3.0.5") def testFrameworks = Seq("org.scalatest.tools.Framework") From 8b9e2e67892f071327ed1d3215ca97e804ebe011 Mon Sep 17 00:00:00 2001 From: Nik Vanderhoof Date: Fri, 31 May 2019 18:44:35 -0400 Subject: [PATCH 2/2] Scoverage should inherit moduleDeps --- contrib/scoverage/src/ScoverageModule.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/scoverage/src/ScoverageModule.scala b/contrib/scoverage/src/ScoverageModule.scala index 335643b67b3..4085ba2e333 100644 --- a/contrib/scoverage/src/ScoverageModule.scala +++ b/contrib/scoverage/src/ScoverageModule.scala @@ -87,6 +87,7 @@ trait ScoverageModule extends ScalaModule { outer: ScalaModule => def selfDir = T { T.ctx().dest / os.up / os.up } def dataDir = T { selfDir() / "data" } + def moduleDeps = outer.moduleDeps def sources = outer.sources def resources = outer.resources def scalaVersion = outer.scalaVersion()