outfoxx / swiftpoet

Kotlin and Java API for generating .swift source files.
Apache License 2.0
277 stars 26 forks source link

Improve output of AttributeSpec to accept CodeBlocks. #91

Closed dnkoutso closed 7 months ago

dnkoutso commented 7 months ago

A while ago this PR was opened https://github.com/outfoxx/swiftpoet/pull/86 to better handle escaping of strings within attributes.

For Wire we added this temporary commit https://github.com/square/wire/commit/08836c7102c7d9981c588bc5373576491e945b8f to circumvent this issue until a new release of SwiftPoet is ready.

This PR here extends #86 to further use some of the newly added booleans in the Util methods. In particular, AttributeSpec now accepts code blocks to properly format strings etc.

This means that in Wire we can delete the above commit and lean on SwiftPoet to do the right thing. The PR also brings some tests present in KotlinPoet.