From 251752bea52a0ce35d8467da59d1ac484e1eeafb Mon Sep 17 00:00:00 2001 From: David Jennes Date: Wed, 26 Sep 2018 01:16:48 +0200 Subject: [PATCH 1/6] Update pods --- Podfile | 11 +- Podfile.lock | 16 +- .../StencilSwiftKit.podspec.json | 4 +- Pods/Manifest.lock | 16 +- Pods/PathKit/README.md | 4 +- Pods/Pods.xcodeproj/project.pbxproj | 164 +++++++-------- Pods/Stencil/LICENSE | 3 +- Pods/Stencil/Sources/Errors.swift | 22 +- Pods/Stencil/Sources/Extension.swift | 9 + Pods/Stencil/Sources/Filters.swift | 8 +- Pods/Stencil/Sources/ForTag.swift | 4 +- Pods/Stencil/Sources/IfTag.swift | 87 ++++++-- Pods/Stencil/Sources/Include.swift | 6 +- Pods/Stencil/Sources/Inheritence.swift | 6 +- Pods/Stencil/Sources/KeyPath.swift | 2 +- Pods/Stencil/Sources/Lexer.swift | 189 ++++++++++-------- Pods/Stencil/Sources/Node.swift | 46 +++++ Pods/Stencil/Sources/Parser.swift | 26 +-- Pods/Stencil/Sources/Tokenizer.swift | 29 +-- Pods/Stencil/Sources/Variable.swift | 42 ++-- Pods/Target Support Files/PathKit/Info.plist | 2 +- .../Pods-Tests-acknowledgements.markdown | 3 +- .../Pods-Tests-acknowledgements.plist | 3 +- Pods/Target Support Files/Stencil/Info.plist | 2 +- StencilSwiftKit.podspec | 4 +- 25 files changed, 417 insertions(+), 291 deletions(-) diff --git a/Podfile b/Podfile index aa6ebbd9..a08afb0d 100644 --- a/Podfile +++ b/Podfile @@ -5,14 +5,5 @@ raise 'Please use bundle exec to run the pod command' unless defined?(Bundler) target 'Tests' do pod 'StencilSwiftKit', path: '.' - pod 'SwiftLint', '~> 0.25' -end - -post_install do |installer| - swift3_pods = %w[Stencil] - installer.pods_project.targets.each do |target| - target.build_configurations.each do |config| - config.build_settings['SWIFT_VERSION'] = '3.2' if swift3_pods.include?(target.name) - end - end + pod 'SwiftLint', '~> 0.27' end diff --git a/Podfile.lock b/Podfile.lock index af71a73d..72aa015c 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,14 +1,14 @@ PODS: - - PathKit (0.9.1) - - Stencil (0.12.1): + - PathKit (0.9.2) + - Stencil (0.13.0): - PathKit (~> 0.9.0) - StencilSwiftKit (2.6.0): - - Stencil (~> 0.12.1) + - Stencil (~> 0.13.0) - SwiftLint (0.27.0) DEPENDENCIES: - StencilSwiftKit (from `.`) - - SwiftLint (~> 0.25) + - SwiftLint (~> 0.27) SPEC REPOS: https://github.com/cocoapods/specs.git: @@ -21,11 +21,11 @@ EXTERNAL SOURCES: :path: "." SPEC CHECKSUMS: - PathKit: 7dcba9f0150afb67e0a520c49707a2cbc8e95937 - Stencil: 8a08577b341a059420c444b8aa5733378a6a4384 - StencilSwiftKit: e509ccb9680e00eb877d3d944c8c408ef233bf2f + PathKit: 273f59a38e3218eb95abd9f6a61730a8bcfd2f06 + Stencil: 0f46117fc081cc506d5c4b5b90cfdfe207945aa9 + StencilSwiftKit: f68ec52f2447fe0756e92c92fd9ca3e9a49b7fb2 SwiftLint: 3207c1faa2240bf8973b191820a116113cd11073 -PODFILE CHECKSUM: 0bd9ec310bace9d5b62e785ea1fb74547c15074d +PODFILE CHECKSUM: bfb045d6ef409d0ed3751cc1023e316c5e7803ad COCOAPODS: 1.5.3 diff --git a/Pods/Local Podspecs/StencilSwiftKit.podspec.json b/Pods/Local Podspecs/StencilSwiftKit.podspec.json index 482d74ed..26ea0135 100644 --- a/Pods/Local Podspecs/StencilSwiftKit.podspec.json +++ b/Pods/Local Podspecs/StencilSwiftKit.podspec.json @@ -12,7 +12,7 @@ "platforms": { "osx": "10.9" }, - "swift_version": "4.0", + "swift_version": "4.2", "cocoapods_version": ">= 1.4.0", "source": { "git": "https://github.com/SwiftGen/StencilSwiftKit.git", @@ -21,7 +21,7 @@ "source_files": "Sources/**/*.swift", "dependencies": { "Stencil": [ - "~> 0.12.1" + "~> 0.13.0" ] }, "frameworks": "Foundation" diff --git a/Pods/Manifest.lock b/Pods/Manifest.lock index af71a73d..72aa015c 100644 --- a/Pods/Manifest.lock +++ b/Pods/Manifest.lock @@ -1,14 +1,14 @@ PODS: - - PathKit (0.9.1) - - Stencil (0.12.1): + - PathKit (0.9.2) + - Stencil (0.13.0): - PathKit (~> 0.9.0) - StencilSwiftKit (2.6.0): - - Stencil (~> 0.12.1) + - Stencil (~> 0.13.0) - SwiftLint (0.27.0) DEPENDENCIES: - StencilSwiftKit (from `.`) - - SwiftLint (~> 0.25) + - SwiftLint (~> 0.27) SPEC REPOS: https://github.com/cocoapods/specs.git: @@ -21,11 +21,11 @@ EXTERNAL SOURCES: :path: "." SPEC CHECKSUMS: - PathKit: 7dcba9f0150afb67e0a520c49707a2cbc8e95937 - Stencil: 8a08577b341a059420c444b8aa5733378a6a4384 - StencilSwiftKit: e509ccb9680e00eb877d3d944c8c408ef233bf2f + PathKit: 273f59a38e3218eb95abd9f6a61730a8bcfd2f06 + Stencil: 0f46117fc081cc506d5c4b5b90cfdfe207945aa9 + StencilSwiftKit: f68ec52f2447fe0756e92c92fd9ca3e9a49b7fb2 SwiftLint: 3207c1faa2240bf8973b191820a116113cd11073 -PODFILE CHECKSUM: 0bd9ec310bace9d5b62e785ea1fb74547c15074d +PODFILE CHECKSUM: bfb045d6ef409d0ed3751cc1023e316c5e7803ad COCOAPODS: 1.5.3 diff --git a/Pods/PathKit/README.md b/Pods/PathKit/README.md index 5d6fed44..e7ab775d 100644 --- a/Pods/PathKit/README.md +++ b/Pods/PathKit/README.md @@ -19,13 +19,13 @@ let path = Path("/usr/bin") + Path("swift") #### Determine if a path is absolute ```swift -path.isAbsolute() +path.isAbsolute ``` #### Determine if a path is relative ```swift -path.isRelative() +path.isRelative ``` #### Determine if a file or directory exists at the path diff --git a/Pods/Pods.xcodeproj/project.pbxproj b/Pods/Pods.xcodeproj/project.pbxproj index 34ecc59c..dc9d65dd 100644 --- a/Pods/Pods.xcodeproj/project.pbxproj +++ b/Pods/Pods.xcodeproj/project.pbxproj @@ -742,9 +742,9 @@ }; name = Debug; }; - 0687C04683C74577B8BFEBC9529E8C8E /* Release */ = { + 112C75C3E965FEFAC7CDBC58E1B1A39E /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 25D7CEBCA776864EAD15F55C95A07CF5 /* StencilSwiftKit.xcconfig */; + baseConfigurationReference = 97032A4D25D296E9882698752EBF3D0B /* PathKit.xcconfig */; buildSettings = { CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; @@ -757,27 +757,27 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; - GCC_PREFIX_HEADER = "Target Support Files/StencilSwiftKit/StencilSwiftKit-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/StencilSwiftKit/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/PathKit/PathKit-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/PathKit/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.9; - MODULEMAP_FILE = "Target Support Files/StencilSwiftKit/StencilSwiftKit.modulemap"; - PRODUCT_MODULE_NAME = StencilSwiftKit; - PRODUCT_NAME = StencilSwiftKit; + MODULEMAP_FILE = "Target Support Files/PathKit/PathKit.modulemap"; + PRODUCT_MODULE_NAME = PathKit; + PRODUCT_NAME = PathKit; SDKROOT = macosx; SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.0; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.2; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Release; + name = Debug; }; - 3FD3892DC5B0915E845ECB1F06A2C19D /* Release */ = { + 300CF79C4D2FA7E248CDCBE4E9E2F534 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = DB31CD7205910D0B0EC5BCAD82B29254 /* Stencil.xcconfig */; + baseConfigurationReference = 25D7CEBCA776864EAD15F55C95A07CF5 /* StencilSwiftKit.xcconfig */; buildSettings = { CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; @@ -790,62 +790,27 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; - GCC_PREFIX_HEADER = "Target Support Files/Stencil/Stencil-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/Stencil/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/StencilSwiftKit/StencilSwiftKit-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/StencilSwiftKit/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.9; - MODULEMAP_FILE = "Target Support Files/Stencil/Stencil.modulemap"; - PRODUCT_MODULE_NAME = Stencil; - PRODUCT_NAME = Stencil; + MODULEMAP_FILE = "Target Support Files/StencilSwiftKit/StencilSwiftKit.modulemap"; + PRODUCT_MODULE_NAME = StencilSwiftKit; + PRODUCT_NAME = StencilSwiftKit; SDKROOT = macosx; SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.2; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 65F9F1FC29F7B97C409FC2BF9EABC901 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 77549DFEB1FD0EB82601E5D4D2ED43E8 /* Pods-Tests.release.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_VERSION = A; - INFOPLIST_FILE = "Target Support Files/Pods-Tests/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MACOSX_DEPLOYMENT_TARGET = 10.9; - MODULEMAP_FILE = "Target Support Files/Pods-Tests/Pods-Tests.modulemap"; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SDKROOT = macosx; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 4.2; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Release; }; - 725E2E6A446C81EE7E552F7158CA59DE /* Debug */ = { + 3FE275CB03AB3DFA1DD281C61EFA1E96 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 97032A4D25D296E9882698752EBF3D0B /* PathKit.xcconfig */; + baseConfigurationReference = 25D7CEBCA776864EAD15F55C95A07CF5 /* StencilSwiftKit.xcconfig */; buildSettings = { CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; @@ -858,28 +823,29 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; - GCC_PREFIX_HEADER = "Target Support Files/PathKit/PathKit-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/PathKit/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/StencilSwiftKit/StencilSwiftKit-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/StencilSwiftKit/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.9; - MODULEMAP_FILE = "Target Support Files/PathKit/PathKit.modulemap"; - PRODUCT_MODULE_NAME = PathKit; - PRODUCT_NAME = PathKit; + MODULEMAP_FILE = "Target Support Files/StencilSwiftKit/StencilSwiftKit.modulemap"; + PRODUCT_MODULE_NAME = StencilSwiftKit; + PRODUCT_NAME = StencilSwiftKit; SDKROOT = macosx; SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Debug; }; - 959CCFE69645B175BB6D418053F0A601 /* Debug */ = { + 65F9F1FC29F7B97C409FC2BF9EABC901 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 25D7CEBCA776864EAD15F55C95A07CF5 /* StencilSwiftKit.xcconfig */; + baseConfigurationReference = 77549DFEB1FD0EB82601E5D4D2ED43E8 /* Pods-Tests.release.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; @@ -891,25 +857,26 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; - GCC_PREFIX_HEADER = "Target Support Files/StencilSwiftKit/StencilSwiftKit-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/StencilSwiftKit/Info.plist"; + INFOPLIST_FILE = "Target Support Files/Pods-Tests/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; MACOSX_DEPLOYMENT_TARGET = 10.9; - MODULEMAP_FILE = "Target Support Files/StencilSwiftKit/StencilSwiftKit.modulemap"; - PRODUCT_MODULE_NAME = StencilSwiftKit; - PRODUCT_NAME = StencilSwiftKit; + MODULEMAP_FILE = "Target Support Files/Pods-Tests/Pods-Tests.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SDKROOT = macosx; SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Debug; + name = Release; }; - 9B655A2210B0C51B5EC57A8811A0626E /* Release */ = { + A164E2CCBC5E6DE56BE37E9224335950 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 97032A4D25D296E9882698752EBF3D0B /* PathKit.xcconfig */; buildSettings = { @@ -936,7 +903,7 @@ SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -1065,7 +1032,7 @@ }; name = Debug; }; - EEA178100DDF1F4E92AFF22C4A947F55 /* Debug */ = { + E196D46B0D1C7F940E55CA0BE5D0D888 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = DB31CD7205910D0B0EC5BCAD82B29254 /* Stencil.xcconfig */; buildSettings = { @@ -1092,12 +1059,45 @@ SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.2; + SWIFT_VERSION = 4.2; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Debug; }; + FE955BD8F480C923AD10E37939B4D128 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = DB31CD7205910D0B0EC5BCAD82B29254 /* Stencil.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_VERSION = A; + GCC_PREFIX_HEADER = "Target Support Files/Stencil/Stencil-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Stencil/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.9; + MODULEMAP_FILE = "Target Support Files/Stencil/Stencil.modulemap"; + PRODUCT_MODULE_NAME = Stencil; + PRODUCT_NAME = Stencil; + SDKROOT = macosx; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 4.2; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -1122,8 +1122,8 @@ 37E55177A2FA28ED8A474D3D6C03B965 /* Build configuration list for PBXNativeTarget "Stencil" */ = { isa = XCConfigurationList; buildConfigurations = ( - EEA178100DDF1F4E92AFF22C4A947F55 /* Debug */, - 3FD3892DC5B0915E845ECB1F06A2C19D /* Release */, + E196D46B0D1C7F940E55CA0BE5D0D888 /* Debug */, + FE955BD8F480C923AD10E37939B4D128 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1131,8 +1131,8 @@ A909730DFB417A5749F3D0C05988225D /* Build configuration list for PBXNativeTarget "PathKit" */ = { isa = XCConfigurationList; buildConfigurations = ( - 725E2E6A446C81EE7E552F7158CA59DE /* Debug */, - 9B655A2210B0C51B5EC57A8811A0626E /* Release */, + 112C75C3E965FEFAC7CDBC58E1B1A39E /* Debug */, + A164E2CCBC5E6DE56BE37E9224335950 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1140,8 +1140,8 @@ ACE3A5C9887D8434C5910C9E123763C4 /* Build configuration list for PBXNativeTarget "StencilSwiftKit" */ = { isa = XCConfigurationList; buildConfigurations = ( - 959CCFE69645B175BB6D418053F0A601 /* Debug */, - 0687C04683C74577B8BFEBC9529E8C8E /* Release */, + 3FE275CB03AB3DFA1DD281C61EFA1E96 /* Debug */, + 300CF79C4D2FA7E248CDCBE4E9E2F534 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/Pods/Stencil/LICENSE b/Pods/Stencil/LICENSE index a8c6d137..8aa82868 100644 --- a/Pods/Stencil/LICENSE +++ b/Pods/Stencil/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2014, Kyle Fuller +Copyright (c) 2018, Kyle Fuller All rights reserved. Redistribution and use in source and binary forms, with or without @@ -21,4 +21,3 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/Pods/Stencil/Sources/Errors.swift b/Pods/Stencil/Sources/Errors.swift index 407a9e25..a6191f9f 100644 --- a/Pods/Stencil/Sources/Errors.swift +++ b/Pods/Stencil/Sources/Errors.swift @@ -37,11 +37,6 @@ public struct TemplateSyntaxError : Error, Equatable, CustomStringConvertible { public init(_ description: String) { self.init(reason: description) } - - public static func ==(lhs:TemplateSyntaxError, rhs:TemplateSyntaxError) -> Bool { - return lhs.description == rhs.description && lhs.token == rhs.token && lhs.stackTrace == rhs.stackTrace - } - } extension Error { @@ -66,12 +61,17 @@ open class SimpleErrorReporter: ErrorReporter { func describe(token: Token) -> String { let templateName = token.sourceMap.filename ?? "" - let line = token.sourceMap.line - let highlight = "\(String(Array(repeating: " ", count: line.offset)))^\(String(Array(repeating: "~", count: max(token.contents.characters.count - 1, 0))))" - - return "\(templateName)\(line.number):\(line.offset): error: \(templateError.reason)\n" - + "\(line.content)\n" - + "\(highlight)\n" + let location = token.sourceMap.location + let highlight = """ + \(String(Array(repeating: " ", count: location.lineOffset)))\ + ^\(String(Array(repeating: "~", count: max(token.contents.count - 1, 0)))) + """ + + return """ + \(templateName)\(location.lineNumber):\(location.lineOffset): error: \(templateError.reason) + \(location.content) + \(highlight) + """ } var descriptions = templateError.stackTrace.reduce([]) { $0 + [describe(token: $1)] } diff --git a/Pods/Stencil/Sources/Extension.swift b/Pods/Stencil/Sources/Extension.swift index 1203378a..d2ee907f 100644 --- a/Pods/Stencil/Sources/Extension.swift +++ b/Pods/Stencil/Sources/Extension.swift @@ -18,6 +18,15 @@ open class Extension { return SimpleNode(token: token, handler: handler) }) } + + /// Registers boolean filter with it's negative counterpart + public func registerFilter(name: String, negativeFilterName: String, filter: @escaping (Any?) throws -> Bool?) { + filters[name] = .simple(filter) + filters[negativeFilterName] = .simple { + guard let result = try filter($0) else { return nil } + return !result + } + } /// Registers a template filter with the given name public func registerFilter(_ name: String, filter: @escaping (Any?) throws -> Any?) { diff --git a/Pods/Stencil/Sources/Filters.swift b/Pods/Stencil/Sources/Filters.swift index fece6ebd..9832123a 100644 --- a/Pods/Stencil/Sources/Filters.swift +++ b/Pods/Stencil/Sources/Filters.swift @@ -74,7 +74,9 @@ func indentFilter(value: Any?, arguments: [Any?]) throws -> Any? { var indentWidth = 4 if arguments.count > 0 { guard let value = arguments[0] as? Int else { - throw TemplateSyntaxError("'indent' filter width argument must be an Integer (\(String(describing: arguments[0])))") + throw TemplateSyntaxError(""" + 'indent' filter width argument must be an Integer (\(String(describing: arguments[0]))) + """) } indentWidth = value } @@ -82,7 +84,9 @@ func indentFilter(value: Any?, arguments: [Any?]) throws -> Any? { var indentationChar = " " if arguments.count > 1 { guard let value = arguments[1] as? String else { - throw TemplateSyntaxError("'indent' filter indentation argument must be a String (\(String(describing: arguments[1]))") + throw TemplateSyntaxError(""" + 'indent' filter indentation argument must be a String (\(String(describing: arguments[1])) + """) } indentationChar = value } diff --git a/Pods/Stencil/Sources/ForTag.swift b/Pods/Stencil/Sources/ForTag.swift index 284498f0..0bc8775c 100644 --- a/Pods/Stencil/Sources/ForTag.swift +++ b/Pods/Stencil/Sources/ForTag.swift @@ -23,7 +23,7 @@ class ForNode : NodeType { throw TemplateSyntaxError("'for' statements should use the syntax: `for in [where ]`.") } - let loopVariables = components[1].characters + let loopVariables = components[1] .split(separator: ",") .map(String.init) .map { $0.trim(character: " ") } @@ -93,7 +93,7 @@ class ForNode : NodeType { var values: [Any] if let dictionary = resolved as? [String: Any], !dictionary.isEmpty { - values = dictionary.map { ($0.key, $0.value) } + values = dictionary.sorted { $0.key < $1.key } } else if let array = resolved as? [Any] { values = array } else if let range = resolved as? CountableClosedRange { diff --git a/Pods/Stencil/Sources/IfTag.swift b/Pods/Stencil/Sources/IfTag.swift index e0148121..73760544 100644 --- a/Pods/Stencil/Sources/IfTag.swift +++ b/Pods/Stencil/Sources/IfTag.swift @@ -38,10 +38,11 @@ func findOperator(name: String) -> Operator? { } -enum IfToken { - case infix(name: String, bindingPower: Int, op: InfixOperator.Type) - case prefix(name: String, bindingPower: Int, op: PrefixOperator.Type) +indirect enum IfToken { + case infix(name: String, bindingPower: Int, operatorType: InfixOperator.Type) + case prefix(name: String, bindingPower: Int, operatorType: PrefixOperator.Type) case variable(Resolvable) + case subExpression(Expression) case end var bindingPower: Int { @@ -52,6 +53,8 @@ enum IfToken { return bindingPower case .variable(_): return 0 + case .subExpression(_): + return 0 case .end: return 0 } @@ -66,6 +69,8 @@ enum IfToken { return op.init(expression: expression) case .variable(let variable): return VariableExpression(variable: variable) + case .subExpression(let expression): + return expression case .end: throw TemplateSyntaxError("'if' expression error: end") } @@ -80,6 +85,8 @@ enum IfToken { throw TemplateSyntaxError("'if' expression error: prefix operator '\(name)' was called with a left hand side") case .variable(let variable): throw TemplateSyntaxError("'if' expression error: variable '\(variable)' was called with a left hand side") + case .subExpression(_): + throw TemplateSyntaxError("'if' expression error: sub expression was called with a left hand side") case .end: throw TemplateSyntaxError("'if' expression error: end") } @@ -100,21 +107,71 @@ final class IfExpressionParser { let tokens: [IfToken] var position: Int = 0 - init(components: [String], tokenParser: TokenParser, token: Token) throws { - self.tokens = try components.map { component in - if let op = findOperator(name: component) { - switch op { - case .infix(let name, let bindingPower, let cls): - return .infix(name: name, bindingPower: bindingPower, op: cls) - case .prefix(let name, let bindingPower, let cls): - return .prefix(name: name, bindingPower: bindingPower, op: cls) + private init(tokens: [IfToken]) { + self.tokens = tokens + } + + static func parser(components: [String], tokenParser: TokenParser, token: Token) throws -> IfExpressionParser { + return try IfExpressionParser(components: ArraySlice(components), tokenParser: tokenParser, token: token) + } + + private init(components: ArraySlice, tokenParser: TokenParser, token: Token) throws { + var parsedComponents = Set() + var bracketsBalance = 0 + self.tokens = try zip(components.indices, components).compactMap { (index, component) in + guard !parsedComponents.contains(index) else { return nil } + + if component == "(" { + bracketsBalance += 1 + let (expression, parsedCount) = try IfExpressionParser.subExpression( + from: components.suffix(from: index + 1), + tokenParser: tokenParser, + token: token + ) + parsedComponents.formUnion(Set(index...(index + parsedCount))) + return .subExpression(expression) + } else if component == ")" { + bracketsBalance -= 1 + if bracketsBalance < 0 { + throw TemplateSyntaxError("'if' expression error: missing opening bracket") } + parsedComponents.insert(index) + return nil + } else { + parsedComponents.insert(index) + if let op = findOperator(name: component) { + switch op { + case .infix(let name, let bindingPower, let operatorType): + return .infix(name: name, bindingPower: bindingPower, operatorType: operatorType) + case .prefix(let name, let bindingPower, let operatorType): + return .prefix(name: name, bindingPower: bindingPower, operatorType: operatorType) + } + } + return .variable(try tokenParser.compileResolvable(component, containedIn: token)) } - - return .variable(try tokenParser.compileResolvable(component, containedIn: token)) } } + private static func subExpression(from components: ArraySlice, tokenParser: TokenParser, token: Token) throws -> (Expression, Int) { + var bracketsBalance = 1 + let subComponents = components + .prefix(while: { + if $0 == "(" { + bracketsBalance += 1 + } else if $0 == ")" { + bracketsBalance -= 1 + } + return bracketsBalance != 0 + }) + if bracketsBalance > 0 { + throw TemplateSyntaxError("'if' expression error: missing closing bracket") + } + + let expressionParser = try IfExpressionParser(components: subComponents, tokenParser: tokenParser, token: token) + let expression = try expressionParser.parse() + return (expression, subComponents.count) + } + var currentToken: IfToken { if tokens.count > position { return tokens[position] @@ -154,13 +211,11 @@ final class IfExpressionParser { } } - func parseExpression(components: [String], tokenParser: TokenParser, token: Token) throws -> Expression { - let parser = try IfExpressionParser(components: components, tokenParser: tokenParser, token: token) + let parser = try IfExpressionParser.parser(components: components, tokenParser: tokenParser, token: token) return try parser.parse() } - /// Represents an if condition and the associated nodes when the condition /// evaluates final class IfCondition { diff --git a/Pods/Stencil/Sources/Include.swift b/Pods/Stencil/Sources/Include.swift index 6dd331cc..d6287ccc 100644 --- a/Pods/Stencil/Sources/Include.swift +++ b/Pods/Stencil/Sources/Include.swift @@ -10,7 +10,11 @@ class IncludeNode : NodeType { let bits = token.components() guard bits.count == 2 || bits.count == 3 else { - throw TemplateSyntaxError("'include' tag requires one argument, the template file to be included. A second optional argument can be used to specify the context that will be passed to the included file") + throw TemplateSyntaxError(""" + 'include' tag requires one argument, the template file to be included. \ + A second optional argument can be used to specify the context that will \ + be passed to the included file + """) } return IncludeNode(templateName: Variable(bits[1]), includeContext: bits.count == 3 ? bits[2] : nil, token: token) diff --git a/Pods/Stencil/Sources/Inheritence.swift b/Pods/Stencil/Sources/Inheritence.swift index db2d67fb..c276d10b 100644 --- a/Pods/Stencil/Sources/Inheritence.swift +++ b/Pods/Stencil/Sources/Inheritence.swift @@ -64,7 +64,7 @@ class ExtendsNode : NodeType { throw TemplateSyntaxError("'extends' cannot appear more than once in the same template") } - let blockNodes = parsedNodes.flatMap { $0 as? BlockNode } + let blockNodes = parsedNodes.compactMap { $0 as? BlockNode } let nodes = blockNodes.reduce([String: BlockNode]()) { (accumulator, node) -> [String: BlockNode] in var dict = accumulator @@ -159,8 +159,8 @@ class BlockNode : NodeType { } // child node is a block node from child template that extends this node (has the same name) - func childContext(_ child: BlockNode, blockContext: BlockContext, context: Context) throws -> [String: Any?] { - var childContext: [String: Any?] = [BlockContext.contextKey: blockContext] + func childContext(_ child: BlockNode, blockContext: BlockContext, context: Context) throws -> [String: Any] { + var childContext: [String: Any] = [BlockContext.contextKey: blockContext] if let blockSuperNode = child.nodes.first(where: { if case .variable(let variable, _)? = $0.token, variable == "block.super" { return true } diff --git a/Pods/Stencil/Sources/KeyPath.swift b/Pods/Stencil/Sources/KeyPath.swift index 445ef291..7728dcf7 100644 --- a/Pods/Stencil/Sources/KeyPath.swift +++ b/Pods/Stencil/Sources/KeyPath.swift @@ -24,7 +24,7 @@ final class KeyPath { subscriptLevel = 0 } - for c in variable.characters { + for c in variable { switch c { case "." where subscriptLevel == 0: try foundSeparator() diff --git a/Pods/Stencil/Sources/Lexer.swift b/Pods/Stencil/Sources/Lexer.swift index ec833d5c..015b7d77 100644 --- a/Pods/Stencil/Sources/Lexer.swift +++ b/Pods/Stencil/Sources/Lexer.swift @@ -1,20 +1,47 @@ import Foundation +typealias Line = (content: String, number: UInt, range: Range) + struct Lexer { let templateName: String? let templateString: String + let lines: [Line] + + /// The potential token start characters. In a template these appear after a + /// `{` character, for example `{{`, `{%`, `{#`, ... + private static let tokenChars: [Unicode.Scalar] = ["{", "%", "#"] + + /// The token end characters, corresponding to their token start characters. + /// For example, a variable token starts with `{{` and ends with `}}` + private static let tokenCharMap: [Unicode.Scalar: Unicode.Scalar] = [ + "{": "}", + "%": "%", + "#": "#" + ] init(templateName: String? = nil, templateString: String) { self.templateName = templateName self.templateString = templateString + + self.lines = templateString.components(separatedBy: .newlines).enumerated().compactMap { + guard !$0.element.isEmpty else { return nil } + return (content: $0.element, number: UInt($0.offset + 1), templateString.range(of: $0.element)!) + } } + /// Create a token that will be passed on to the parser, with the given + /// content and a range. The content will be tested to see if it's a + /// `variable`, a `block` or a `comment`, otherwise it'll default to a simple + /// `text` token. + /// + /// - Parameters: + /// - string: The content string of the token + /// - range: The range within the template content, used for smart + /// error reporting func createToken(string: String, at range: Range) -> Token { func strip() -> String { - guard string.characters.count > 4 else { return "" } - let start = string.index(string.startIndex, offsetBy: 2) - let end = string.index(string.endIndex, offsetBy: -2) - let trimmed = String(string[start.. 4 else { return "" } + let trimmed = String(string.dropFirst(2).dropLast(2)) .components(separatedBy: "\n") .filter({ !$0.isEmpty }) .map({ $0.trim(character: " ") }) @@ -25,8 +52,8 @@ struct Lexer { if string.hasPrefix("{{") || string.hasPrefix("{%") || string.hasPrefix("{#") { let value = strip() let range = templateString.range(of: value, range: range) ?? range - let line = templateString.rangeLine(range) - let sourceMap = SourceMap(filename: templateName, line: line) + let location = rangeLocation(range) + let sourceMap = SourceMap(filename: templateName, location: location) if string.hasPrefix("{{") { return .variable(value: value, at: sourceMap) @@ -37,31 +64,27 @@ struct Lexer { } } - let line = templateString.rangeLine(range) - let sourceMap = SourceMap(filename: templateName, line: line) + let location = rangeLocation(range) + let sourceMap = SourceMap(filename: templateName, location: location) return .text(value: string, at: sourceMap) } - /// Returns an array of tokens from a given template string. + /// Transforms the template into a list of tokens, that will eventually be + /// passed on to the parser. + /// + /// - Returns: The list of tokens (see `createToken(string: at:)`). func tokenize() -> [Token] { var tokens: [Token] = [] let scanner = Scanner(templateString) - - let map = [ - "{{": "}}", - "{%": "%}", - "{#": "#}", - ] - while !scanner.isEmpty { - if let text = scanner.scan(until: ["{{", "{%", "{#"]) { - if !text.1.isEmpty { - tokens.append(createToken(string: text.1, at: scanner.range)) + if let (char, text) = scanner.scanForTokenStart(Lexer.tokenChars) { + if !text.isEmpty { + tokens.append(createToken(string: text, at: scanner.range)) } - let end = map[text.0]! - let result = scanner.scan(until: end, returnUntil: true) + guard let end = Lexer.tokenCharMap[char] else { continue } + let result = scanner.scanForTokenEnd(end) tokens.append(createToken(string: result, at: scanner.range)) } else { tokens.append(createToken(string: scanner.content, at: scanner.range)) @@ -72,6 +95,19 @@ struct Lexer { return tokens } + /// Finds the line matching the given range (for a token) + /// + /// - Parameter range: The range to search for. + /// - Returns: The content for that line, the line number and offset within + /// the line. + func rangeLocation(_ range: Range) -> ContentLocation { + guard let line = self.lines.first(where: { $0.range.contains(range.lowerBound) }) else { + return ("", 0, 0) + } + let offset = templateString.distance(from: line.range.lowerBound, to: range.lowerBound) + return (line.content, line.number, offset) + } + } class Scanner { @@ -79,6 +115,11 @@ class Scanner { var content: String var range: Range + /// The start delimiter for a token. + private static let tokenStartDelimiter: Unicode.Scalar = "{" + /// And the corresponding end delimiter for a token. + private static let tokenEndDelimiter: Unicode.Scalar = "}" + init(_ content: String) { self.originalContent = content self.content = content @@ -89,64 +130,69 @@ class Scanner { return content.isEmpty } - func scan(until: String, returnUntil: Bool = false) -> String { - var index = content.startIndex - - if until.isEmpty { - return "" - } - - range = range.upperBound.. String { + var foundChar = false + + for (index, char) in content.unicodeScalars.enumerated() { + if foundChar && char == Scanner.tokenEndDelimiter { + let result = String(content.prefix(index)) + content = String(content.dropFirst(index + 1)) + range = range.upperBound.. (String, String)? { - if until.isEmpty { - return nil - } + /// Scans for the start of a token, with a list of potential starting + /// characters. To scan for the start of variables (`{{`), blocks (`{%`) and + /// comments (`{#`), this method receives the characters `{`, `%` and `#`. + /// The scanner will search for a `{`, followed by one of the search + /// characters. It will give the found character, and the content that came + /// before the token. + /// + /// Note: if the start of a token is found, the `content` and `range` + /// properties are updated to reflect this. `content` will be set to what + /// remains of the template starting with the token. `range` will be set to + /// the start of the token within the template. + /// + /// - Parameter tokenChars: List of token start characters to search for. + /// - Returns: The found token start character, together with the content + /// before the token, or nil of no token start was found. + func scanForTokenStart(_ tokenChars: [Unicode.Scalar]) -> (Unicode.Scalar, String)? { + var foundBrace = false - var index = content.startIndex range = range.upperBound.. String.Index? { var index = startIndex @@ -179,23 +225,6 @@ extension String { let last = findLastNot(character: character) ?? endIndex return String(self[first..) -> RangeLine { - var lineNumber: UInt = 0 - var offset: Int = 0 - var lineContent = "" - - for line in components(separatedBy: CharacterSet.newlines) { - lineNumber += 1 - lineContent = line - if let rangeOfLine = self.range(of: line), rangeOfLine.contains(range.lowerBound) { - offset = distance(from: rangeOfLine.lowerBound, to: range.lowerBound) - break - } - } - - return (lineContent, lineNumber, offset) - } } -public typealias RangeLine = (content: String, number: UInt, offset: Int) +public typealias ContentLocation = (content: String, lineNumber: UInt, lineOffset: Int) diff --git a/Pods/Stencil/Sources/Node.swift b/Pods/Stencil/Sources/Node.swift index c4bb77ac..dc7a72c9 100644 --- a/Pods/Stencil/Sources/Node.swift +++ b/Pods/Stencil/Sources/Node.swift @@ -58,18 +58,64 @@ public protocol Resolvable { public class VariableNode : NodeType { public let variable: Resolvable public var token: Token? + let condition: Expression? + let elseExpression: Resolvable? + + class func parse(_ parser:TokenParser, token:Token) throws -> NodeType { + var components = token.components() + + func hasToken(_ token: String, at index: Int) -> Bool { + return components.count > (index + 1) && components[index] == token + } + + let condition: Expression? + let elseExpression: Resolvable? + + if hasToken("if", at: 1) { + let components = components.suffix(from: 2) + if let elseIndex = components.index(of: "else") { + condition = try parseExpression(components: Array(components.prefix(upTo: elseIndex)), tokenParser: parser, token: token) + let elseToken = components.suffix(from: elseIndex.advanced(by: 1)).joined(separator: " ") + elseExpression = try parser.compileResolvable(elseToken, containedIn: token) + } else { + condition = try parseExpression(components: Array(components), tokenParser: parser, token: token) + elseExpression = nil + } + } else { + condition = nil + elseExpression = nil + } + + let filter = try parser.compileResolvable(components[0], containedIn: token) + return VariableNode(variable: filter, token: token, condition: condition, elseExpression: elseExpression) + } public init(variable: Resolvable, token: Token? = nil) { self.variable = variable self.token = token + self.condition = nil + self.elseExpression = nil + } + + init(variable: Resolvable, token: Token? = nil, condition: Expression?, elseExpression: Resolvable?) { + self.variable = variable + self.token = token + self.condition = condition + self.elseExpression = elseExpression } public init(variable: String, token: Token? = nil) { self.variable = Variable(variable) self.token = token + self.condition = nil + self.elseExpression = nil } public func render(_ context: Context) throws -> String { + if let condition = self.condition, try condition.evaluate(context: context) == false { + return try elseExpression?.resolve(context).map(stringify) ?? "" + } + let result = try variable.resolve(context) return stringify(result) } diff --git a/Pods/Stencil/Sources/Parser.swift b/Pods/Stencil/Sources/Parser.swift index 81d93355..1f5d50d7 100644 --- a/Pods/Stencil/Sources/Parser.swift +++ b/Pods/Stencil/Sources/Parser.swift @@ -40,8 +40,7 @@ public class TokenParser { case .text(let text, _): nodes.append(TextNode(text: text)) case .variable: - let filter = try compileResolvable(token.contents, containedIn: token) - nodes.append(VariableNode(variable: filter, token: token)) + try nodes.append(VariableNode.parse(self, token: token)) case .block: if let parse_until = parse_until , parse_until(self, token) { prependToken(token) @@ -98,7 +97,10 @@ public class TokenParser { if suggestedFilters.isEmpty { throw TemplateSyntaxError("Unknown filter '\(name)'.") } else { - throw TemplateSyntaxError("Unknown filter '\(name)'. Found similar filters: \(suggestedFilters.map({ "'\($0)'" }).joined(separator: ", ")).") + throw TemplateSyntaxError(""" + Unknown filter '\(name)'. \ + Found similar filters: \(suggestedFilters.map({ "'\($0)'" }).joined(separator: ", ")). + """) } } @@ -108,7 +110,7 @@ public class TokenParser { let filtersWithDistance = allFilters .map({ (filterName: $0, distance: $0.levenshteinDistance(name)) }) // do not suggest filters which names are shorter than the distance - .filter({ $0.filterName.characters.count > $0.distance }) + .filter({ $0.filterName.count > $0.distance }) guard let minDistance = filtersWithDistance.min(by: { $0.distance < $1.distance })?.distance else { return [] } @@ -125,9 +127,9 @@ public class TokenParser { } // find offset of filter in the containing token so that only filter is highligted, not the whole token if let filterTokenRange = containingToken.contents.range(of: filterToken) { - var rangeLine = containingToken.sourceMap.line - rangeLine.offset += containingToken.contents.distance(from: containingToken.contents.startIndex, to: filterTokenRange.lowerBound) - syntaxError.token = .variable(value: filterToken, at: SourceMap(filename: containingToken.sourceMap.filename, line: rangeLine)) + var location = containingToken.sourceMap.location + location.lineOffset += containingToken.contents.distance(from: containingToken.contents.startIndex, to: filterTokenRange.lowerBound) + syntaxError.token = .variable(value: filterToken, at: SourceMap(filename: containingToken.sourceMap.filename, location: location)) } else { syntaxError.token = containingToken } @@ -167,10 +169,10 @@ extension String { // initialize v0 (the previous row of distances) // this row is A[0][i]: edit distance for an empty s // the distance is just the number of characters to delete from t - last = [Int](0...target.characters.count) - current = [Int](repeating: 0, count: target.characters.count + 1) + last = [Int](0...target.count) + current = [Int](repeating: 0, count: target.count + 1) - for i in 0.. 0 { - if let precedingChar = components.last?.characters.last, specialCharacters.characters.contains(precedingChar) { + if let precedingChar = components.last?.last, specialCharacters.contains(precedingChar) { components[components.count-1] += word } else if specialCharacters.contains(word) { components[components.count-1] += word @@ -25,7 +25,7 @@ extension String { } } - for character in self.characters { + for character in self { if character == "'" { singleQuoteCount += 1 } else if character == "\"" { doubleQuoteCount += 1 } @@ -57,17 +57,17 @@ extension String { public struct SourceMap: Equatable { public let filename: String? - public let line: RangeLine + public let location: ContentLocation - init(filename: String? = nil, line: RangeLine = ("", 0, 0)) { + init(filename: String? = nil, location: ContentLocation = ("", 0, 0)) { self.filename = filename - self.line = line + self.location = location } static let unknown = SourceMap() public static func ==(lhs: SourceMap, rhs: SourceMap) -> Bool { - return lhs.filename == rhs.filename && lhs.line == rhs.line + return lhs.filename == rhs.filename && lhs.location == rhs.location } } @@ -114,21 +114,4 @@ public enum Token : Equatable { return sourceMap } } - -} - - -public func == (lhs: Token, rhs: Token) -> Bool { - switch (lhs, rhs) { - case let (.text(lhsValue, lhsAt), .text(rhsValue, rhsAt)): - return lhsValue == rhsValue && lhsAt == rhsAt - case let (.variable(lhsValue, lhsAt), .variable(rhsValue, rhsAt)): - return lhsValue == rhsValue && lhsAt == rhsAt - case let (.block(lhsValue, lhsAt), .block(rhsValue, rhsAt)): - return lhsValue == rhsValue && lhsAt == rhsAt - case let (.comment(lhsValue, lhsAt), .comment(rhsValue, rhsAt)): - return lhsValue == rhsValue && lhsAt == rhsAt - default: - return false - } } diff --git a/Pods/Stencil/Sources/Variable.swift b/Pods/Stencil/Sources/Variable.swift index 1da74390..eb30060a 100644 --- a/Pods/Stencil/Sources/Variable.swift +++ b/Pods/Stencil/Sources/Variable.swift @@ -9,7 +9,7 @@ class FilterExpression : Resolvable { let variable: Variable init(token: String, parser: TokenParser) throws { - let bits = token.characters.split(separator: "|").map({ String($0).trim(character: " ") }) + let bits = token.split(separator: "|").map({ String($0).trim(character: " ") }) if bits.isEmpty { throw TemplateSyntaxError("Variable tags must include at least 1 argument") } @@ -60,7 +60,7 @@ public struct Variable : Equatable, Resolvable { if (variable.hasPrefix("'") && variable.hasSuffix("'")) || (variable.hasPrefix("\"") && variable.hasSuffix("\"")) { // String literal - return String(variable[variable.characters.index(after: variable.startIndex) ..< variable.characters.index(before: variable.endIndex)]) + return String(variable[variable.index(after: variable.startIndex) ..< variable.index(before: variable.endIndex)]) } // Number literal @@ -87,24 +87,16 @@ public struct Variable : Equatable, Resolvable { current = dictionary[bit] } } else if let array = current as? [Any] { - if let index = Int(bit) { - if index >= 0 && index < array.count { - current = array[index] - } else { - current = nil - } - } else if bit == "first" { - current = array.first - } else if bit == "last" { - current = array.last - } else if bit == "count" { - current = array.count - } + current = resolveCollection(array, bit: bit) + } else if let string = current as? String { + current = resolveCollection(string, bit: bit) } else if let object = current as? NSObject { // NSKeyValueCoding #if os(Linux) return nil #else - current = object.value(forKey: bit) + if object.responds(to: Selector(bit)) { + current = object.value(forKey: bit) + } #endif } else if let value = current { current = Mirror(reflecting: value).getValue(for: bit) @@ -126,8 +118,22 @@ public struct Variable : Equatable, Resolvable { } } -public func ==(lhs: Variable, rhs: Variable) -> Bool { - return lhs.variable == rhs.variable +private func resolveCollection(_ collection: T, bit: String) -> Any? { + if let index = Int(bit) { + if index >= 0 && index < collection.count { + return collection[collection.index(collection.startIndex, offsetBy: index)] + } else { + return nil + } + } else if bit == "first" { + return collection.first + } else if bit == "last" { + return collection[collection.index(collection.endIndex, offsetBy: -1)] + } else if bit == "count" { + return collection.count + } else { + return nil + } } /// A structure used to represet range of two integer values expressed as `from...to`. diff --git a/Pods/Target Support Files/PathKit/Info.plist b/Pods/Target Support Files/PathKit/Info.plist index 5d80a394..68ac6e26 100644 --- a/Pods/Target Support Files/PathKit/Info.plist +++ b/Pods/Target Support Files/PathKit/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.9.1 + 0.9.2 CFBundleSignature ???? CFBundleVersion diff --git a/Pods/Target Support Files/Pods-Tests/Pods-Tests-acknowledgements.markdown b/Pods/Target Support Files/Pods-Tests/Pods-Tests-acknowledgements.markdown index 666399cf..cc6b92e9 100644 --- a/Pods/Target Support Files/Pods-Tests/Pods-Tests-acknowledgements.markdown +++ b/Pods/Target Support Files/Pods-Tests/Pods-Tests-acknowledgements.markdown @@ -30,7 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## Stencil -Copyright (c) 2014, Kyle Fuller +Copyright (c) 2018, Kyle Fuller All rights reserved. Redistribution and use in source and binary forms, with or without @@ -55,7 +55,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ## StencilSwiftKit MIT License diff --git a/Pods/Target Support Files/Pods-Tests/Pods-Tests-acknowledgements.plist b/Pods/Target Support Files/Pods-Tests/Pods-Tests-acknowledgements.plist index 216acb1f..8d9f5074 100644 --- a/Pods/Target Support Files/Pods-Tests/Pods-Tests-acknowledgements.plist +++ b/Pods/Target Support Files/Pods-Tests/Pods-Tests-acknowledgements.plist @@ -47,7 +47,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. FooterText - Copyright (c) 2014, Kyle Fuller + Copyright (c) 2018, Kyle Fuller All rights reserved. Redistribution and use in source and binary forms, with or without @@ -70,7 +70,6 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - License BSD diff --git a/Pods/Target Support Files/Stencil/Info.plist b/Pods/Target Support Files/Stencil/Info.plist index 4a543b71..3e3c2e3d 100644 --- a/Pods/Target Support Files/Stencil/Info.plist +++ b/Pods/Target Support Files/Stencil/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.12.1 + 0.13.0 CFBundleSignature ???? CFBundleVersion diff --git a/StencilSwiftKit.podspec b/StencilSwiftKit.podspec index b0e66870..5aabe166 100644 --- a/StencilSwiftKit.podspec +++ b/StencilSwiftKit.podspec @@ -16,12 +16,12 @@ Pod::Spec.new do |s| s.social_media_url = 'https://twitter.com/aligatr' s.platform = :osx, '10.9' - s.swift_version = '4.0' + s.swift_version = '4.2' s.cocoapods_version = '>= 1.4.0' s.source = { git: 'https://github.com/SwiftGen/StencilSwiftKit.git', tag: s.version.to_s } s.source_files = 'Sources/**/*.swift' - s.dependency 'Stencil', '~> 0.12.1' + s.dependency 'Stencil', '~> 0.13.0' s.framework = 'Foundation' end From b9b0736e2a43e4dfdc2805aedfe77036ff0b891e Mon Sep 17 00:00:00 2001 From: David Jennes Date: Wed, 26 Sep 2018 01:21:21 +0200 Subject: [PATCH 2/6] Update SPM --- Package.resolved | 12 ++++++------ Package.swift | 2 +- Package@swift-4.2.swift | 27 +++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 Package@swift-4.2.swift diff --git a/Package.resolved b/Package.resolved index 9b9d608f..629810fc 100644 --- a/Package.resolved +++ b/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/kylef/PathKit.git", "state": { "branch": null, - "revision": "fa81fa9e3a9f59645159c4ea45c0c46ee6558f71", - "version": "0.9.1" + "revision": "e2f5be30e4c8f531c9c1e8765aa7b71c0a45d7a0", + "version": "0.9.2" } }, { @@ -15,8 +15,8 @@ "repositoryURL": "https://github.com/kylef/Spectre.git", "state": { "branch": null, - "revision": "e34d5687e1e9d865e3527dd58bc2f7464ef6d936", - "version": "0.8.0" + "revision": "f14ff47f45642aa5703900980b014c2e9394b6e5", + "version": "0.9.0" } }, { @@ -24,8 +24,8 @@ "repositoryURL": "https://github.com/stencilproject/Stencil.git", "state": { "branch": null, - "revision": "b476e50f89577f5848e8013dbf0a850abac892aa", - "version": "0.12.1" + "revision": "c7dbba41a5cf7ab5a5bdfb5f7855170d05c5f031", + "version": "0.13.0" } } ] diff --git a/Package.swift b/Package.swift index dc399e81..bcff7c7b 100644 --- a/Package.swift +++ b/Package.swift @@ -7,7 +7,7 @@ let package = Package( .library(name: "StencilSwiftKit", targets: ["StencilSwiftKit"]) ], dependencies: [ - .package(url: "https://github.com/stencilproject/Stencil.git", .upToNextMinor(from: "0.12.1")) + .package(url: "https://github.com/stencilproject/Stencil.git", .upToNextMinor(from: "0.13.0")) ], targets: [ .target( diff --git a/Package@swift-4.2.swift b/Package@swift-4.2.swift new file mode 100644 index 00000000..b36f9f8c --- /dev/null +++ b/Package@swift-4.2.swift @@ -0,0 +1,27 @@ +// swift-tools-version:4.2 +import PackageDescription + +let package = Package( + name: "StencilSwiftKit", + products: [ + .library(name: "StencilSwiftKit", targets: ["StencilSwiftKit"]) + ], + dependencies: [ + .package(url: "https://github.com/stencilproject/Stencil.git", .upToNextMinor(from: "0.13.0")) + ], + targets: [ + .target( + name: "StencilSwiftKit", + dependencies: [ + "Stencil" + ] + ), + .testTarget( + name: "StencilSwiftKitTests", + dependencies: [ + "StencilSwiftKit" + ] + ) + ], + swiftLanguageVersions: [.v4, .v4_2] +) From cbcfd41c52d4a9a0618f9c73f07fd4ece7ec0de5 Mon Sep 17 00:00:00 2001 From: David Jennes Date: Wed, 26 Sep 2018 01:31:29 +0200 Subject: [PATCH 3/6] Set tests swift version to 4.2 --- StencilSwiftKit.xcodeproj/project.pbxproj | 10 +- .../StringFiltersTests.swift | 8 -- Tests/StencilSwiftKitTests/TestsHelper.swift | 95 ------------------- 3 files changed, 3 insertions(+), 110 deletions(-) delete mode 100644 Tests/StencilSwiftKitTests/TestsHelper.swift diff --git a/StencilSwiftKit.xcodeproj/project.pbxproj b/StencilSwiftKit.xcodeproj/project.pbxproj index 5350f448..a2456099 100644 --- a/StencilSwiftKit.xcodeproj/project.pbxproj +++ b/StencilSwiftKit.xcodeproj/project.pbxproj @@ -12,7 +12,6 @@ B5A3F2ED5DA57C06EF62BB82 /* ParseBoolTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5A3FFC01B2145C4BFD8316A /* ParseBoolTests.swift */; }; DD0B6D5F1EDF7C2100C8862C /* ParseEnumTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD0B6D5E1EDF7C2100C8862C /* ParseEnumTests.swift */; }; DD4393FF1E2D3EEB0047A332 /* MapNodeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD4393FE1E2D3EEB0047A332 /* MapNodeTests.swift */; }; - DD5F341B1E21993A00AEB5DA /* TestsHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD5F341A1E21993A00AEB5DA /* TestsHelper.swift */; }; DD5F342E1E21A3A200AEB5DA /* CallNodeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD5F342A1E21A3A200AEB5DA /* CallNodeTests.swift */; }; DD5F342F1E21A3A200AEB5DA /* SetNodeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD5F342B1E21A3A200AEB5DA /* SetNodeTests.swift */; }; DD5F34301E21A3A200AEB5DA /* StringFiltersTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD5F342C1E21A3A200AEB5DA /* StringFiltersTests.swift */; }; @@ -64,7 +63,6 @@ B5A3FFC01B2145C4BFD8316A /* ParseBoolTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ParseBoolTests.swift; sourceTree = ""; }; DD0B6D5E1EDF7C2100C8862C /* ParseEnumTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ParseEnumTests.swift; sourceTree = ""; }; DD4393FE1E2D3EEB0047A332 /* MapNodeTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MapNodeTests.swift; sourceTree = ""; }; - DD5F341A1E21993A00AEB5DA /* TestsHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestsHelper.swift; sourceTree = ""; }; DD5F34201E2199ED00AEB5DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; DD5F342A1E21A3A200AEB5DA /* CallNodeTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CallNodeTests.swift; sourceTree = ""; }; DD5F342B1E21A3A200AEB5DA /* SetNodeTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SetNodeTests.swift; sourceTree = ""; }; @@ -144,7 +142,6 @@ DD5F34291E21A3A200AEB5DA /* StencilSwiftKitTests */ = { isa = PBXGroup; children = ( - DD5F341A1E21993A00AEB5DA /* TestsHelper.swift */, DD5F342A1E21A3A200AEB5DA /* CallNodeTests.swift */, DDE1E2F51E3E33E30043367C /* MacroNodeTests.swift */, DDFD1F681E5358C70023AE2B /* ContextTests.swift */, @@ -199,7 +196,7 @@ TargetAttributes = { 09A87B4F1BCCA2C600D9B9F5 = { CreatedOnToolsVersion = 7.0.1; - LastSwiftMigration = 0920; + LastSwiftMigration = 1000; }; }; }; @@ -299,7 +296,6 @@ DD0B6D5F1EDF7C2100C8862C /* ParseEnumTests.swift in Sources */, DDE1E2F61E3E33E30043367C /* MacroNodeTests.swift in Sources */, DD4393FF1E2D3EEB0047A332 /* MapNodeTests.swift in Sources */, - DD5F341B1E21993A00AEB5DA /* TestsHelper.swift in Sources */, DD5F34301E21A3A200AEB5DA /* StringFiltersTests.swift in Sources */, DDFD1F691E5358C70023AE2B /* ContextTests.swift in Sources */, DD5F342E1E21A3A200AEB5DA /* CallNodeTests.swift in Sources */, @@ -422,7 +418,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_BUNDLE_IDENTIFIER = com.alisoftware.SwiftGenKitTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -436,7 +432,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_BUNDLE_IDENTIFIER = com.alisoftware.SwiftGenKitTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Release; }; diff --git a/Tests/StencilSwiftKitTests/StringFiltersTests.swift b/Tests/StencilSwiftKitTests/StringFiltersTests.swift index 187c25b6..dd087e7a 100644 --- a/Tests/StencilSwiftKitTests/StringFiltersTests.swift +++ b/Tests/StencilSwiftKitTests/StringFiltersTests.swift @@ -24,14 +24,6 @@ final class StringFiltersTests: XCTestCase { var description: String { return stringRepresentation } - - var hashValue: Int { - return stringRepresentation.hashValue - } - - static func == (lhs: Input, rhs: Input) -> Bool { - return lhs.stringRepresentation == rhs.stringRepresentation - } } func testCamelToSnakeCase_WithNoArgsDefaultsToTrue() throws { diff --git a/Tests/StencilSwiftKitTests/TestsHelper.swift b/Tests/StencilSwiftKitTests/TestsHelper.swift deleted file mode 100644 index 615acd4b..00000000 --- a/Tests/StencilSwiftKitTests/TestsHelper.swift +++ /dev/null @@ -1,95 +0,0 @@ -// -// StencilSwiftKit -// Copyright (c) 2017 Olivier Halligon -// MIT Licence -// - -import Foundation -import PathKit -import XCTest - -private let colorCode: (String) -> String = - ProcessInfo.processInfo.environment["XcodeColors"] == "YES" ? { "\u{001b}[\($0);" } : { _ in "" } -private let (msgColor, reset) = (colorCode("fg250,0,0"), colorCode("")) -private let okCode = (num: colorCode("fg127,127,127"), - code: colorCode("")) -private let koCode = (num: colorCode("fg127,127,127") + colorCode("bg127,0,0"), - code: colorCode("fg250,250,250") + colorCode("bg127,0,0")) - -func diff(_ result: String, _ expected: String) -> String? { - guard result != expected else { return nil } - var firstDiff: Int? - let newlines = CharacterSet.newlines - let lhsLines = result.components(separatedBy: newlines) - let rhsLines = expected.components(separatedBy: newlines) - - for (idx, pair) in zip(lhsLines, rhsLines).enumerated() where pair.0 != pair.1 { - firstDiff = idx - break - } - if let badLineIdx = firstDiff { - let slice = { (lines: [String], context: Int) -> ArraySlice in - let start = max(0, badLineIdx - context) - let end = min(badLineIdx + context, lines.count - 1) - return lines[start...end] - } - let addLineNumbers = { (slice: ArraySlice) -> [String] in - slice.enumerated().map { (idx: Int, line: String) in - let num = idx + slice.startIndex - let lineNum = "\(num + 1)".padding(toLength: 3, withPad: " ", startingAt: 0) + "|" - let clr = num == badLineIdx ? koCode : okCode - return "\(clr.num)\(lineNum)\(reset)\(clr.code)\(line)\(reset)" - } - } - let lhsNum = addLineNumbers(slice(lhsLines, 4)).joined(separator: "\n") - let rhsNum = addLineNumbers(slice(rhsLines, 4)).joined(separator: "\n") - return [ - "\(msgColor)Mismatch at line \(badLineIdx)\(reset)", - ">>>>>> result", - "\(lhsNum)", - "======", - "\(rhsNum)", - "<<<<<< expected" - ].joined(separator: "\n") - } - return nil -} - -func XCTDiffStrings(_ result: String, _ expected: String, file: StaticString = #file, line: UInt = #line) { - guard let error = diff(result, expected) else { return } - XCTFail(error, file: file, line: line) -} - -class Fixtures { - private static let resources: Path = { - if let path = Bundle(for: Fixtures.self).resourceURL?.path, - Path(path).exists { - return Path(path) - } else { - return Path(#file).parent() + "Resources" - } - }() - private init() {} - - static func directory(subDirectory subDir: String? = nil) -> Path { - guard let dir = subDir else { return resources } - return resources + dir - } - - static func path(for name: String, subDirectory: String? = nil) -> Path { - if let subDirectory = subDirectory { - return resources + subDirectory + name - } else { - return resources + name - } - } - - static func string(for name: String, encoding: String.Encoding = .utf8) -> String { - let subDir: String? = name.hasSuffix(".stencil") ? "fixtures" : "expected" - do { - return try path(for: name, subDirectory: subDir).read(encoding) - } catch let error { - fatalError("Unable to load fixture content: \(error)") - } - } -} From f70e56b3d9bcf7fe215dd10eef842384b61e9930 Mon Sep 17 00:00:00 2001 From: David Jennes Date: Wed, 26 Sep 2018 01:45:25 +0200 Subject: [PATCH 4/6] Changelog entry --- CHANGELOG.md | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be7d0b49..3a35873a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,23 +14,28 @@ _None_ ### New Features -_None_ +* Updated Stencil to the latest version (0.13). + [David Jennes](https://github.com/djbe) + [#103](https://github.com/SwiftGen/StencilSwiftKit/pull/103) ### Internal Changes * Improved the documentation of string filters a bit for a better overview of the inputs & outputs. [David Jennes](https://github.com/djbe) [#102](https://github.com/AliSoftware/SwiftGen/pull/102) +* Updated to latest Xcode (10.0). + [David Jennes](https://github.com/djbe) + [#103](https://github.com/SwiftGen/StencilSwiftKit/pull/103) ## 2.6.0 ### Bug fixes * Fixed using filter expression in call node. - [Ilya Puchka](https://github.com/ilyapuchka) + [Ilya Puchka](https://github.com/ilyapuchka) [#85](https://github.com/SwiftGen/StencilSwiftKit/pull/85) * Fixed compilation issue with Xcode 10 & Swift 4.2 by adding hints to help the compiler. - [Olivier Halligon](https://github.com/AliSoftware) + [Olivier Halligon](https://github.com/AliSoftware) [#93](https://github.com/SwiftGen/StencilSwiftKit/pull/93) * Migrated to PathKit for url filters. The dirname will return '.' for a filename without base directory. [Rahul Katariya](https://github.com/RahulKatariya) @@ -46,17 +51,17 @@ _None_ [David Jennes](https://github.com/djbe) [#247](https://github.com/AliSoftware/SwiftGen/pull/247) * Updated Stencil to the latest version (0.12.1). - [David Jennes](https://github.com/djbe) + [David Jennes](https://github.com/djbe) [#95](https://github.com/SwiftGen/StencilSwiftKit/pull/95) [#99](https://github.com/SwiftGen/StencilSwiftKit/pull/99) ### Internal Changes * Updated to latest Xcode (9.3.0). - [David Jennes](https://github.com/djbe) + [David Jennes](https://github.com/djbe) [#86](https://github.com/SwiftGen/StencilSwiftKit/pull/86) * Update to SwiftLint 0.27 and enable some extra SwiftLint rules. - [David Jennes](https://github.com/djbe) + [David Jennes](https://github.com/djbe) [#96](https://github.com/SwiftGen/StencilSwiftKit/pull/96) * Test Linux SPM support in CI. [David Jennes](https://github.com/janderit) @@ -67,22 +72,22 @@ _None_ ### New Features * Updated Stencil to the latest version (0.11.0). - [David Jennes](https://github.com/djbe) + [David Jennes](https://github.com/djbe) [#83](https://github.com/SwiftGen/StencilSwiftKit/pull/83) ### Internal Changes * Switched to using SwiftLint via CocoaPods instead of our own install scripts. - [David Jennes](https://github.com/djbe) + [David Jennes](https://github.com/djbe) [#78](https://github.com/SwiftGen/StencilSwiftKit/pull/78) * Enabled some extra SwiftLint rules for better code consistency. - [David Jennes](https://github.com/djbe) + [David Jennes](https://github.com/djbe) [#79](https://github.com/SwiftGen/StencilSwiftKit/pull/79) * Migrated to CircleCI 2.0. - [David Jennes](https://github.com/djbe) + [David Jennes](https://github.com/djbe) [#81](https://github.com/SwiftGen/StencilSwiftKit/pull/81) * Migrated to Swift 4, and dropped support for Swift 3. - [David Jennes](https://github.com/djbe) + [David Jennes](https://github.com/djbe) [#80](https://github.com/SwiftGen/StencilSwiftKit/pull/80) ## 2.4.0 From 965610ad1092a2e05f6d5a7391555472c33cca6e Mon Sep 17 00:00:00 2001 From: David Jennes Date: Wed, 26 Sep 2018 01:52:18 +0200 Subject: [PATCH 5/6] CI: set Xcode version to 10 --- .circleci/config.yml | 6 +++--- Rakefile | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 99d6b1af..1a5ef8e6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ defaults: CIRCLE_TEST_REPORTS: /tmp/circleci-test-results BUNDLE_PATH: vendor/bundle macos: - xcode: "9.3.0" + xcode: "10.0.0" shell: /bin/bash --login -eo pipefail - &linux-config environment: @@ -14,7 +14,7 @@ defaults: CIRCLE_TEST_REPORTS: /tmp/circleci-test-results BUNDLE_PATH: vendor/bundle docker: - - image: norionomura/jazzy:swift-4.1.3 + - image: norionomura/jazzy:swift-4.2.0 shell: /bin/bash --login -eo pipefail - &prepare-storage run: @@ -45,7 +45,7 @@ defaults: store_artifacts: path: /tmp/circleci-artifacts - + version: 2 jobs: lint: diff --git a/Rakefile b/Rakefile index 945d6c7f..8073edaa 100755 --- a/Rakefile +++ b/Rakefile @@ -12,7 +12,7 @@ WORKSPACE = 'StencilSwiftKit'.freeze SCHEME_NAME = 'Tests'.freeze CONFIGURATION = 'Debug'.freeze POD_NAME = 'StencilSwiftKit'.freeze -MIN_XCODE_VERSION = 9.2 +MIN_XCODE_VERSION = 10.0 ## [ Generate SPM files ] ##################################################### From e813b874b5f5750e3b3be854de7a48813b05d2cc Mon Sep 17 00:00:00 2001 From: David Jennes Date: Wed, 26 Sep 2018 01:59:10 +0200 Subject: [PATCH 6/6] Remove old SPM file --- Package.pins | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 Package.pins diff --git a/Package.pins b/Package.pins deleted file mode 100644 index 93ffd761..00000000 --- a/Package.pins +++ /dev/null @@ -1,24 +0,0 @@ -{ - "autoPin": true, - "pins": [ - { - "package": "PathKit", - "reason": null, - "repositoryURL": "https://github.com/kylef/PathKit.git", - "version": "0.8.0" - }, - { - "package": "Spectre", - "reason": null, - "repositoryURL": "https://github.com/kylef/Spectre.git", - "version": "0.7.2" - }, - { - "package": "Stencil", - "reason": null, - "repositoryURL": "https://github.com/kylef/Stencil.git", - "version": "0.11.0" - } - ], - "version": 1 -} \ No newline at end of file