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

[gradle] consistent use of maven url in gradle files #5045

Merged
merged 11 commits into from
Jan 19, 2020

Conversation

sebastien-rosset
Copy link
Contributor

@sebastien-rosset sebastien-rosset commented Jan 19, 2020

According to https://docs.gradle.org/current/userguide/declaring_repositories.html, the syntax for maven repositories is:

repositories {
    maven {
        url "https://maven.springframework.org/release"
    }
}

There is no equal sign between the 'url' keyword and the value.

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project before.
  • Run the shell script(s) under ./bin/ (or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).
  • File the PR against the correct branch: master, 4.3.x, 5.0.x. Default: master.
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

@auto-labeler
Copy link

auto-labeler bot commented Jan 19, 2020

👍 Thanks for opening this issue!
🏷 I have applied any labels matching special text in your issue.

The team will review the labels and make any necessary changes.

Copy link
Member

@jimschubert jimschubert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jimschubert
Copy link
Member

I did some investigation into why both of these work (with and without the equals).

All of these appear to be the same in build.gradle:

maven { url "https://repo1.maven.org/maven2" }
maven { url("https://repo1.maven.org/maven2") }
maven { url = "https://repo1.maven.org/maven2" }

But, I'm not sure of what the underlying Groovy support is that enables this. See the below example where I have a property and a setter.

groovy:000> class Example {
groovy:001>     def url
groovy:002>     void setUrl(Object url) {
groovy:003>         this.url = url
groovy:004>     }
groovy:005>
groovy:005>     String toString() {
groovy:006>         return "Example: $url"
groovy:007>     }
groovy:008> }
===> true
groovy:000> example = new Example()
===> Example: null
groovy:000> example.url = "http://direct.example.com"
===> http://direct.example.com
groovy:000> example.setUrl("http://setter.example.com")
===> null
groovy:000> println example.toString()
Example: http://setter.example.com
===> null
groovy:000> example.url "http://sugared.example.com"
ERROR groovy.lang.MissingMethodException:
No signature of method: Example.url() is applicable for argument types: (String) values: [http://sugared.example.com]
Possible solutions: use([Ljava.lang.Object;), any(), dump(), grep(), getUrl(), use(java.lang.Class, groovy.lang.Closure)

It probably has something to do with the Closure. Anyway, best to stick with idiomatic Gradle and not use something which could potentially break in the future. Thanks for fixing it up!

@jimschubert jimschubert merged commit d61dcc1 into OpenAPITools:master Jan 19, 2020
jimschubert added a commit that referenced this pull request Jan 26, 2020
* 5.0.x: (92 commits)
  [Rust Server] Handle array of objects inside an object correctly (#5044)
  [Rust Server] Sanitise enum values (#5042)
  [Rust Server] Add support for primitive arrays (#5041)
  [elm] Fix duplicate coder names (#5100)
  [elm] enum items and parameters (#5051)
  [elm] Fix decoding empty operation responses (#5055)
  resolve merge conflicts in VERSION files
  undo restoring ElmClientCodegenTest.java
  fix merge conflicts
  [dart-dio] Various fixes (#5027)
  Add java code comments based on explanation from Jim Schubert (#5048)
  Execute ./bin/openapi3/go-experimental-petstore.sh script (#5049)
  [docs] Sorted doc outputs and clean up duplicated CliOptions (#5046)
  Add docs/installation.md and docsite index to version update script (#5037)
  [gradle] consistent use of maven url in gradle files (#5045)
  Use HTTPS Maven URL in Kotlin meta generator (#5043)
  [Python] fix numeric enum in python flask, aiohttp (#5019)
  add multipleOf to various codegen classes (#5021)
  Add a link to a youtube video on Pulp and OpenAPI Generator (#5038)
  [scripts] Remove misspelled OPENAPI_GENERATOR_DOWLOAD_CACHE_DIR (#5035)
  ...
@wing328 wing328 added this to the 4.2.3 milestone Jan 31, 2020
@sebastien-rosset sebastien-rosset deleted the https-1 branch May 23, 2020 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants