-
-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change back to setUrl() for kotlin/groovy compatibility. #134
url = "foo" doesn't work in kotlin, so while this doesn't look that great, it does work in both languages.
- Loading branch information
Showing
2 changed files
with
3 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d1ea695
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
url = uri("https://nodejs.org/dist/")
would also be possible. :)d1ea695
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes and it would be probably better. The
setUrl(String url)
method is probably here for backwards compatibility.@deepy what do you think about that?
This works on both Groovy and Kotlin DSLs, even though in Kotlin we cannot assign its value with
=
like all the properties.d1ea695
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setUrl(Object)
is the same asproject.uri(Object)
https://docs.gradle.org/current/javadoc/org/gradle/api/artifacts/repositories/IvyArtifactRepository.html#setUrl-java.lang.Object-the only reason I've touched this is because I wanted to keep it the same between the implementation in the plugin and the documentation, so that the next time we change something it's just a copy-paste :-)
I'm perfectly fine with any solution that works in both kotlin and groovy (for making the documentation simpler) :-)
d1ea695
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, I did not check the Javadoc before writing my answer and
url
is not a property. UsingsetUrl(Object)
orsetUrl(Uri)
is similar because Gradle will transform the object to an URI. That's ok for me, sorry for my irrelevant answer.