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

Replace deprecated Gradle properties #16695

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

jgosmann
Copy link
Contributor

We noticed two properties in the Gradle build files that were reported as deprecated. This PR replaces them with the new names.

  • destinationDir -> destinationDirectory (scheduled to be removed in Gradle 9.0)
  • archiveName -> archiveFileName (removed in Gradle 8.0)

Cp. https://docs.gradle.org/current/userguide/upgrading_version_7.html

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh ./bin/configs/*.yaml
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master (upcoming 7.1.0 minor release - breaking changes with fallbacks), 8.0.x (breaking changes without fallbacks)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@wing328
Copy link
Member

wing328 commented Oct 1, 2023

@jgosmann thanks for the PR. With this change, does it mean we drop the support for Gradle 7.x?

* destinationDir -> destinationDirectory (scheduled to be removed in Gradle 9.0)
* archiveName -> archiveFileName (removed in Gradle 8.0)

Cp. https://docs.gradle.org/current/userguide/upgrading_version_7.html
@jgosmann
Copy link
Contributor Author

jgosmann commented Oct 3, 2023

I think this does not affect support for Gradle 7.x.

  • We are still using Gradle 7.x and did the replacements already in the clients we've generated without encountering a problem. However, the affected places seem to be only relevant when targeting Android, which we do not.
  • At least the 7.3 documentation of AbstractCompile and AbstractArchiveTask already lists the deprecations and replacements.

btw: I amended the commit because I was a bit too eager with the replacements. Hopefully, this makes all tests pass again.

@jgosmann jgosmann force-pushed the gradle-deprecations branch from 0833315 to 0c40174 Compare October 3, 2023 12:57
@wing328
Copy link
Member

wing328 commented Oct 4, 2023

CI tests failure not related to this change.

@wing328
Copy link
Member

wing328 commented Oct 4, 2023

@jgosmann thanks for the explanation. I did some tests locally and the result is good so we can merge this.

FYI. I also spotted another warning but I think we can deal with that with another PR instead:

> Configure project :
The JavaExec.main property has been deprecated. This is scheduled to be removed in Gradle 8.0. Please use the mainClass property instead. See https://docs.gradle.org/7.2/dsl/org.gradle.api.tasks.JavaExec.html#org.gradle.api.tasks.JavaExec:main for more details.
        at build_8n2n0lmixavm552r5h1hubo3n$_run_closure8.doCall(/Users/williamcheng/Code/openapi-generator7/samples/client/petstore/java/okhttp-gson-group-parameter/build.gradle:99)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)

@wing328 wing328 merged commit 7087b33 into OpenAPITools:master Oct 4, 2023
108 of 109 checks passed
@wing328 wing328 added Client: Java Enhancement: Code Cleanup General refactoring, removal of deprecated things, commenting, etc. labels Oct 4, 2023
@wing328 wing328 added this to the 7.1.0 milestone Oct 4, 2023
@jgosmann jgosmann deleted the gradle-deprecations branch October 4, 2023 15:22
AlanCitrix pushed a commit to AlanCitrix/openapi-generator that referenced this pull request Oct 26, 2023
* destinationDir -> destinationDirectory (scheduled to be removed in Gradle 9.0)
* archiveName -> archiveFileName (removed in Gradle 8.0)

Cp. https://docs.gradle.org/current/userguide/upgrading_version_7.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client: Java Enhancement: Code Cleanup General refactoring, removal of deprecated things, commenting, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants