Skip to content

Commit 331fa7b

Browse files
vRallevvanniktech
authored andcommitted
Reapply the Jacoco version after the project has been evaluated (#128)
* Reapply the Jacoco version after the project has been evaluated, fixes #125 * Initialize the Jacoco version in the root project only once
1 parent 710f130 commit 331fa7b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main/groovy/com/vanniktech/android/junit/jacoco/GenerationPlugin.groovy

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,11 @@ class GenerationPlugin implements Plugin<Project> {
223223
private static addJacocoMergeToRootProject(final Project project, final JunitJacocoExtension extension) {
224224
project.plugins.apply('jacoco')
225225

226-
project.jacoco {
227-
toolVersion extension.jacocoVersion
226+
project.afterEvaluate {
227+
// Apply the Jacoco version after evaluating the project so that the extension could be configured
228+
project.jacoco {
229+
toolVersion extension.jacocoVersion
230+
}
228231
}
229232

230233
def mergeTask = project.task("mergeJacocoReports", type: JacocoMerge) {

0 commit comments

Comments
 (0)