File tree 4 files changed +42
-2
lines changed
main/groovy/org/scoverage
4 files changed +42
-2
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ import org.gradle.api.artifacts.Configuration
7
7
import org.gradle.api.file.FileCollection
8
8
import org.gradle.api.plugins.JavaPlugin
9
9
import org.gradle.api.plugins.scala.ScalaPlugin
10
- import org.gradle.api.tasks.JavaExec
11
10
import org.gradle.api.tasks.SourceSet
12
11
import org.gradle.api.tasks.bundling.Jar
13
12
import org.gradle.api.tasks.testing.Test
@@ -75,7 +74,7 @@ class ScoverageExtension {
75
74
scala. source(original. scala)
76
75
77
76
compileClasspath + = original. compileClasspath + project. configurations. scoverage
78
- runtimeClasspath = it. output + project. configurations. runtime
77
+ runtimeClasspath = it. output + project. configurations. scoverage + project . configurations . runtime
79
78
}
80
79
81
80
def testSourceSet = project. sourceSets. create(' testScoverage' ) {
Original file line number Diff line number Diff line change @@ -28,4 +28,10 @@ class SimpleReportAcceptanceTest extends AcceptanceTestUtils {
28
28
testHappyDay(false )
29
29
}
30
30
31
+ @Test
32
+ public void testRun () throws Exception {
33
+ File projectRoot = new File (' src/test/runtime' )
34
+ def build = setupBuild(projectRoot, true )
35
+ build. forTasks(' clean' , ' run' ). run()
36
+ }
31
37
}
Original file line number Diff line number Diff line change
1
+ description = ' a project that runs an application and captures scoverage'
2
+
3
+ buildscript {
4
+ repositories {
5
+ // need to get up to the working directory of gradle-plugins build
6
+ flatDir dir : " ${ project.projectDir} /../../../build/libs"
7
+ }
8
+ dependencies {
9
+ classpath name : ' gradle-scoverage' , version : ' +'
10
+ }
11
+ }
12
+
13
+ apply plugin : ' scoverage'
14
+
15
+ repositories {
16
+ mavenCentral()
17
+ }
18
+
19
+ dependencies {
20
+ scoverage ' org.scoverage:scalac-scoverage-plugin_2.11:1.0.1' ,
21
+ ' org.scoverage:scalac-scoverage-runtime_2.11:1.0.1'
22
+ compile ' org.scala-lang:scala-library:2.11.0'
23
+ }
24
+
25
+ task run (type : JavaExec ) {
26
+ classpath = sourceSets. scoverage. runtimeClasspath
27
+ main = ' hello.World'
28
+ }
29
+
30
+ checkScoverage. dependsOn(run)
Original file line number Diff line number Diff line change
1
+ package hello
2
+
3
+ object World extends App {
4
+ println(" ahoy" )
5
+ }
You can’t perform that action at this time.
0 commit comments