Open mwos-sl opened 3 years ago
Hmm, but the code seem strange, because inside project.afterEvaluate
:
https://github.com/scoverage/gradle-scoverage/blame/master/src/main/groovy/org/scoverage/ScoveragePlugin.groovy#L106
we say project.gradle.projectsEvaluated
:
https://github.com/scoverage/gradle-scoverage/blame/master/src/main/groovy/org/scoverage/ScoveragePlugin.groovy#L297
and inside this one aggregateScoverage
is declared:
https://github.com/scoverage/gradle-scoverage/blame/master/src/main/groovy/org/scoverage/ScoveragePlugin.groovy#L313
But gradle has no chances to jump into this block, because somewhere between those 2 gradle checks gradle checks if the task which we're calling from the console (aggregateScoverage
) exists. And of course it does not yet, so gradle fails as described:
Task 'aggregateScoverage' not found in root project 'all'.
As a result we never go into the clousure defined within project.gradle.projectsEvaluated
.
Question: Why project.gradle.projectsEvaluated
is needed (https://github.com/scoverage/gradle-scoverage/blame/master/src/main/groovy/org/scoverage/ScoveragePlugin.groovy#L297) in the first place? Isn't the fact that this is inside afterEvaluate
enough?
cc @eyalroth I see you were the last one touching this area, so maybe you know?
Huh, configuration-on-demand changes behaviour of project.gradle.projectsEvaluated
.
When I temporarily disabled it:
org.gradle.configureondemand=false
then it enters the scope which creates aggregateScoverage
.
I think this very old issue is related: https://github.com/gradle/gradle/issues/9489 and it doesn't seem it's going to be addressed.
Unfortunately disabling configuration-on-demand isn't a proper fix for us, as we need configuration-on-demand (we've got monorepo with severa hundreds of modules).
@mwos-sl Did you ever find a solution to this? Currently seeing the same issue when attempting to use the plugin with configuration-on-demand
enabled in a mono-repo with a large number of projects.
From what I remember we eventually picked a different plugin for this.
On Wed, Jun 28, 2023, 17:27 Ben Willis @.***> wrote:
@mwos-sl https://github.com/mwos-sl Did you ever find a solution to this? Currently seeing the same issue when attempting to use the plugin with configuration-on-demand enabled in a mono-repo with a large number of projects.
— Reply to this email directly, view it on GitHub https://github.com/scoverage/gradle-scoverage/issues/176#issuecomment-1611649270, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABF4AJETCYOJAZ52UQNQUYLXNRENVANCNFSM5INALM5A . You are receiving this because you are subscribed to this thread.Message ID: @.***>
I've got multi-project gradle build. Root build.gradle:
When I call
I get error:
So even though it seems it should be there (https://github.com/scoverage/gradle-scoverage/blob/master/src/main/groovy/org/scoverage/ScoveragePlugin.groovy#L313), I followed the answers from some other issues (https://github.com/scoverage/gradle-scoverage/issues/33, https://github.com/scoverage/gradle-scoverage/issues/85#issuecomment-450426947, https://github.com/scoverage/gradle-scoverage/issues/66) and added this in the root:
without even defining dependancy yet, and when I rerun the gradlew command I get:
even though it was claimed to not exist before I added 🤯
Env
scala 2.11.15 gradle 7.2 gradle scoverage plugin 7.0.0 scoverage 1.4.10