Releases: outfoxx/swiftpoet
🎉 1.4.0 Release
This release fixes an issue and adds a couple of missing features.
New Features
- Implicitly unwrapped optionals are now supported via
TypeName.makeImplicit
. - Weak/Unowned reference support has been added to
PropertySpec
using newWEAK
andUNOWNED
modifiers. DeclaredTypeName
can now be forced to always fully qualify the type name instead of relying on module imports.
Resolved Issues
- Top level members now assume the correct implicit access level.
- Imports for extensions on externally defined types are now imported correctly.
- Rules for nesting type aliases in protocols have been fixed.
🎉 1.3.1 Release
This release adds new features for basic Swift Concurrency support and other bug fixes.
New Features
TypeSpec.actorBuilder
has been added to allow defining actor types.FunctionSpec.async(Bool)
has been added to allow definingasync
functions.
Resolved Issues
TupleTypeName
now correctly allows multiple unnamed types.
Note: The unused Guava dependency has been removed from the package; it was leftover and has been unused for some time.
🎉 1.3.0 Release
⚠️ Broken Release
This release is missing artifacts in Maven Central. It has been re-released as 1.3.1
.
🎉 1.2.0 Release
This release adds new features and bug fixes
New Features
FunctionSpec.operatorBuilder
has been added to allow defining operator functions.FunctionSpec.deinitializerBuilder
has been added to allow definingdeinit
functions.- Missing
ParameterSpec.addAttribute
functions have been added toParameterSpec.Builder
.
Resolved Issues
@escaping
closure parameters can now be generated usingParameterSpec.addAttribute(AttributeSpec.ESCAPING)
.FunctionTypeName
signatures are now generated correctly (without names).- Generic types with multiple bounds are now generated correctly.
🎉 1.1.0 Release
1.1.0 is here and provides new features and bug fixes.
New Features
NameAllocator
brought over to allocate names avoiding collisions.Taggable
brought over to allow tagging generated objects with domain specific metadata.nextControlFlow
now has sensible defaults.AnyTypeSpec.typeSpecs
is now public (like other API properties).
Resolved Issues
- Fixed
nextControlFlow
extra spacing issue. - Remove incorrect limitation on generated Swift file names.
Complete list of updates & fixes is here
🎉 1.0.0 Release
1.0.0 is here and provides new features, fixes and breaking changes.
New Features
mutating
andnonmutating
modifiers are supported.typealias
's can be defined viaTypeAliasSpec
.-
TypeAliasSpec
be used anywhere aTypeSpec
was previously allowed.
- Enum cases allow documentation & attributes.
AttributeSpec
accepts aDeclaredTypeName
as the identifier for generating use of property wrappers.#iif/#endif
guards can be added to anyFileSpec
member.FunctionSpec
allows adding local type definitions that are emitted prior to general code.- Simple property
get
functions are emitted in concise format.
Breaking Changes
addKDoc
has been renamed toaddDoc
.
Quite simpley, Swift documentation isn't referred to as KDoc.beginControlFlow
/nextControlFlow
/endControlFlow
requires the control flow construct be provided explicitly.
The idiomatic Swift format (or at least the Xcode default) doesn't indent thecase
s ofswitch
es. Providing the control flow construct explicitly allows the code to be generated matching this format.
Resolved Issues
- Reserved property & enum case names are allowed and correctly escaped using backticks.
- Reserved names are now correctly escaped using backticks.
Complete list of updates & fixes is here
Thanks
Special thanks to @JakeWharton & @efirestone for their help on the library and this release!
`class` only protocols
- Allow constraining a protocol to
class
- Adds constants for
AnyObject
andAnyClass
Add `Self` type name
Allows using Self
as a TypeName
in code and in CodeBlock
s (via %T
)
Primary Release
The primary release has complete support generating:
- Type (
class
/struct
) Declarations - Enum Declarations
- Protocol Declarations
- Extension Declarations (with/without conditional conformances)
- Function Declarations
- Type Alias Declarations
It also supports generating type names referring to:
- Simple Types
- Generic (e.g. Parameterized) Types
- Tuple Types
- Function Types
Generating complex code blocks is easily done and includes automatic tracking of module imports and generating the most concise syntax possible.