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

Experimental opt-in Kotlin lazy property assignment #38

Closed
asodja opened this issue Aug 19, 2022 · 0 comments
Closed

Experimental opt-in Kotlin lazy property assignment #38

asodja opened this issue Aug 19, 2022 · 0 comments
Milestone

Comments

@asodja
Copy link
Member

asodja commented Aug 19, 2022

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:

@asodja asodja modified the milestone: 8.0 Aug 19, 2022
loosebazooka added a commit to loosebazooka/gradle-release that referenced this issue Aug 19, 2022
Property requires the use of `set` (instead of `=`)
See: gradle/build-tool-roadmap#38
Hillkorn pushed a commit to researchgate/gradle-release that referenced this issue Aug 25, 2022
README.md : Property requires the use of `set` (instead of `=`)
See: gradle/build-tool-roadmap#38
@ljacomet ljacomet added this to the 8.1 milestone Jan 12, 2023
@asodja asodja changed the title Kotlin DSL Property assignment Experimental opt-in Kotlin DSL Property assignment Mar 10, 2023
@asodja asodja changed the title Experimental opt-in Kotlin DSL Property assignment Experimental opt-in Kotlin lazy property assignment Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants