-
Notifications
You must be signed in to change notification settings - Fork 428
Provide maven(url: String, name: String? = null, ...) shortcut #256
Comments
Alternatively we could add the strongly typed setter maven { url = uri("...") } |
As a second step we could work with the Kotlin team to introduce the concept of implicit conversion compiler plugins and achieve complete parity with Groovy with the advantage of compile time checking: maven { url = "..." } // statically checked implicit conversion from String to URI |
I like the alternative route a lot. We should refrain from adding adhoc shortcuts. They are terrible to maintain, they may outnumber us at some point 😄 and they surely will minimize the goodness we could get from a coherent frontend on top of the Gradle API. |
Type safe setters have been added to the Gradle API in:
This provides the following: repositories {
maven { url = uri("...") }
} Implicit conversions will be addressed in #335 |
As commented on #335, I am against introducing implicit conversion to Kotlin, and I still think such shortcut is relevant for such frequently used statement. |
We should reconsider this shortcut. |
Current syntax to specify Maven repositories is not very idiomatic. Providing a regular Kotlin
maven()
function with parameters likemaven(url: String, name: String? = null, ...)
would be more easy to use for end users via autocomplete, positional or named parameters, and would read and write more easily.Current syntax:
repositories { maven { setUrl("...") } }
Proposed syntax:
The text was updated successfully, but these errors were encountered: