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 import for kotlin Parcelize annotation #8590

Merged
merged 6 commits into from
Feb 8, 2021

Conversation

ghost
Copy link

@ghost ghost commented Feb 1, 2021

This replaces the import kotlinx.android.parcel.parcelize with kotlinx.parcel.Parcelize, as the former is deprecated as of kotlin 1.4.20 (and will be removed with the next version or something)
Also see https://youtrack.jetbrains.com/issue/KT-40030.

This would also resolve issue #8073.

I'm also required to mention the technical committee for kotlin:
@jimschubert (2017/09) ❤️, @dr4ke616 (2018/08) @karismann (2019/03) @Zomzog (2019/04) @andrewemery (2019/10) @4brunu (2019/11) @yutaka0m

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/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, 5.1.x, 6.0.x
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@4brunu
Copy link
Contributor

4brunu commented Feb 1, 2021

Hey @kalinjul thanks for your contribution 👍

Could you please also apply the new Parcelize plugin in the gradle file modules/openapi-generator/src/main/resources/kotlin-client/build.gradle.mustache and update the kotlin version to 1.4.20, since this was the version that this change was applied?

{{#parcelizeModels}}
apply plugin: 'kotlin-parcelize'
{{/parcelizeModels}}

And also run this commands please.

./mvnw clean package 
./bin/generate-samples.sh
./bin/utils/export_docs_generators.sh

Thanks 😊

@ghost
Copy link
Author

ghost commented Feb 1, 2021

I added the plugin (although the android-kotlin-extensions, which was required before, wasn't included before) and generated the samples.

@4brunu
Copy link
Contributor

4brunu commented Feb 1, 2021

Yes, you are right, it was probably forgotten.
Thanks for the changes, it looks good to me.
Let's wait for CI to finish.

@ghost
Copy link
Author

ghost commented Feb 2, 2021

I'm sorry I couldn't find the code that uses gradle 5.1.1 for building the samples. Obviously, this has to be replaced by a newer version, too.

@4brunu
Copy link
Contributor

4brunu commented Feb 2, 2021

CI failed, I think it's not related to this PR.
@wing328 for me this PR is ready to merge.

@wing328
Copy link
Member

wing328 commented Feb 3, 2021

Restarted the failed jobs. Let's see how that goes.

@wing328 wing328 added this to the 5.0.1 milestone Feb 3, 2021
@ghost
Copy link
Author

ghost commented Feb 3, 2021

I don't know about the current travis failure, but shippable reports:

FAILURE: Build failed with an exception.

  • Where:
    Build file '/root/src/github.com/OpenAPITools/openapi-generator/samples/client/petstore/kotlin-retrofit2/build.gradle' line: 21

  • What went wrong:
    A problem occurred evaluating root project 'kotlin-petstore-retrofit2'.

Failed to apply plugin [id 'kotlin']
The current Gradle version 5.2.1 is not compatible with the Kotlin Gradle plugin. Please use Gradle 5.3 or newer, or the previous version of the Kotlin plugin.

As I had to update the kotlin gradle plugin, this error was introduced by the changes in this PR. I just don't know how to fix it, because I can't find a reference to gradle 5.2.1 anywhere in the source. It obviously has to be updated to a newer gradle version as well.

@4brunu
Copy link
Contributor

4brunu commented Feb 3, 2021

I also can't find the problem 🙁
Maybe @wing328 or @jimschubert can help with this.

@wing328
Copy link
Member

wing328 commented Feb 4, 2021

From Shippable log:


* What went wrong:
A problem occurred evaluating root project 'kotlin-petstore-retrofit2'.
> Failed to apply plugin [id 'kotlin']
   > The current Gradle version 5.2.1 is not compatible with the Kotlin Gradle plugin. Please use Gradle 5.3 or newer, or the previous version of the Kotlin plugin.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 17s
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (bundle-test) on project KotlinRetrofit2PetstoreClientTests: Command execution failed.: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
[ERROR] 

Looks like we need to install a newer version of Gradle (e.g. 5.3 or newer) to fix the build failure?

@wing328
Copy link
Member

wing328 commented Feb 4, 2021

TravisCI failure already fixed in the master.

@4brunu 4brunu mentioned this pull request Feb 5, 2021
5 tasks
@4brunu
Copy link
Contributor

4brunu commented Feb 5, 2021

@kalinjul I have been fighting the CI, and to make it pass, can you please revert the kotlin and gradle versions? Thanks

@wing328 wing328 modified the milestones: 5.0.1, 5.1.0 Feb 8, 2021
@wing328
Copy link
Member

wing328 commented Feb 8, 2021

CircleCI failure already fixed in the master.

@wing328 wing328 merged commit d57aa95 into OpenAPITools:master Feb 8, 2021
@welsinga
Copy link

welsinga commented Mar 8, 2021

It this change reverted @wing328? Because when i apply parcelizeModels: "true" kotlin-parcelize plugin isn't being used

@wing328
Copy link
Member

wing328 commented Mar 22, 2021

Can you try the latest stable release v5.1.0 or latest master and create a new issue for tracking if it's still the case?

@welsinga
Copy link

Yes it works with 5.1.0.

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.

None yet

5 participants