Skip to content

Releases: outfoxx/swiftpoet

🎉 1.4.0 Release

13 May 00:13
Compare
Choose a tag to compare

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 new WEAK and UNOWNED 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

29 Oct 01:18
3d07393
Compare
Choose a tag to compare

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 defining async 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

28 Oct 23:47
b594079
Compare
Choose a tag to compare

⚠️ Broken Release

This release is missing artifacts in Maven Central. It has been re-released as 1.3.1.

🎉 1.2.0 Release

21 Oct 22:49
df29e1d
Compare
Choose a tag to compare

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 defining deinit functions.
  • Missing ParameterSpec.addAttribute functions have been added to ParameterSpec.Builder.

Resolved Issues

  • @escaping closure parameters can now be generated using ParameterSpec.addAttribute(AttributeSpec.ESCAPING).
  • FunctionTypeName signatures are now generated correctly (without names).
  • Generic types with multiple bounds are now generated correctly.

🎉 1.1.0 Release

12 Mar 23:32
Compare
Choose a tag to compare

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

21 Aug 21:26
950ff31
Compare
Choose a tag to compare

1.0.0 is here and provides new features, fixes and breaking changes.

New Features

  • mutating and nonmutating modifiers are supported.
  • typealias's can be defined via TypeAliasSpec.
    • TypeAliasSpec be used anywhere a TypeSpec was previously allowed.
  • Enum cases allow documentation & attributes.
  • AttributeSpec accepts a DeclaredTypeName as the identifier for generating use of property wrappers.
  • #iif/#endif guards can be added to any FileSpec 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 to addDoc.
    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 the cases of switches. 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

18 Dec 21:21
Compare
Choose a tag to compare
  • Allow constraining a protocol to class
  • Adds constants for AnyObject and AnyClass

Add `Self` type name

18 Dec 20:41
Compare
Choose a tag to compare

Allows using Self as a TypeName in code and in CodeBlocks (via %T)

Primary Release

11 Jul 07:07
Compare
Choose a tag to compare

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.