-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding an option to exclude subprojects from the parent project aggre…
…gation
- Loading branch information
1 parent
ffde760
commit 2a3e99b
Showing
11 changed files
with
100 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
.../java/org/scoverage/ScalaMultiModuleWithPartialScoverageUseAndExcludedSubProjectTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.scoverage; | ||
|
||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.assertFalse; | ||
|
||
public class ScalaMultiModuleWithPartialScoverageUseAndExcludedSubProjectTest extends ScoverageFunctionalTest { | ||
|
||
public ScalaMultiModuleWithPartialScoverageUseAndExcludedSubProjectTest() { | ||
super("scala-multi-module-with-partial-scoverage-use-and-excluded-sub-project"); | ||
} | ||
|
||
@Test | ||
public void reportScoverage() { | ||
|
||
AssertableBuildResult result = dryRun("clean", ScoveragePlugin.getREPORT_NAME()); | ||
|
||
assertFalse(result.getResult().getOutput().contains("Scala sub-project 'a' doesn't have Scoverage applied and will be ignored in parent project aggregation")); | ||
result.assertTaskExists(ScoveragePlugin.getREPORT_NAME()); | ||
result.assertTaskExists("b:" + ScoveragePlugin.getREPORT_NAME()); | ||
} | ||
|
||
} |
Empty file.
8 changes: 8 additions & 0 deletions
8
...-partial-scoverage-use-and-excluded-sub-project/a/src/main/scala/org/hello/a/WorldA.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package org.hello.a | ||
|
||
class WorldA { | ||
|
||
def fooA(): String = { | ||
"a" | ||
} | ||
} |
Empty file.
8 changes: 8 additions & 0 deletions
8
...-partial-scoverage-use-and-excluded-sub-project/b/src/main/scala/org/hello/b/WorldB.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package org.hello.b | ||
|
||
class WorldB { | ||
|
||
def fooB(): String = { | ||
"b" | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
...jects/scala-multi-module-with-partial-scoverage-use-and-excluded-sub-project/build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
plugins { | ||
id 'org.scoverage' apply false | ||
} | ||
|
||
description = 'a multi-module Scala project that builds successfully and has modules which does not use scoverate plugin' | ||
|
||
allprojects { p -> | ||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
apply plugin: 'java' | ||
apply plugin: 'scala' | ||
|
||
if (p.name != 'a') { | ||
apply plugin: 'org.scoverage' | ||
if (project.gradle.rootProject.name == p.name) { | ||
scoverage { | ||
excludedSubProjects = [project(':a')] | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
|
||
implementation group: 'org.scala-lang', name: 'scala-library', version: "${scalaVersionMajor}.${scalaVersionMinor}.${scalaVersionBuild}" | ||
|
||
testImplementation group: 'org.junit.platform', name: 'junit-platform-runner' | ||
|
||
testImplementation group: 'org.scalatest', name: "scalatest_${scalaVersionMajor}.${scalaVersionMinor}" | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation project(':a') | ||
implementation project(':b') | ||
} |
1 change: 1 addition & 0 deletions
1
...ts/scala-multi-module-with-partial-scoverage-use-and-excluded-sub-project/settings.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include 'a', 'b' |
11 changes: 11 additions & 0 deletions
11
...-with-partial-scoverage-use-and-excluded-sub-project/src/main/scala/org/hello/World.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.hello | ||
|
||
import org.hello.a.WorldA | ||
import org.hello.a.WorldB | ||
|
||
class World { | ||
|
||
def foo(): String = { | ||
WorldA.foo() + WorldB.foo() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters