-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
./gradlew generateLicenseReport --stacktrace
fails with NPE
#316
Comments
Even explicitly configuring the extensions.configure<LicenseReportExtension> {
projects = (subprojects - project(":modules")).toTypedArray()
// projects = arrayOf(
// project(":modules:jvm"),
// project(":modules:go"),
// project(":modules:js"),
// project(":modules:php"),
// project(":modules:python"),
// project(":modules:ruby"),
// )
} |
I guess you need to provide an MCVE, because for me it works fine on a multi-module project, so there has to be some edge-case you are hitting. |
Also in your last screenshot you are looking at the wrong field. |
Sorry I put aside this issue for a couple of months, I'll take a fresher look, there have been quite changes since then in the build file. |
OK I don't know if the message were back then (Gradle 8.8) — I would assume they were — so I feel pretty stupid, the build is failing with these messages now (Gradle 8.10) :
And indeed I have the gradle configuration cache enabled by default in the gradle properties file: org.gradle.configuration-cache=true Turning it off made the task work
|
@Vampire That said I'm not sure this task can be used from an existing build without disabling the configuration cache. E.g. something like this
Note I'm using
|
Yeah, CC will cause that to be |
I don't think org.gradle.configuration-cache.problems=warn tasks.withType<ReportTask>().configureEach {
notCompatibleWithConfigurationCache("Unsupported")
} Seems related to gradle/gradle#20673 |
Ah right, the CC state is always serialized and then deserialized and used, even with that option set, it is just not persisted. So yeah, makes senes that it still fails. |
To fix this, the task input would have to be configured to not take in the project object for use during execution time. You could create a new class that could contain the info you need, like configuration, project name, etc. to potentially avoid this. Just went through this exercise in one of our internal plugins for work. Not too bad to do, but does take some effort to get into compliance with the configuration-cache spec. |
Yes, as I said, this is a duplicate of the CC incompatibility issue. :-) |
On multi-module projects, the generation task fails with an NPE
I don't understand yet the conditions why this is failing, but for sure the
project
isnull
this seems to come from the
ReportTasks
But the extension is supposed to have the current project and sub-projects
Gradle-License-Report/src/main/groovy/com/github/jk1/license/LicenseReportExtension.groovy
Line 48 in a420142
The
getClasspath
method is called on theReportTask
that was configured on my root project.Full stacktrace
The text was updated successfully, but these errors were encountered: