Skip to content

Commit 96d4ebe

Browse files
committed
Prepare for release 2.0.0
1 parent 41d18a9 commit 96d4ebe

File tree

2 files changed

+35
-6
lines changed

2 files changed

+35
-6
lines changed

docs/changelog.md

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,36 @@ Change Log
33

44
## Unreleased
55

6-
* Fix: Enum classes that only have an init block now also generate the required semicolon (#1952)
7-
* Fix: Preserve typealiases in `KSAnnotation.toAnnotationSpec()`. (#1945)
8-
* Fix: Preserve nullability in `KSType.toClassName()`. (#1956)
9-
* New: Add `KSTypeAlias.toClassName()`. (#1956)
10-
* New: Add `KSType.toClassNameOrNull()`. (#1956)
6+
## Version 2.0.0
7+
8+
Thanks to [@brokenhappy][brokenhappy], [@tajobe][tajobe], [@niyajali][niyajali],
9+
[@ForteScarlet][ForteScarlet] for contributing to this release.
10+
11+
_2024-10-23_
12+
13+
This release is source- and binary-compatible with KotlinPoet 1.x.
14+
15+
The most important behavior change in this release is that spaces in generated code don't wrap by
16+
default anymore.
17+
18+
KotlinPoet 1.x used to replace space characters with newline characters whenever a given line of
19+
code exceeded the length limit. This usually led to better code formatting, but could also lead to
20+
compilation errors in generated code. Non-breaking spaces could be marked by the `·` character, but
21+
the discoverability of this feature wasn't great.
22+
23+
KotlinPoet 2.0 does not wrap spaces, even if the line of code they occur in exceeds the length
24+
limit. The newly introduced `` character can be used to mark spaces that are safe to wrap, which
25+
can improve code formatting. The `·` character has been preserved for compatibility, but its
26+
behavior is now equivalent to a regular space character.
27+
28+
* New: Kotlin 2.0.10.
29+
* New: Spaces don't break by default.
30+
* New: New `` placeholder representing a space that is safe to wrap.
31+
* New: Add `KSTypeAlias.toClassName()`. (#1956)
32+
* New: Add `KSType.toClassNameOrNull()`. (#1956)
33+
* Fix: Enum classes that only have an init block now also generate the required semicolon. (#1953)
34+
* Fix: Preserve typealiases in `KSAnnotation.toAnnotationSpec()`. (#1956)
35+
* Fix: Preserve nullability in `KSType.toClassName()`. (#1956)
1136

1237
## Version 1.18.1
1338

@@ -863,3 +888,7 @@ _2017-05-16_
863888
[sebek64]: https://github.com/sebek64
864889
[DanielGronau]: https://github.com/DanielGronau
865890
[mitasov-ra]: https://github.com/mitasov-ra
891+
[brokenhappy]: https://github.com/brokenhappy
892+
[tajobe]: https://github.com/tajobe
893+
[niyajali]: https://github.com/niyajali
894+
[ForteScarlet]: https://github.com/ForteScarlet

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
org.gradle.jvmargs='-Dfile.encoding=UTF-8'
22

33
GROUP=com.squareup
4-
VERSION_NAME=1.19.0-SNAPSHOT
4+
VERSION_NAME=2.0.0
55

66
POM_URL=https://github.com/square/kotlinpoet
77
POM_SCM_URL=https://github.com/square/kotlinpoet

0 commit comments

Comments
 (0)