Skip to content

ErrorProne plugin configures Java tasks at the execution time #97

@asodja

Description

@asodja

In Gradle 9.0 we plan to migrate majority of JVM plugins to lazy properties. We plan to bridge old raw type methods to new lazy methods on the bytecode level for old plugins, so they will be bytecode compatible. But we cannot bridge some of the behaviours.

While upgrading CompileOptions.isFork() to lazy Property<Boolean> type, we've noticed via smoke tests that ErrorProne sets fork option at the execution time in doFirst block. With Property<Boolean> that becomes an error, since Property is finalized and can't be changed at execution time, so upgrade to lazy property breaks ErrorProne plugin.

One solution that could work here for you, is that you configure CompileOptions.isFork at configuration time and then you validate the value at the execution time and fail if it's not set to true, see also gradle/gradle#25836 (comment).

Would be possible to change the behaviour that way?


The error that is reported after property upgrade to a lazy property:

* What went wrong:
Execution failed for task ':compileJava'.
> The value for task ':compileJava' property 'options' property 'fork' is final and cannot be changed any further.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions