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

ProguardTask is incompatible with the configuration cache #254

Closed
autonomousapps opened this issue Jun 1, 2022 · 4 comments · Fixed by #380
Closed

ProguardTask is incompatible with the configuration cache #254

autonomousapps opened this issue Jun 1, 2022 · 4 comments · Fixed by #380
Labels
gradle-plugin Issues related to the Gradle plugin

Comments

@autonomousapps
Copy link
Contributor

See https://docs.gradle.org/7.5-rc-1/userguide/configuration_cache.html

Running an instance of ProguardTask with the configuration cache on results in a failure. For example:

$ ./gradlew :mdx:minify --configuration-cache

* What went wrong:
Configuration cache problems found in this build.

4 problems were found storing the configuration cache, 1 of which seems unique.
- Task `:mdx:minify` of type `proguard.gradle.ProGuardTask`: invocation of 'Task.project' at execution time is unsupported.
  See https://docs.gradle.org/7.5-rc-1/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution

See the complete report at file:///.../build/reports/configuration-cache/4vg2suoj0m28s61f63oq9jfjf/7ofh75cdtqvk23hhkaw5evrfh/configuration-cache-report.html
> Invocation of 'Task.project' by task ':mdx:minify' at execution time is unsupported.

And here are the usages, extracted from the stacktraces in the HTML report:

  1. at proguard.gradle.ProGuardTask.extendClassPath(ProGuardTask.java:1591)
  2. at proguard.gradle.ProGuardTask.getConfiguration(ProGuardTask.java:1486)

These usages are basically

ConfigurableFileCollection fileCollection = getProject().files(files)

Where it is getProject() that is "illegal" to call, at execution time, with configuration cache on.

I am open to PRing a fix for this, but I wanted to open an issue first to see what the appetite would be for an external contribution.

@mrjameshamilton
Copy link
Collaborator

Hi @autonomousapps ! Thanks for the report. We'd be very happy to accept a PR that fixes this!

@autonomousapps
Copy link
Contributor Author

@mrjameshamilton have you had a chance to take a look at the PR I filed 11 days ago?

@runningcode
Copy link
Contributor

runningcode commented May 11, 2023

It seems this was released. Which version was it included in? (Looks like 7.3.0) Can this issue be closed?

@mrjameshamilton
Copy link
Collaborator

Hi @runningcode ! #258 doesn't add support for configuration cache, it simply marks the task with notCompatibleWithConfigurationCache. So the issue is not really fully solved yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gradle-plugin Issues related to the Gradle plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants