0.5.7

@krzysztofzablocki krzysztofzablocki released this Feb 16, 2017 · 11 commits to master since this release

Bug Fixes

  • Cache initial file contents, including the inline generated ranges so that they are always up to date

Downloads

0.5.6

@krzysztofzablocki krzysztofzablocki released this Feb 15, 2017 · 15 commits to master since this release

New Features

  • Added per file code generation

Bug Fixes

  • Fixed parsing annotations with complex content
  • Fixed inline parser using wrong caching logic

Downloads

0.5.5

@krzysztofzablocki krzysztofzablocki released this Feb 8, 2017 · 22 commits to master since this release

New Features

  • Sourcery will no longer write files if content didn't change, this improves behaviour of things depending on modification date like Xcode, Swiftlint.

Internal changes

  • Improved support for contained types

Bug Fixes

  • Fixes cache handling that got broken in 0.5.4

Downloads

0.5.4

@krzysztofzablocki krzysztofzablocki released this Feb 4, 2017 · 30 commits to master since this release

New Features

  • Added inline code generation
  • Added isClosure property to TypeName to detect closure types

Bug Fixes

  • Fixed parsing of associated values separater by newlines
  • Fixed preserving order of inherited types
  • Improved support for throwing methods in protocols
  • Fixed extracting parameters of methods with closures in their bodies
  • Fixed extracting method return types of tuple types
  • Improved support for typealises as tuple elements types
  • Method parameters with _ argument label will now have nil in argumentLabel property
  • Improved support for generic methods

Internal changes

  • adjusted internal templates and updated generated code
  • moved methods parsing related tests in a separate spec

Downloads

0.5.3

@krzysztofzablocki krzysztofzablocki released this Jan 13, 2017 · 73 commits to master since this release

New Features

  • Added support for method return types with throws and rethrows
  • Added a new filter replace. Usage: {{ name|replace:"substring","replacement" }} - replaces occurrences of substring with replacement in name (case sensitive)
  • Improved support for inferring types of variables with initial values
  • Sourcery is now bundling a set of example templates, you can access them in Templates folder.
  • We now use parallel parsing and cache source artifacts. This leads to massive performance improvements:
  • e.g. on big codebase of over 300 swift files:
Sourcery 0.5.2
Processing time 8.69941002130508 seconds

Sourcery 0.5.3
First time 4.69904798269272 seconds
Subsequent time: 0.882099032402039 seconds

Bug Fixes

  • Method accessLevel was not exposed as string so not accessible properly via templates, fixed that.
  • Fixes on Swift Templates

Downloads

0.5.2

@krzysztofzablocki krzysztofzablocki released this Jan 9, 2017 · 92 commits to master since this release

New Features

  • Added support for ImplicitlyUnwrappedOptional
  • actualTypeName property of Method.Parameter, Variable, Enum.Case.AssociatedValue, TupleType.Element now returns typeName if type is not a type alias
  • Enum now contains type information for its raw value type. rawType now return Type object, rawTypeName returns its TypeName
  • Added annotated filter to filter by annotations
  • Added negative filters counterparts
  • Added support for attributes, i.e. @escaping
  • Experimental support for Swift Templates
<% for type in types.classes { %>
    extension <%= type.name %>: Equatable {}

    <% if type.annotations["showComment"] != nil { %> // <%= type.name %> has Annotations <% } %>

        func == (lhs: <%= type.name %>, rhs: <%= type.name %>) -> Bool {
    <% for variable in type.variables { %> if lhs.<%= variable.name %> != rhs.<%= variable.name %> { return false }
        <% } %>
        return true
    }
<% } %>

Downloads

0.5.1

@krzysztofzablocki krzysztofzablocki released this Jan 5, 2017 · 114 commits to master since this release

New Features

  • Variables with default initializer are now supported, e.g. var variable = Type(...)
  • Added support for special escaped names in enum cases e.g. default or for
  • Added support for tuple types and tuple filter for variables
  • Enum associated values now have localName and externalName properties.
  • Added actualTypeName for TypeName that is typealias
  • Added implements, inherits and based filters

Bug Fixes

  • Using protocols doesn't expose variables using KVC, which meant some of the typeName properties weren't accessible via Templates, we fixed that using Sourcery itself to generate specific functions.
  • Fixed parsing typealiases for tuples and closure types
  • Fixed parsing associated values of generic types

Internal Changes

  • Performed significant refactoring and simplified mutations in parsers

Downloads

0.5.0

@krzysztofzablocki krzysztofzablocki released this Dec 30, 2016 · 128 commits to master since this release

  • You can now pass arbitrary values to templates with --args argument.
  • Added open access level
  • Type inherits and implements now allow you to access full type information, not just name
  • Type allVariables will now include all variables, including those inherited from supertype and known protocols.
  • Type allMethods will now include all methods, including those inherited from supertype and known protocols.
  • AssociatedValue exposes unwrappedTypeName, isOptional
  • New Available stencil filters:
    • static, instance, computed, stored for Variables
    • enum, class, struct, protocol for Types
    • class, initializer, static, instance for Methods
    • count for Arrays, this is used when chaining arrays with filters where Stencil wouldn't allow us to do .count, e.g. {{ variables|instance|count }}
  • Now you can avoid inferring unknown protocols as enum raw types by adding conformance in extension (instead of enum Foo: Equatable {} do enum Foo {}; extension Foo: Equatable {})

Internal changes

  • Refactor code around typenames

Downloads

0.4.9

@krzysztofzablocki krzysztofzablocki released this Dec 25, 2016 · 142 commits to master since this release

New Features

  • Watch mode now works with folders, reacting to source-code changes and adding templates/source files.
  • When using watch mode, status info will be displayed in the generated code so that you don't need to look at console at all.
  • You can now access types of enum's associated values
  • You can now access type's methods and initializers

Downloads

0.4.8

@krzysztofzablocki krzysztofzablocki released this Dec 23, 2016 · 150 commits to master since this release

New Features

  • You can now access supertype of a class
  • Associated values will now automatically use idx as name if no name is provided

Bug Fixes

  • Fix dealing with multibyte characters
  • types.implementing and types.based should include protocols that are based on other protocols

Downloads