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

Prepare for release 2.0.0 #2010

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 34 additions & 5 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,36 @@ Change Log

## Unreleased

* Fix: Enum classes that only have an init block now also generate the required semicolon (#1952)
* Fix: Preserve typealiases in `KSAnnotation.toAnnotationSpec()`. (#1945)
* Fix: Preserve nullability in `KSType.toClassName()`. (#1956)
* New: Add `KSTypeAlias.toClassName()`. (#1956)
* New: Add `KSType.toClassNameOrNull()`. (#1956)
## Version 2.0.0

Thanks to [@brokenhappy][brokenhappy], [@tajobe][tajobe], [@niyajali][niyajali],
[@ForteScarlet][ForteScarlet] for contributing to this release.

_2024-10-21_
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Planning to merge on Monday.


This release is source- and binary-compatible with KotlinPoet 1.x.

The most important behavior change in this release is that spaces in generated code don't wrap by
default anymore.

KotlinPoet 1.x used to replace space characters with newline characters whenever a given line of
code exceeded the length limit. This usually led to better code formatting, but could also lead to
compilation errors in generated code. Non-breaking spaces could be marked by the `·` character, but
the discoverability of this feature wasn't great.

KotlinPoet 2.0 does not wrap spaces, even if the line of code they occur in exceeds the length
limit. The newly introduced `♢` character can be used to mark spaces that are safe to wrap, which
can improve code formatting. The `·` character has been preserved for compatibility, but its
behavior is now equivalent to a regular space character.

* New: Kotlin 2.0.10.
* New: Spaces don't break by default.
* New: New `♢` placeholder representing a space that is safe to wrap.
* New: Add `KSTypeAlias.toClassName()`. (#1956)
* New: Add `KSType.toClassNameOrNull()`. (#1956)
* Fix: Enum classes that only have an init block now also generate the required semicolon. (#1953)
* Fix: Preserve typealiases in `KSAnnotation.toAnnotationSpec()`. (#1956)
* Fix: Preserve nullability in `KSType.toClassName()`. (#1956)

## Version 1.18.1

Expand Down Expand Up @@ -863,3 +888,7 @@ _2017-05-16_
[sebek64]: https://github.com/sebek64
[DanielGronau]: https://github.com/DanielGronau
[mitasov-ra]: https://github.com/mitasov-ra
[brokenhappy]: https://github.com/brokenhappy
[tajobe]: https://github.com/tajobe
[niyajali]: https://github.com/niyajali
[ForteScarlet]: https://github.com/ForteScarlet
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
org.gradle.jvmargs='-Dfile.encoding=UTF-8'

GROUP=com.squareup
VERSION_NAME=1.19.0-SNAPSHOT
VERSION_NAME=2.0.0

POM_URL=https://github.com/square/kotlinpoet
POM_SCM_URL=https://github.com/square/kotlinpoet
Expand Down