melix / jmh-gradle-plugin

Integrates the JMH benchmarking framework with Gradle
Apache License 2.0
676 stars 87 forks source link

Do not access 'project.zipTree' in mapping closure #261

Closed jjohannes closed 11 months ago

jjohannes commented 11 months ago

This is not supported by the Configuration Cache. Instead, we inject an ArchiveOperations service.

Fixes #229

jjohannes commented 11 months ago

No problem. Happy I figured this out. I am also not super happy with the subclass.

I tried injecting via the plugin already. It's not working. The service property can't be found when the code in the closure executes (if CC is turned on).

I think this is, because the code executes after the state has been loaded from the cache. Which is the reason why there is a problem in the first place. At that point, the plugin context is not available anymore.

jjohannes commented 11 months ago

It can be injected via the plugin. "Just" need to store a reference in a variable while we can.

Updated the PR – PTAL.

jjohannes commented 11 months ago

The test also starts failing (on master) with newer Gradle versions. Not sure anymore if what was reported in #261 is exactly this issue. But in any case this is an issue with Gradle 8.5.

melix commented 11 months ago

@jjohannes can you allow edits on your PR?

jjohannes commented 11 months ago

can you allow edits on your PR?

Should be turned on.

melix commented 11 months ago

Strange, I get a permission denied :thinking:

jjohannes commented 11 months ago

Strange. The flag is set here in my UI. Feel free to just copy the solution into a new PR/branch.

melix commented 11 months ago

My bad, had a typo in the branch name

jjohannes commented 11 months ago

Thank you @melix!

marcphilipp commented 5 months ago

@melix Do you have time to cut a release that includes this fix?