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

[Kotlin][Multiplatform] Add missing JVM dependency #10051

Conversation

krzema12
Copy link
Contributor

@krzema12 krzema12 commented Jul 28, 2021

This dependency was accidentally removed in PR #9755 where we switched
from build.gradle to build.gradle.kts.

Symptom of this dependency missing (not making this change):

12:28:25.021 [DefaultDispatcher-worker-6] ERROR Application - Unhandled: GET - <redacted>
java.lang.ExceptionInInitializerError: null
        at com.dynatrace.teamsmanager.infrastructure.ApiClient$client$2.invoke(ApiClient.kt:38)
...
Caused by: java.lang.IllegalStateException: Failed to find HTTP client engine implementation in the classpath: consider adding client engine dependency. See https://ktor.io/clients/http-client/engines.html
        at io.ktor.client.HttpClientJvmKt.<clinit>(HttpClientJvm.kt:42)

which contains a clear message hinting what's wrong.


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.3.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.

Technical committee:
@jimschubert @dr4ke616 @karismann @Zomzog @andrewemery @4brunu @yutaka0m

People working on the previous change (#9755):
@837 @wing328

This dependency was accidentally removed in PR OpenAPITools#9755 where we switched
from `build.gradle` to `build.gradle.kts`.
@4brunu
Copy link
Contributor

4brunu commented Jul 28, 2021

Actually comparing the two files, it seems that there are a lot of missing dependencies.
Is this the only one that is missing?

@krzema12
Copy link
Contributor Author

@4brunu good point. However I have a possibility to test only the JVM target in the multiplatform project, hence I'm limiting the changes to what I can test. It's the most popular target, so IMO it still make sense to make this simple change and tackle others later.

@4brunu
Copy link
Contributor

4brunu commented Jul 28, 2021

Could you please add the remaining one's without testing?

@krzema12
Copy link
Contributor Author

I checked the dependencies and in fact nothing more seems to be missing. One may think that e.g. implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-js:$coroutines_version" is missing from jsMain, however in the newer versions of Gradle and Kotlin, it's enough to specify implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:$coroutines_version" in commonMain and it will automatically add dependencies on platform-specific libraries. It's also why implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version" is not needed for jvmMain.

@4brunu
Copy link
Contributor

4brunu commented Jul 28, 2021

@837 @DevSrSouza could you please help to review this PR?
Is there any more missing dependencies for other targets?
Thanks

@837
Copy link
Contributor

837 commented Jul 28, 2021

Looks good to me, seems like I really just missed the JVM client for ktor. @krzema12 thanks for finding that :D
The others are all defined in the commonMain{} and will automatically download the target specific dependencies.

@4brunu
Copy link
Contributor

4brunu commented Jul 28, 2021

Thanks 👍

@wing328 wing328 added this to the 5.2.1 milestone Jul 29, 2021
@wing328 wing328 merged commit b1a0098 into OpenAPITools:master Jul 29, 2021
@krzema12 krzema12 deleted the Kotlin-multiplatform-add-missing-JVM-dependency branch July 29, 2021 11:35
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

4 participants