Skip to content

Commit 816b603

Browse files
committed
multi-module sample
1 parent a463dcc commit 816b603

File tree

4 files changed

+39
-2
lines changed

4 files changed

+39
-2
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
organization := Common.organization
2+
3+
name := Common.baseName + "-module2"
4+
5+
version := Common.version
6+
7+
scalaVersion := "2.10.3"
8+
9+
libraryDependencies ++= Seq(
10+
"org.scalatest" %% "scalatest" % "2.0" % "test"
11+
)
12+
13+
ScoverageSbtPlugin.instrumentSettings
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.buransky.plugins.scoverage.samples.sbt.multiModule.module2
2+
3+
trait Animal {
4+
val legs: Int
5+
val eyes: Int
6+
val canFly: Boolean
7+
val canSwim: Boolean
8+
}
9+
10+
object Animal {
11+
def fancy(farm: Iterable[Animal]): Iterable[Animal] =
12+
farm.filter(_.legs > 10).filter(_.canFly).filter(_.canSwim)
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.buransky.plugins.scoverage.samples.sbt.multiModule.module2
2+
3+
import org.scalatest.{Matchers, FlatSpec}
4+
5+
class AnimalSpec extends FlatSpec with Matchers {
6+
behavior of "fancy"
7+
8+
it should "do nothing" in {
9+
Animal.fancy(Nil) should equal(Nil)
10+
}
11+
}

samples/sbt/multi-module/sonar-project.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ sonar.projectVersion=1.0.0
44

55
sonar.language=scala
66

7-
sonar.modules=module1
7+
sonar.modules=module1,module2
88

99
module1.sonar.sources=src/main/scala
1010
module1.sonar.tests=src/test/scala
1111
module1.sonar.scoverage.reportPath=target/scala-2.10/scoverage-report/scoverage.xml
1212

1313
module2.sonar.sources=src/main/scala
1414
module2.sonar.tests=src/test/scala
15-
#module2.sonar.scoverage.reportPath=target/scala-2.10/scoverage-report/scoverage.xml
15+
module2.sonar.scoverage.reportPath=target/scala-2.10/scoverage-report/scoverage.xml

0 commit comments

Comments
 (0)