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.
This PR contains the following updates:
1.13.1
->2.2.0
1.13.1
->2.2.0
Release Notes
square/kotlinpoet (com.squareup:kotlinpoet-ksp)
v2.2.0
Compare Source
Thanks to @IRus for contributing to this release.
v2.1.0
Compare Source
Thanks to @ForteScarlet, @TrevorSStone, @RaoPrashanth, @damianw, @ansehoon1999, @TheMrMilchmann for contributing to this release.
TypeName.MUTABLE_MAP_ENTRY
now correctly uses theMutableEntry
nested class name. (#2061)v2.0.0
Compare Source
Thanks to @brokenhappy, @tajobe, @niyajali, @ForteScarlet for contributing to this release.
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.♢
placeholder representing a space that is safe to wrap.KSTypeAlias.toClassName()
. (#1956)KSType.toClassNameOrNull()
. (#1956)KSAnnotation.toAnnotationSpec()
. (#1956)KSType.toClassName()
. (#1956)v1.18.1
Compare Source
Thanks to @mitasov-ra for contributing to this release.
v1.18.0
Compare Source
Thanks to @DanielGronau for contributing to this release.
kotlinpoet-metadata
out of preview to stable.kotlinpoet-metadata
to stableorg.jetbrains.kotlin:kotlin-metadata-jvm
artifact for Metadata parsing.KSAnnotation.toAnnotationSpec()
andKSClassDeclaration.toClassName()
more robust.LambdaTypeName
s inKSTypeReference.toTypeName()
.%L
translation (#1927).v1.17.0
Compare Source
Thanks to @jisungbin, @hfhbd, @evant, @sgjesse, @sebek64 for contributing to this release.
KotlinClassMetadata.read
is deprecated in 0.9.0 and replaced withreadStrict
(#1830).lenient
parameters to map to the underlyingreadStrict()
andreadLenient()
calls (#1766).Class
/TypeElement
/Metadata
-to-KmClass
APIs from the public API, as these are trivial to write now with kotlinx-metadata's newer APIs and allows us to focus the API surface area of this artifact better (#1891).MemberSpecHolder
interface for constructs that can holdPropertySpec
s andFunSpec
s and their builders (#1877).joinToCode
variant which operates on any type, but requires a transform lambda to convert each element into aCodeBlock
(#1874).KSAnnotation.toAnnotationSpec()
(#1889).FileSpec.scriptBuilder
(#1813).PropertySpec
(#1827).KSAnnotation.toAnnotationSpec
writes varargs in place instead of making them an array to work around a Kotlin issue with OptIn annotations (#1833).MemberName
s without a package are now correctly imported (#1841)KSType.toClassName()
(#1890).MemberName
s (#1909).v1.16.0
Compare Source
Thanks to @drawers, @rickclephas for contributing to this release.
NameAllocator
API to control keyword pre-allocation (#1803).KSTypeReference.toTypeName
(#1793).v1.15.3
Compare Source
Thanks to @gabrielittner for contributing to this release.
KSTypeReference.toTypeName
(#1756).v1.15.2
Compare Source
Thanks to @evant for contributing to this release.
v1.15.1
Compare Source
v1.15.0
Compare Source
Thanks to @drawers, @fejesjoco, @takahirom, @martinbonnin, @mcarleio for contributing to this release.
In this release the
:kotlinpoet
module has been converted to a Kotlin Multiplatform module (#1654), though for now it only supports the JVM target.TypeSpecHolder
interface for constructs that can hold aTypeSpec
and their builders (#1723).FileSpec
(#1720).FileSpec.writeTo()
. (#1514).TypeSpec.expectClassBuilder()
andTypeSpec.valueClassBuilder()
(#1589).KSAnnotation
toAnnotationSpec
while omitting default values (#1538).FileSpec.builder
convenience forMemberName
(#1585).DecimalFormatSymbols.minusSign
for consistency across locales (#1658).:kotlinpoet-metadata
module, as mostFlags
-API extensions have been removed in favor of the now-available first-party versions.v1.14.2
Compare Source
Annotatable.Builder
(#1581).v1.14.1
Compare Source
v1.14.0
Compare Source
Thanks to @Omico, @drawers, @RBusarow for contributing to this release.
New: Kotlin 1.8.21.
New: KSP 1.8.21-1.0.11.
New: Enable default methods in Java bytecode (#1561).
New: Group Kotlin and Renovate updates together in Renovate (#1562).
New: Extract trait interface for annotatable constructs and their builders (#1564).
New: Extract trait interface for documentable constructs and their builders (#1571).
New: Document the usage of
STAR
(#1572).New: Add builder for
FunSpec
which accepts aMemberName
(#1574).Fix: Omit public modifier on override function or constructor parameters (#1550).
Fix: Correct handling of members in various types (#1558).
Fix: Function return types now default to
Unit
unless explicitly set (#1559).Previously the default was
null
which behaved likeUnit
for block bodies. When an expression body was produced,however, no return type would be emitted. This meant that the return type was implicit based on the contents of
the body.
With this change, when no return type is specified and an expression body is produced, the return type will be
explicitly
Unit
. Specify the actual return type explicitly to correct the output.Old versions:
This version, incorrect:
This version, correct:
val funSpec = FunSpec.builder("foo") + .returns(INT) .addStatement("return 1") .build()
Additionally, as part of this change,
FunSpec.returnType
has changed to be non-nullable. This is a source- andbinary-compatible change, although if you were performing null-checks then new warnings may appear after upgrade.
Fix: Append nested class names to alias during name lookup (#1568).
Fix: Allow PropertySpec with context receivers and without getter or setter (#1575).
v1.13.2
Compare Source
What's Changed
New Contributors
Full Changelog: square/kotlinpoet@1.13.1...1.13.2
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR was generated by Mend Renovate. View the repository job log.