[PR #721] [MERGED] codegen-kotlin: Support Java serialization of module classes #693

Closed
opened 2025-12-30 01:26:12 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/apple/pkl/pull/721
Author: @odenix
Created: 10/21/2024
Status: Merged
Merged: 10/25/2024
Merged by: @bioball

Base: mainHead: kotlin-module-serializable


📝 Commits (1)

  • 5804780 codegen-kotlin: Support Java serialization of module classes

📊 Changes

2 files changed (+113 additions, -76 deletions)

View changed files

📝 pkl-codegen-kotlin/src/main/kotlin/org/pkl/codegen/kotlin/KotlinCodeGenerator.kt (+74 -76)
📝 pkl-codegen-kotlin/src/test/kotlin/org/pkl/codegen/kotlin/KotlinCodeGeneratorTest.kt (+39 -0)

📄 Description

Motivation:

  • Java serialization makes as much sense for module classes as it does for regular classes.
  • Offer same Java serialization support as codegen-java.

Changes:

  • Move generation of appendProperty method and serialization code
    into new method generateCompanionRelatedCode.
  • Improve/fix generation of serialization code.

Result:
Java serialization is also supported for module classes.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/apple/pkl/pull/721 **Author:** [@odenix](https://github.com/odenix) **Created:** 10/21/2024 **Status:** ✅ Merged **Merged:** 10/25/2024 **Merged by:** [@bioball](https://github.com/bioball) **Base:** `main` ← **Head:** `kotlin-module-serializable` --- ### 📝 Commits (1) - [`5804780`](https://github.com/apple/pkl/commit/580478044d4474adcf11abec1d1fd29a1b23f77f) codegen-kotlin: Support Java serialization of module classes ### 📊 Changes **2 files changed** (+113 additions, -76 deletions) <details> <summary>View changed files</summary> 📝 `pkl-codegen-kotlin/src/main/kotlin/org/pkl/codegen/kotlin/KotlinCodeGenerator.kt` (+74 -76) 📝 `pkl-codegen-kotlin/src/test/kotlin/org/pkl/codegen/kotlin/KotlinCodeGeneratorTest.kt` (+39 -0) </details> ### 📄 Description Motivation: - Java serialization makes as much sense for module classes as it does for regular classes. - Offer same Java serialization support as codegen-java. Changes: - Move generation of `appendProperty` method and serialization code into new method `generateCompanionRelatedCode`. - Improve/fix generation of serialization code. Result: Java serialization is also supported for module classes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 01:26:12 +01:00
adam closed this issue 2025-12-30 01:26:12 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#693