Skip to content

Commit

Permalink
Incorporating Sourcery 0.16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
amichnia committed Apr 3, 2019
1 parent d765556 commit f3a2f4d
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 626 deletions.
3 changes: 1 addition & 2 deletions Mocky.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@
C8EF7B7921FB423A00AFA545 /* TemplateHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TemplateHelper.swift; sourceTree = "<group>"; };
C8EF7B7A21FB423A00AFA545 /* ParameterWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParameterWrapper.swift; sourceTree = "<group>"; };
C8EF7B7B21FB423A00AFA545 /* Helpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Helpers.swift; sourceTree = "<group>"; };
C8EF7B7C21FB423A00AFA545 /* Mock.swifttemplate */ = {isa = PBXFileReference; lastKnownFileType = text; path = Mock.swifttemplate; sourceTree = "<group>"; };
C8EF7B7D21FB423A00AFA545 /* Header.swifttemplate */ = {isa = PBXFileReference; lastKnownFileType = text; path = Header.swifttemplate; sourceTree = "<group>"; };
C8EF7B7E21FB423A00AFA545 /* Main.swifttemplate */ = {isa = PBXFileReference; lastKnownFileType = text; path = Main.swifttemplate; sourceTree = "<group>"; };
C8EF7B7F21FB423A00AFA545 /* TypeWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypeWrapper.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -497,7 +496,6 @@
C8EF7B8021FB423A00AFA545 /* SubscriptWrapper.swift */,
C8EF7B8321FB423A00AFA545 /* VariableWrapper.swift */,
C8EF7B7E21FB423A00AFA545 /* Main.swifttemplate */,
C8EF7B7C21FB423A00AFA545 /* Mock.swifttemplate */,
);
path = Templates;
sourceTree = "<group>";
Expand Down Expand Up @@ -1079,6 +1077,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ target 'Mocky_Example_macOS' do
end

post_install do |installer|
system("rake sourcery 4.2")
system("rake sourcery")
end
16 changes: 8 additions & 8 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
PODS:
- Sourcery (0.15.0)
- SwiftyMocky (3.2.0-pre):
- SwiftyMocky/Core (= 3.2.0-pre)
- SwiftyMocky/Core (3.2.0-pre):
- Sourcery
- Sourcery (0.16.0)
- SwiftyMocky (3.2.0):
- SwiftyMocky/Core (= 3.2.0)
- SwiftyMocky/Core (3.2.0):
- Sourcery (> 0.16)

DEPENDENCIES:
- SwiftyMocky (from `./`)
Expand All @@ -17,9 +17,9 @@ EXTERNAL SOURCES:
:path: "./"

SPEC CHECKSUMS:
Sourcery: 5895672cae353cdbfa95f3f4aaeb75a664d76f6a
SwiftyMocky: c7e9af4f3c1db03819aa5cb85ee142ce6c10eb2b
Sourcery: 3e55aad9719ee5782ab81eb16addd44d272e4d13
SwiftyMocky: 20ee055796bb023142e83a23bee86d43ecb6c29a

PODFILE CHECKSUM: cdf7b5fe099a9d915745d7d33c48441088136050
PODFILE CHECKSUM: 2c8b2a04598345eef7278f0b805b84438bb9f711

COCOAPODS: 1.6.1
4 changes: 4 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ task :template do
sh "cd ./Templates && cat Main.swifttemplate >> #{destination}"
end

task :xcode do
sh "open Mocky.xcworkspace"
end

## [ Sourcery ] ################################################################

desc "Download prebuilt sourcery app."
Expand Down
18 changes: 9 additions & 9 deletions Sources/Templates/Mock.swifttemplate
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ func stringArray(fromArguments arguments: [String: Any], forKey key: String) ->
}
_%>
<%# ================================================== SwiftLint -%><%_ -%>
<%_ for rule in swiftLintRules(arguments) { -%>
<%_ for rule in swiftLintRules(argument) { -%>
<%_ %><%= rule %>
<%_ } -%>
<%# ================================================== SwiftLint (aggregated arguments) -%><%_ -%>
<%_ if let swiftyMockyArgs = arguments["swiftyMocky"] as? [String: Any], let rules = swiftyMockyArgs["excludedSwiftLintRules"] as? [String] { -%>
<%# ================================================== SwiftLint (aggregated argument) -%><%_ -%>
<%_ if let swiftyMockyArgs = argument["swiftyMocky"] as? [String: Any], let rules = swiftyMockyArgs["excludedSwiftLintRules"] as? [String] { -%>
<%_ for rule in rules { -%>
<%_ %>//swiftlint:disable <%= rule %>
<%_ } -%>
Expand All @@ -50,11 +50,11 @@ _%>
#if MockyCustom
import SwiftyMocky
<%# ================================================== IMPORTS InAPP -%><%_ -%>
<%_ for projectImport in projectImports(arguments) { -%>
<%_ for projectImport in projectImports(argument) { -%>
<%_ %><%= projectImport %>
<%_ } -%>
<%# ============================ IMPORTS InAPP (aggregated arguments) -%><%_ -%>
<%_ if let swiftyMockyArgs = arguments["swiftyMocky"] as? [String: Any] { -%>
<%# ============================ IMPORTS InAPP (aggregated argument) -%><%_ -%>
<%_ if let swiftyMockyArgs = argument["swiftyMocky"] as? [String: Any] { -%>
<%_ for projectImport in imports(swiftyMockyArgs) { -%>
<%_ %><%= projectImport %>
<%_ } -%>
Expand All @@ -76,11 +76,11 @@ import SwiftyMocky
import SwiftyMocky
import XCTest
<%# ================================================== IMPORTS -%><%_ -%>
<%_ for projectImport in projectImports(arguments) { -%>
<%_ for projectImport in projectImports(argument) { -%>
<%_ %><%= projectImport %>
<%_ } -%>
<%# ============================ IMPORTS InAPP (aggregated arguments) -%><%_ -%>
<%_ if let swiftyMockyArgs = arguments["swiftyMocky"] as? [String: Any] { -%>
<%# ============================ IMPORTS InAPP (aggregated argument) -%><%_ -%>
<%_ if let swiftyMockyArgs = argument["swiftyMocky"] as? [String: Any] { -%>
<%_ for projectImport in projectImports(swiftyMockyArgs) { -%>
<%_ %><%= projectImport %>
<%_ } -%>
Expand Down
2 changes: 1 addition & 1 deletion SwiftyMocky-Tests/iOS/Mocks/Mock.generated.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated using Sourcery 0.15.0 — https://github.com/krzysztofzablocki/Sourcery
// Generated using Sourcery 0.16.0 — https://github.com/krzysztofzablocki/Sourcery
// DO NOT EDIT


Expand Down
2 changes: 1 addition & 1 deletion SwiftyMocky-Tests/macOS/Mocks/Mock.generated.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated using Sourcery 0.15.0 — https://github.com/krzysztofzablocki/Sourcery
// Generated using Sourcery 0.16.0 — https://github.com/krzysztofzablocki/Sourcery
// DO NOT EDIT


Expand Down
2 changes: 1 addition & 1 deletion SwiftyMocky-Tests/tvOS/Mocks/Mock.generated.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated using Sourcery 0.15.0 — https://github.com/krzysztofzablocki/Sourcery
// Generated using Sourcery 0.16.0 — https://github.com/krzysztofzablocki/Sourcery
// DO NOT EDIT


Expand Down
4 changes: 2 additions & 2 deletions SwiftyMocky.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'SwiftyMocky'
s.version = '3.2.0-pre'
s.version = '3.2.0'
s.summary = 'Unit testing library for Swift, with mock generation. Adds a set of handy methods, simplifying testing.'
s.description = <<-DESC
Library that uses metaprogramming technique to generate mocks based on sources, that makes testing for Swift Mockito-like.
Expand All @@ -33,7 +33,7 @@ Library that uses metaprogramming technique to generate mocks based on sources,
core.xcconfig = { 'OTHER_SWIFT_FLAGS' => '-DMocky' }
core.frameworks = 'Foundation'
core.weak_framework = "XCTest"
core.dependency 'Sourcery'
core.dependency 'Sourcery', '> 0.16'
core.pod_target_xcconfig = {
'APPLICATION_EXTENSION_API_ONLY' => 'YES',
'ENABLE_BITCODE' => 'NO',
Expand Down
18 changes: 9 additions & 9 deletions Templates/Header.swifttemplate
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<%# ================================================== SwiftLint -%><%_ -%>
<%_ for rule in swiftLintRules(arguments) { -%>
<%_ for rule in swiftLintRules(argument) { -%>
<%_ %><%= rule %>
<%_ } -%>
<%# ================================================== SwiftLint (aggregated arguments) -%><%_ -%>
<%_ if let swiftyMockyArgs = arguments["swiftyMocky"] as? [String: Any], let rules = swiftyMockyArgs["excludedSwiftLintRules"] as? [String] { -%>
<%# ================================================== SwiftLint (aggregated argument) -%><%_ -%>
<%_ if let swiftyMockyArgs = argument["swiftyMocky"] as? [String: Any], let rules = swiftyMockyArgs["excludedSwiftLintRules"] as? [String] { -%>
<%_ for rule in rules { -%>
<%_ %>//swiftlint:disable <%= rule %>
<%_ } -%>
Expand All @@ -12,11 +12,11 @@
#if MockyCustom
import SwiftyMocky
<%# ================================================== IMPORTS InAPP -%><%_ -%>
<%_ for projectImport in projectImports(arguments) { -%>
<%_ for projectImport in projectImports(argument) { -%>
<%_ %><%= projectImport %>
<%_ } -%>
<%# ============================ IMPORTS InAPP (aggregated arguments) -%><%_ -%>
<%_ if let swiftyMockyArgs = arguments["swiftyMocky"] as? [String: Any] { -%>
<%# ============================ IMPORTS InAPP (aggregated argument) -%><%_ -%>
<%_ if let swiftyMockyArgs = argument["swiftyMocky"] as? [String: Any] { -%>
<%_ for projectImport in imports(swiftyMockyArgs) { -%>
<%_ %><%= projectImport %>
<%_ } -%>
Expand All @@ -38,11 +38,11 @@ import SwiftyMocky
import SwiftyMocky
import XCTest
<%# ================================================== IMPORTS -%><%_ -%>
<%_ for projectImport in projectImports(arguments) { -%>
<%_ for projectImport in projectImports(argument) { -%>
<%_ %><%= projectImport %>
<%_ } -%>
<%# ============================ IMPORTS InAPP (aggregated arguments) -%><%_ -%>
<%_ if let swiftyMockyArgs = arguments["swiftyMocky"] as? [String: Any] { -%>
<%# ============================ IMPORTS InAPP (aggregated argument) -%><%_ -%>
<%_ if let swiftyMockyArgs = argument["swiftyMocky"] as? [String: Any] { -%>
<%_ for projectImport in projectImports(swiftyMockyArgs) { -%>
<%_ %><%= projectImport %>
<%_ } -%>
Expand Down
Loading

0 comments on commit f3a2f4d

Please sign in to comment.