File tree Expand file tree Collapse file tree 4 files changed +42
-2
lines changed
main/groovy/org/scoverage Expand file tree Collapse file tree 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
77import org.gradle.api.file.FileCollection
88import org.gradle.api.plugins.JavaPlugin
99import org.gradle.api.plugins.scala.ScalaPlugin
10- import org.gradle.api.tasks.JavaExec
1110import org.gradle.api.tasks.SourceSet
1211import org.gradle.api.tasks.bundling.Jar
1312import org.gradle.api.tasks.testing.Test
@@ -75,7 +74,7 @@ class ScoverageExtension {
7574 scala. source(original. scala)
7675
7776 compileClasspath + = original. compileClasspath + project. configurations. scoverage
78- runtimeClasspath = it. output + project. configurations. runtime
77+ runtimeClasspath = it. output + project. configurations. scoverage + project . configurations . runtime
7978 }
8079
8180 def testSourceSet = project. sourceSets. create(' testScoverage' ) {
Original file line number Diff line number Diff line change @@ -28,4 +28,10 @@ class SimpleReportAcceptanceTest extends AcceptanceTestUtils {
2828 testHappyDay(false )
2929 }
3030
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+ }
3137}
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