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

Update to Kotlin 1.9.24 and related build tool versions #259

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

garyp
Copy link
Collaborator

@garyp garyp commented Apr 6, 2024

Kotlin 1.9.24, which necessitated also updating Gradle, Java, Android Gradle Plugin, etc.

Notable changes resulting from the version bumps:

  • Dropped support for the legacy Kotlin/JS compiler.
  • Minimum JVM version required for building pbandk is now v17 (pbandk still supports JVM 8+ at runtime).
  • The Kotlin/JS compiler changed how it represents Long internally, which required some refactoring of the Kotlin<->JS Long conversion code in runtime/src/jsMain/kotlin/pbandk/protobufjs/Util.kt.
  • Various changes to the gradle configs and other build files to support build-time changes introduced in newer Kotlin versions.

@garyp garyp force-pushed the garyp/kotlin-1.9 branch 10 times, most recently from 26ea5fb to 218ef65 Compare April 12, 2024 15:21
@garyp garyp force-pushed the garyp/kotlin-1.9 branch 3 times, most recently from 6e7485f to 89c2b1c Compare April 13, 2024 09:34
@garyp garyp force-pushed the garyp/kotlin-1.9 branch 5 times, most recently from 6088eec to 84e43c2 Compare June 20, 2024 12:47
@garyp garyp force-pushed the garyp/kotlin-1.9 branch 2 times, most recently from 6f6fcff to 5f08c02 Compare July 1, 2024 08:03
fun ProviderFactory.gradlePropertyOrEnvironmentVariable(propertyName: String): Provider<String> {
val envVariableName = CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, propertyName)
return gradleProperty(propertyName)
.forUseAtConfigurationTime()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

forUseAtConfigurationTime() is no longer necessary with newer gradle versions

actual object Platform {
actual fun stderrPrintln(str: String) {
val strn = str + "\n"
val cstr = strn.cstr
write(2, cstr, cstr.size.toULong())
}

private suspend fun stdinReadIntLE() = withContext(Dispatchers.Main) {
private suspend fun stdinReadIntLE() = withContext(Dispatchers.IO) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Kotlin/Native now supports Dispatchers.IO, and Dispatchers.Main doesn't work correctly now that Dispatchers.IO is available. This brings Kotlin/Native more in line with how Kotlin/JVM works.

@@ -913,7 +913,6 @@ public final class pbandk/wkt/EnumOptions : pbandk/ExtendableMessage {
public final fun getDeprecated ()Ljava/lang/Boolean;
public fun getDescriptor ()Lpbandk/MessageDescriptor;
public fun getExtension (Lpbandk/FieldDescriptor;)Ljava/lang/Object;
public fun getExtensionFields ()Lpbandk/ExtensionFieldSet;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These were improperly included in the public API because of limitations in earlier versions of the binary-compatibility-validator gradle plugin. The updated version of the plugin properly excludes these functions from the public API.

@@ -1,9 +1,3 @@
package pbandk.internal

import platform.posix.*

internal class PosixException(val errno: Int) : RuntimeException(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This class wasn't being used anymore

@garyp garyp marked this pull request as ready for review July 1, 2024 08:10
@garyp garyp requested a review from kjanderson2 July 1, 2024 08:10
Kotlin 1.9.24, which necessitated also updating Gradle, Java, Android
Gradle Plugin, etc.

Notable changes resulting from the version bumps:

- Dropped support for the legacy Kotlin/JS compiler.
- Minimum JVM version required for building pbandk is now v17 (pbandk
  still supports JVM 8+ at runtime).
- The Kotlin/JS compiler changed how it represents `Long` internally,
  which required some refactoring of the Kotlin<->JS Long conversion
  code in `runtime/src/jsMain/kotlin/pbandk/protobufjs/Util.kt`.
- Various changes to the gradle configs and other build files to support
  build-time changes introduced in newer Kotlin versions.
@garyp garyp force-pushed the garyp/kotlin-1.9 branch from 5f08c02 to b9d212c Compare July 1, 2024 13:59
@garyp garyp changed the title Update to latest Kotlin and build tool versions Update to Kotlin 1.9.24 and related build tool versions Jul 2, 2024
@garyp garyp added this to the 0.15.0 milestone Jul 9, 2024
@garyp garyp linked an issue Jul 9, 2024 that may be closed by this pull request
Copy link

@kjanderson2 kjanderson2 left a comment

Choose a reason for hiding this comment

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

LGTM, is the plan to do a release after this is merged?

@garyp
Copy link
Collaborator Author

garyp commented Jul 23, 2024

LGTM, is the plan to do a release after this is merged?

Yep. I'm going to make a release after this PR and #268 and #269 are merged. The 3 PRs all go together. And then once Kotlin 2.0.10 is out in the near future and #270 is merged I'll make another release. That way there'll be a recent pbandk release with a Kotlin 1.9 dependency for anyone who isn't ready yet to update to Kotlin 2.0.

@garyp garyp merged commit b9af394 into master Jul 23, 2024
9 checks passed
@garyp garyp deleted the garyp/kotlin-1.9 branch July 23, 2024 07:06
garyp added a commit that referenced this pull request Jul 24, 2024
Incorporate Kotlin 1.9 deprecations and new features

There have been a bunch of features deprecated between Kotlin 1.5.32 and 1.9.24, as well as new features added. Any breaking changes were handled in #259. This PR updates pbandk to remove non-breaking deprecated features and adopt some of the new features. See individual commits for more details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"pbandk-runtime:0.14.2 was published in the legacy mode"
2 participants