Skip to content
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

Gradle 4.6-rc-2 Jacoco NullPointerException #420

Open
chali opened this issue Feb 23, 2018 · 2 comments
Open

Gradle 4.6-rc-2 Jacoco NullPointerException #420

chali opened this issue Feb 23, 2018 · 2 comments

Comments

@chali
Copy link

chali commented Feb 23, 2018

Hello,

I'm trying Gradle 4.6-rc-2. I've encountered an error during the configuration phase. Gretty is initializing Jacoco which uses a new API which is returning null. The new method is coming from JavaForkOptions. When you are creating JacocoHelper in creates an empty implementation for each method from JavaForkOptions. The code is here:

jacocoHelper = (TaskInternal.methods.collectEntries({ [it.name, {} ] }) +
JavaForkOptions.methods.collectEntries({ [it.name, {} ] }) +
ExtensionAware.methods.collectEntries({ [it.name, {} ] }) + [
getExtensions: { startTask.getExtensions() },
getInputs: { startTask.getInputs() },
getJacoco: { startTask.extensions.jacoco },
getName: { startTask.getName() },
getOutputs: { startTask.getOutputs() },
getProject: { startTask.project },
getWorkingDir: { project.projectDir },
]) as JacocoHelper
Here is the NullPointerExecption https://github.com/gradle/gradle/blob/v4.6.0-RC2/subprojects/jacoco/src/main/java/org/gradle/testing/jacoco/plugins/JacocoPluginExtension.java#L117. Would be a special implementation for this method returning empty list enough?

Here is an example project showing the problem. You can run ./gradlew classes --stacktrace.
https://github.com/chali/jacocoAndGretty

Thanks

@wolfs
Copy link

wolfs commented Feb 26, 2018

Would be fixed by #415.

@chali
Copy link
Author

chali commented Feb 26, 2018

I'm closing my duplicate PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants