diff --git a/CHANGELOG.md b/CHANGELOG.md index 3642b0c7a..f6398a1a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,14 +1,14 @@ # Sourcery CHANGELOG --- -## Master +## 0.5.3 ### 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 will now use parallel parsing, expect more than 2x as fast execution. -- Sourcery will now cache source artifacts, in many scenarios it will lead to order of magnitude faster processing. +- 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 diff --git a/README.md b/README.md index 5e78981a0..4dedeef42 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ Template used to generate hashing for all types that conform to `:AutoHashable`, It adds `:Hashable` conformance to all types, except protocols (because it would require turning them into PAT's). For protocols it's just generating `var hashValue` comparator. -#### [Stencil template](Examples/AutoEquatable.stencil) +#### [Stencil template](Templates/AutoEquatable.stencil) #### Available variable annotations: @@ -99,7 +99,7 @@ Template used to generate hashing for all types that conform to `:AutoHashable`, It adds `:Hashable` conformance to all types, except protocols (because it would require turning them into PAT's). For protocols it's just generating `var hashValue` comparator. -#### [Stencil template](Examples/AutoHashable.stencil) +#### [Stencil template](Templates/AutoHashable.stencil) #### Available variable annotations: @@ -125,7 +125,7 @@ extension AdNodeViewModel: Hashable { Generate `count` and `allCases` for any enumeration that is marked with `AutoCases` phantom protocol. -#### [Stencil Template](Examples/AutoCases.stencil) +#### [Stencil Template](Templates/AutoCases.stencil) #### Example output: @@ -172,7 +172,7 @@ Create a class called `ProtocolNameMock` in which it will... * Handling success/failure cases (for callbacks) is tricky to do automatically, so you have to do that yourself. * This is **not** a full replacement for hand-written mocks, but it will get you 90% of the way there. Any more complex logic than changing return types, you will have to implement yourself. This only removes the most boring boilerplate you have to write. -#### [Stencil template](Examples/AutoMockable.stencil) +#### [Stencil template](Templates/AutoMockable.stencil) #### Example output: @@ -203,7 +203,7 @@ What are Lenses? Great explanation by @mbrandonw This script assumes you follow swift naming convention, e.g. structs start with an upper letter. -#### [Stencil template](Examples/AutoLenses.stencil) +#### [Stencil template](Templates/AutoLenses.stencil) #### Example output: diff --git a/Rakefile b/Rakefile index 678adec61..6150cd1a1 100644 --- a/Rakefile +++ b/Rakefile @@ -109,6 +109,7 @@ namespace :release do sh %Q(mkdir -p "build") sh %Q(mkdir -p "build/Resources") sh %Q(cp -r bin build/) + sh %Q(cp -r Templates build/) `cp LICENSE README.md CHANGELOG.md build` `cp Resources/daemon.gif Resources/icon-128.png build/Resources` `cd build; zip -r -X sourcery-#{podspec_version}.zip .` diff --git a/Sourcery.podspec b/Sourcery.podspec index f199ee78e..8ecc8f108 100644 --- a/Sourcery.podspec +++ b/Sourcery.podspec @@ -1,11 +1,11 @@ Pod::Spec.new do |s| s.name = "Sourcery" - s.version = "0.5.2" + s.version = "0.5.3" s.summary = "A tool that brings meta-programming to Swift, allowing you to code generate Swift code." s.description = <<-DESC - A tool that brings meta-programming to Swift, allowing you to code generate Swift code. + A tool that brings meta-programming to Swift, allowing you to code generate Swift code. * Featuring daemon mode that allows you to write templates side-by-side with generated code. * Using SourceKit so you can scan your regular code. DESC diff --git a/Sourcery/Sourcery.swift b/Sourcery/Sourcery.swift index d40a672a0..5bf4c9876 100644 --- a/Sourcery/Sourcery.swift +++ b/Sourcery/Sourcery.swift @@ -14,7 +14,7 @@ import Foundation /// If you specify templatePath as a folder, it will create a Generated[TemplateName].swift file /// If you specify templatePath as specific file, it will put all generated results into that single file public class Sourcery { - public static let version: String = inUnitTests ? "Major.Minor.Patch" : "0.5.2" + public static let version: String = inUnitTests ? "Major.Minor.Patch" : "0.5.3" public static let generationMarker: String = "// Generated using Sourcery" public static let generationHeader = "\(Sourcery.generationMarker) \(Sourcery.version) — https://github.com/krzysztofzablocki/Sourcery\n" + "// DO NOT EDIT\n\n" diff --git a/Examples/AutoCases.stencil b/Templates/AutoCases.stencil similarity index 100% rename from Examples/AutoCases.stencil rename to Templates/AutoCases.stencil diff --git a/Examples/AutoEquatable.stencil b/Templates/AutoEquatable.stencil similarity index 100% rename from Examples/AutoEquatable.stencil rename to Templates/AutoEquatable.stencil diff --git a/Examples/AutoHashable.stencil b/Templates/AutoHashable.stencil similarity index 100% rename from Examples/AutoHashable.stencil rename to Templates/AutoHashable.stencil diff --git a/Examples/AutoLenses.stencil b/Templates/AutoLenses.stencil similarity index 100% rename from Examples/AutoLenses.stencil rename to Templates/AutoLenses.stencil diff --git a/Examples/AutoMockable.stencil b/Templates/AutoMockable.stencil similarity index 100% rename from Examples/AutoMockable.stencil rename to Templates/AutoMockable.stencil