gradle / gradle

Adaptable, fast automation for all
https://gradle.org
Apache License 2.0
16.89k stars 4.73k forks source link

Add support for `Property` `property value` assignment in Groovy DSL and document it #30359

Open asodja opened 2 months ago

asodja commented 2 months ago

When doing a Provider API migration a Groovy DSL behavior change with Property. This stops working:

testTask.configure {
    options {
        configFailurePolicy "continue"
    }
}

This still works:

testTask.configure {
    options {
        configFailurePolicy = "continue"
    }
}

A possible solution:

Leonard Brünings Could you add a call() extension method to Property that would internally delegate to set? Then the first variant should keep working.


asodja commented 2 months ago

A fix was merged to EAP branch https://github.com/gradle/gradle/pull/25963.

Note: We should also add possible breaking change documentation.

mlopatkin commented 1 month ago

I wonder if we should support that in the long term:

Maybe we can introduce it as deprecated?

asodja commented 1 month ago

Maybe we can introduce it as deprecated?

This sounds like a good idea to me.