-
-
Notifications
You must be signed in to change notification settings - Fork 26
feat: add check of compatibility between library version and binding #1994
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
Conversation
| .builder(name = "getLibraryVersion") | ||
| .addModifiers(KModifier.INTERNAL) | ||
| .returns(String::class) | ||
| .addCode(CodeBlock.of("return \"$libraryVersion\"")) |
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.
This is the best I could do to pass the version known in build time to the library. I tried with JAR metadata, with no success.
|
|
||
| public abstract val usesString: String | ||
|
|
||
| public open fun isCompatibleWithLibraryVersion(libraryVersion: String): Boolean = true |
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.
We'll be able to override it in the future releases of the server, so that it runs different logic depending on the version of the server routes.
|
Let me merge so that we start with something. At this stage, we can always adjust the approach. |
The goal is to be able to present a nice error message to the user if an incompatible library version is used with a given server routes version. Right now we have only one server routes version, but we're planning to make some breaking changes and expose
/v2/.