gradle / gradle

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

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

Open asodja opened 1 month ago

asodja commented 1 month 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 3 weeks 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 6 days ago

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

Maybe we can introduce it as deprecated?

asodja commented 5 days ago

Maybe we can introduce it as deprecated?

This sounds like a good idea to me.