-
-
Notifications
You must be signed in to change notification settings - Fork 2
Release v2.1.0 #268
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
Draft
sya-ri
wants to merge
16
commits into
releases/v2
Choose a base branch
from
releases/v2.1.0
base: releases/v2
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Release v2.1.0 #268
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Implemented sealed serialization support in `KtConfig`. - Added `discriminator` property to `@KtConfig` annotations for sealed hierarchy handling. - Updated `KtConfigSymbolProcessor` to generate loaders for sealed classes and interfaces. - Introduced tests for sealed serializers and extended functionality in `ExamplePlugin`. - Removed unused `mavenPublish` version from `libs.versions.toml`.
- Replaced the `@PathName` annotation with `@SerialName` for consistency and unification of functionality. - Marked `@PathName` as deprecated starting from version 2.1.0, with removal scheduled in version 2.2.0. - Updated related documentation, inline comments, and migration examples (`README.md` and `DEPRECATION.md`). - Removed the `getPathName` method and updated its usages to `getSerialName`.
Code Coverage
|
- Implemented `FormattedColorSerializer` for color parsing with ARGB/hexadecimal formats. - Added version-specific alpha channel handling based on Minecraft API compatibility. - Updated `ExamplePlugin` to include tests for `FormattedColorSerializer`. - Replaced dependency `spigot8` with `spigot` for broader compatibility.
- Moved built-in and custom serializer definitions to a new `Serializer` module for better reusability and maintainability. - Replaced inline serializer logic within `KtConfigSymbolProcessor` with references to `Serializer`. - Simplified type-based serializer resolution using `Serializer.findSerializer`. - Removed redundant and deprecated serializer methods, including `getComment` and `getPathName`. - Updated `build.gradle.kts` to use the new localization for server JAR URLs.
- Deleted the `Discriminator` interface and its implementations as they were no longer utilized. - Added `getSealedSubclassesDeeply` to recursively retrieve all leaf subclasses in a sealed class hierarchy. - Updated `ExamplePlugin` to refine handling of sealed serializers and discriminator usage.
- Updated `build.gradle.kts` to conditionally resolve server JAR URLs based on the specified Minecraft version. - Added error handling for unsupported or unknown versions.
- Extracted reusable `addControlFlowCode` and `asLiteralList` utilities to a new helper file, `KotlinPoetHelpers.kt`. - Simplified `KtConfigSymbolProcessor` by replacing inline control flow and list building logic with helper methods. - Removed redundant imports (`joinToCode`) and improved consistency in generated code.
…rove generated code readability - Replaced fully qualified serializer names with `ClassName` instances in `Serializer`. - Refactored `Parameter.Serializer` to utilize `CodeBlock` for initializer generation. - Updated `KtConfigSymbolProcessor` to use cleaner imports and references, reducing noise in generated loader classes.
Owner
Author
|
Update SNAPSHOT |
- Introduced `loadAndSave` for loading a file and immediately saving it back, useful for normalizing configuration files. - Added `loadAndSaveIfNotExists` to load a file and create it with default values if absent. - Implemented `saveIfNotExists` to save configurations only when the file doesn't exist. - Updated `KtConfigLoaderTest` with comprehensive tests for the new methods.
Owner
Author
|
Update SNAPSHOT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changelog
Added
discriminatorproperty to the@KtConfigannotation for handling sealed hierarchies.KtConfigLoaderfor easier file handling:loadAndSave: Loads a file and immediately saves it back.loadAndSaveIfNotExists: Loads a file and saves default values if the file doesn't exist.saveIfNotExists: Saves the configuration only if the file does not already exist.FormattedColorSerializer#isSupportedAlphaproperty to detect Minecraft version support for an alpha channel in colors.Changed
This results in cleaner and more readable generated code.
Example
@PathNameand replaced it with@SerialNamefor better consistency.@PathNameis scheduled to be removed in v2.2.0.FormattedColorSerializerto ignore alpha values of 255 (fully opaque) when encoding colors, treating them as if no alpha channel is specified.Fixed
FormattedColorSerializerto ignore an alpha channel when encoding colors on Minecraft versions that don't support alpha transparency.