Skip to content

Commit 40fd6b2

Browse files
committed
removing SCCT occurrences
1 parent 5e78a87 commit 40fd6b2

File tree

7 files changed

+52
-45
lines changed

7 files changed

+52
-45
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
[![Build Status](https://travis-ci.org/sqality/gradle-scct.png?branch=master)](https://travis-ci.org/sqality/gradle-scct)
1+
[![Build Status](https://travis-ci.org/scoverage/gradle-scoverage.png?branch=master)](https://travis-ci.org/scoverage/gradle-scoverage)
22

3-
gradle-scct
4-
===========
5-
A plugin to enable the use of SCCT in a gradle Scala project.
3+
gradle-scoverage
4+
================
5+
A plugin to enable the use of Scoverage in a gradle Scala project.
66

77
This has now been deployed to maven central.
88

@@ -14,14 +14,14 @@ buildscript {
1414
mavenCentral()
1515
}
1616
dependencies {
17-
classpath 'com.sqality:gradle-scct:0.4.1'
17+
classpath 'com.sqality:gradle-scoverage:0.4.1'
1818
}
1919
}
2020
21-
apply plugin: com.sqality.ScctPlugin
21+
apply plugin: scoverage.ScoveragePlugin
2222
2323
dependencies {
24-
scct 'com.sqality.scct:scct_2.10:0.2.2'
24+
scoverage 'org.scoverage:scalac-scoverage-plugin_2.10:0.98.4'
2525
compile 'org.scala-lang:scala-library:2.10.1'
2626
}
2727
```
@@ -33,17 +33,17 @@ This creates an additional task testCoverage which will run tests against instru
3333
- [x] failing the build on lack of coverage
3434

3535
Then launch command :
36-
`gradle testScct` or `gradle checkScct`
36+
`gradle testScoverage` or `gradle checkScoverage`
3737

3838

39-
CheckScct
39+
CheckScoverage
4040
---------
4141

42-
By default, when you launch `gradle checkScct` build fail if only 75% of project is covered by tests.
42+
By default, when you launch `gradle checkScoverage` build fail if only 75% of project is covered by tests.
4343

4444
To configure it as you want, add this configuration :
4545
```
46-
checkScct {
46+
checkScoverage {
4747
minimumLineRate = 0.5
4848
}
4949
```

build.gradle

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ uploadArchives {
6262
}
6363

6464
pom.project {
65-
name 'GradleSCCT'
66-
description 'gradle-scct is a Gradle plugin for calculating code coverage using SCCT'
67-
url 'http://sqality.com/'
65+
name 'GradleScoverage'
66+
description 'gradle-scoverage is a Gradle plugin for calculating code coverage using Scoverage'
67+
url 'http://scoverage.org'
6868

6969
scm {
70-
url 'scm:git:https://github.com/sqality/gradle-scct.git'
71-
developerConnection 'scm:git:https://github.com/sqality/gradle-scct.git'
70+
url 'scm:git:https://github.com/scoverage/gradle-scoverage.git'
71+
developerConnection 'scm:git:https://github.com/scoverage/gradle-scoverage.git'
7272
}
7373

7474
licenses {
@@ -83,6 +83,12 @@ uploadArchives {
8383
developer {
8484
id 'maiflai'
8585
}
86+
developer {
87+
id 'ubourdon'
88+
}
89+
developer {
90+
id 'D-Roch'
91+
}
8692
}
8793
}
8894
}

src/main/groovy/com/sqality/OverallCheckTask.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class OverallCheckTask extends DefaultTask {
1313

1414
@TaskAction
1515
void requireLineCoverage() {
16-
def reportDirName = project.extensions[ScctPlugin.CONFIGURATION_NAME].reportDirName
16+
def reportDirName = project.extensions[ScoveragePlugin.CONFIGURATION_NAME].reportDirName
1717

1818
if (cobertura == null) cobertura = project.file("$project.buildDir/reports/$reportDirName/cobertura.xml")
1919

src/main/groovy/com/sqality/ScctExtension.groovy

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ import org.gradle.api.tasks.testing.Test
1212
* Defines a new Test Task which executes normal tests with the instrumented classes.
1313
* Defines a new Check Task which enforces an overall line coverage requirement.
1414
*/
15-
class ScctExtension {
15+
class ScoverageExtension {
1616

17-
ScctExtension(Project project) {
17+
ScoverageExtension(Project project) {
1818

1919
project.plugins.apply(JavaPlugin.class);
2020
project.plugins.apply(ScalaPlugin.class);
2121
project.afterEvaluate(configureRuntimeOptions)
2222

23-
project.configurations.create(ScctPlugin.CONFIGURATION_NAME) {
23+
project.configurations.create(ScoveragePlugin.CONFIGURATION_NAME) {
2424
visible = false
2525
transitive = false
26-
description = 'SCCT dependencies'
26+
description = 'Scoverage dependencies'
2727
}
2828

29-
project.sourceSets.create(ScctPlugin.CONFIGURATION_NAME) {
29+
project.sourceSets.create(ScoveragePlugin.CONFIGURATION_NAME) {
3030
def mainSourceSet = project.sourceSets.getByName(SourceSet.MAIN_SOURCE_SET_NAME)
3131

3232
java.source(mainSourceSet.java)
@@ -36,12 +36,12 @@ class ScctExtension {
3636
runtimeClasspath += mainSourceSet.runtimeClasspath
3737
}
3838

39-
project.tasks.create(ScctPlugin.TEST_NAME, Test.class) {
40-
dependsOn(project.tasks[ScctPlugin.COMPILE_NAME])
39+
project.tasks.create(ScoveragePlugin.TEST_NAME, Test.class) {
40+
dependsOn(project.tasks[ScoveragePlugin.COMPILE_NAME])
4141
}
4242

43-
project.tasks.create(ScctPlugin.CHECK_NAME, OverallCheckTask.class) {
44-
dependsOn(project.tasks[ScctPlugin.TEST_NAME])
43+
project.tasks.create(ScoveragePlugin.CHECK_NAME, OverallCheckTask.class) {
44+
dependsOn(project.tasks[ScoveragePlugin.TEST_NAME])
4545
}
4646

4747
}
@@ -50,27 +50,28 @@ class ScctExtension {
5050

5151
@Override
5252
void execute(Project t) {
53-
t.tasks[ScctPlugin.COMPILE_NAME].configure {
54-
List<String> plugin = ['-Xplugin:' + t.configurations[ScctPlugin.CONFIGURATION_NAME].singleFile]
53+
t.tasks[ScoveragePlugin.COMPILE_NAME].configure {
54+
List<String> plugin = ['-Xplugin:' + t.configurations[ScoveragePlugin.CONFIGURATION_NAME].singleFile]
5555
List<String> parameters = scalaCompileOptions.additionalParameters
5656
if (parameters != null) {
5757
plugin.addAll(parameters)
5858
}
5959
scalaCompileOptions.additionalParameters = plugin
6060
// exclude the scala libraries that are added to enable scala version detection
61-
classpath += t.configurations[ScctPlugin.CONFIGURATION_NAME]
61+
classpath += t.configurations[ScoveragePlugin.CONFIGURATION_NAME]
6262
}
63-
t.tasks[ScctPlugin.TEST_NAME].configure {
64-
systemProperty 'scct.report.dir', "${t.buildDir}/reports/${t.extensions[ScctPlugin.CONFIGURATION_NAME].reportDirName}"
65-
systemProperty 'scct.basedir', "${t.rootDir.absolutePath}" // for multi-module checking
63+
t.tasks[ScoveragePlugin.TEST_NAME].configure {
64+
// TODO : fix this
65+
systemProperty 'scoverage.report.dir', "${t.buildDir}/reports/${t.extensions[ScoveragePlugin.CONFIGURATION_NAME].reportDirName}"
66+
systemProperty 'scoverage.basedir', "${t.rootDir.absolutePath}" // for multi-module checking
6667

6768
def existingClasspath = classpath
68-
classpath = t.files(t.sourceSets[ScctPlugin.CONFIGURATION_NAME].output.classesDir) +
69-
project.configurations[ScctPlugin.CONFIGURATION_NAME] +
69+
classpath = t.files(t.sourceSets[ScoveragePlugin.CONFIGURATION_NAME].output.classesDir) +
70+
project.configurations[ScoveragePlugin.CONFIGURATION_NAME] +
7071
existingClasspath
7172
}
7273
}
7374
}
7475

75-
String reportDirName = 'scct'
76-
}
76+
String reportDirName = 'scoverage'
77+
}

src/main/groovy/com/sqality/ScctPlugin.groovy

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ package com.sqality
33
import org.gradle.api.Plugin
44
import org.gradle.api.Project
55

6-
class ScctPlugin implements Plugin<Project> {
7-
static String CONFIGURATION_NAME = 'scct'
6+
class ScoveragePlugin implements Plugin<Project> {
7+
static String CONFIGURATION_NAME = 'scoverage'
88

9-
static String TEST_NAME = 'testScct'
10-
static String CHECK_NAME = 'checkScct'
11-
static String COMPILE_NAME = 'compileScctScala'
9+
static String TEST_NAME = 'testScoverage'
10+
static String CHECK_NAME = 'checkScoverage'
11+
static String COMPILE_NAME = 'compileScoverageScala'
1212

1313
@Override
1414
void apply(Project t) {
1515
if (t.extensions.findByName(CONFIGURATION_NAME) == null) {
16-
t.extensions.create(CONFIGURATION_NAME, ScctExtension, t)
16+
t.extensions.create(CONFIGURATION_NAME, ScoverageExtension, t)
1717
}
1818
}
19-
}
19+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
implementation-class=com.sqality.ScctPlugin
1+
implementation-class=scoverage.ScoveragePlugin

src/test/groovy/com/sqality/OverallCheckTaskTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class OverallCheckTaskTest {
1616

1717
private Project projectForLineRate(Number lineRate) {
1818
Project project = ProjectBuilder.builder().build()
19-
project.plugins.apply(ScctPlugin)
19+
project.plugins.apply(ScoveragePlugin)
2020
project.tasks.create('bob', OverallCheckTask) {
2121
minimumLineRate = lineRate
2222
cobertura = new File('src/test/resources/cobertura.xml')

0 commit comments

Comments
 (0)