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

Type safe tasks/conventions/extensions/dsl-types properties in Gradle API #341

Closed
eskatos opened this Issue Apr 21, 2017 · 2 comments

Comments

Projects
None yet
1 participant
@eskatos
Member

eskatos commented Apr 21, 2017

Context

Kotlin recognize JavaBean properties only if both the getter and setter use the same property type.
In various places the Gradle API has typed getters with setters taking Object to have the opportunity to apply conversions. This issue is about adding the corresponding type safe setters so those properties are proper Kotlin properties and gets usable as such in Kotlin build scripts.

Let's look at the GradleBuild task for example.
Here's how you can configure it today:

val someBuild by tasks.creating(GradleBuild::class) {
  setDir(file("some/path"))
  setTasks(listOf("foo", "bar"))
}

With added type safe setters it will be:

val someBuild by tasks.creating(GradleBuild::class) {
  dir = file("some/path")
  tasks = listOf("foo", "bar")
}

The existing untyped setters should be kept and still usable to profit from conversions until we tackle #335

@eskatos

This comment has been minimized.

Show comment
Hide comment
@eskatos

eskatos Apr 21, 2017

Member

The PR linked above ☝️ adds type safe setters to all unsafe setters I've found in the Gradle API except for:

The getters for those two respectively return IvyArtifactSet and MavenArtifactSet which are not intended to be created by build scripts.

Member

eskatos commented Apr 21, 2017

The PR linked above ☝️ adds type safe setters to all unsafe setters I've found in the Gradle API except for:

The getters for those two respectively return IvyArtifactSet and MavenArtifactSet which are not intended to be created by build scripts.

@eskatos

This comment has been minimized.

Show comment
Hide comment
@eskatos

eskatos Apr 25, 2017

Member

This as been merged in Gradle.

Member

eskatos commented Apr 25, 2017

This as been merged in Gradle.

@eskatos eskatos closed this Apr 25, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment