gradle / build-tool-roadmap

Gradle Build Tool roadmap
https://roadmap.gradle.org/
41 stars 6 forks source link

Experimental opt-in Kotlin lazy property assignment #38

Closed asodja closed 1 year ago

asodja commented 2 years ago

Kotlin DSL currently doesn't support an assignment for type Property as Groovy, but .set(T) have to be used. The goal is, that for types with inputs of type Property<T> we support =. This will ease the migration to Provider API for existing scripts and make the use of Provider API for new scripts more compelling.

Example Types:

public interface Extension {
    Property<String> getDescription();
}
public interface OtherExtension {
    Property<String> getDescription();
}

Current DSL:

extension {
    description.set("value")
    description.set(otherExtension.description)
}

New DSL (.set(T) will still work):

extension {
    description = "value"
    description = otherExtension.description
}

In 8.1. we will introduce opt-in Kotlin lazy property assignment.

Related issue: