diff --git a/.swiftlint.yml b/.swiftlint.yml index b015bb42..8786342a 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -5,7 +5,9 @@ opt_in_rules: - closure_spacing - contains_over_first_not_nil - discouraged_optional_boolean + - discouraged_optional_collection - empty_count + - empty_string - fatal_error_message - first_where - force_unwrapping diff --git a/CHANGELOG.md b/CHANGELOG.md index d4525c5a..79b87903 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,9 @@ _None_ ### New Features -_None_ +* Updated Stencil to the latest version (0.11.0). + [David Jennes](https://github.com/djbe) + [#83](https://github.com/SwiftGen/StencilSwiftKit/pull/83) ### Internal Changes diff --git a/Gemfile b/Gemfile index 2fe2e201..215f3d79 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source 'https://rubygems.org' -gem 'cocoapods', '~> 1.4' +gem 'cocoapods', '~> 1.5' gem 'octokit', '~> 4.7' gem 'rake', '~> 10.4' gem 'rubocop', '~> 0.51' diff --git a/Gemfile.lock b/Gemfile.lock index 2fa98833..ac8c0d16 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -12,12 +12,12 @@ GEM ast (2.4.0) atomos (0.1.2) claide (1.0.2) - cocoapods (1.4.0) + cocoapods (1.5.0) activesupport (>= 4.0.2, < 5) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.4.0) + cocoapods-core (= 1.5.0) cocoapods-deintegrate (>= 1.0.2, < 2.0) - cocoapods-downloader (>= 1.1.3, < 2.0) + cocoapods-downloader (>= 1.2.0, < 2.0) cocoapods-plugins (>= 1.0.0, < 2.0) cocoapods-search (>= 1.0.0, < 2.0) cocoapods-stats (>= 1.0.0, < 2.0) @@ -27,16 +27,16 @@ GEM escape (~> 0.0.4) fourflusher (~> 2.0.1) gh_inspector (~> 1.0) - molinillo (~> 0.6.4) + molinillo (~> 0.6.5) nap (~> 1.0) ruby-macho (~> 1.1) - xcodeproj (>= 1.5.4, < 2.0) - cocoapods-core (1.4.0) + xcodeproj (>= 1.5.7, < 2.0) + cocoapods-core (1.5.0) activesupport (>= 4.0.2, < 6) fuzzy_match (~> 2.0.4) nap (~> 1.0) cocoapods-deintegrate (1.0.2) - cocoapods-downloader (1.1.3) + cocoapods-downloader (1.2.0) cocoapods-plugins (1.0.0) nap cocoapods-search (1.0.0) @@ -58,7 +58,7 @@ GEM minitest (5.11.3) molinillo (0.6.5) multipart-post (2.0.0) - nanaimo (0.2.4) + nanaimo (0.2.5) nap (1.1.0) netrc (0.11.0) octokit (4.8.0) @@ -100,7 +100,7 @@ PLATFORMS ruby DEPENDENCIES - cocoapods (~> 1.4) + cocoapods (~> 1.5) octokit (~> 4.7) rake (~> 10.4) rubocop (~> 0.51) diff --git a/Package.pins b/Package.pins index efeb6c89..93ffd761 100644 --- a/Package.pins +++ b/Package.pins @@ -17,7 +17,7 @@ "package": "Stencil", "reason": null, "repositoryURL": "https://github.com/kylef/Stencil.git", - "version": "0.10.1" + "version": "0.11.0" } ], "version": 1 diff --git a/Package.resolved b/Package.resolved index e45bb3e3..96e829d3 100644 --- a/Package.resolved +++ b/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/kylef/PathKit.git", "state": { "branch": null, - "revision": "891a3fec2699fc43aed18b7649950677c0152a22", - "version": "0.8.0" + "revision": "fa81fa9e3a9f59645159c4ea45c0c46ee6558f71", + "version": "0.9.1" } }, { @@ -15,8 +15,8 @@ "repositoryURL": "https://github.com/kylef/Spectre.git", "state": { "branch": null, - "revision": "e46b75cf03ad5e563b4b0a5068d3d6f04d77d80b", - "version": "0.7.2" + "revision": "e34d5687e1e9d865e3527dd58bc2f7464ef6d936", + "version": "0.8.0" } }, { @@ -24,8 +24,8 @@ "repositoryURL": "https://github.com/kylef/Stencil.git", "state": { "branch": null, - "revision": "cf7acea440124f6d348032123d8b163c51cfece0", - "version": "0.10.1" + "revision": "c2e25f25acfbe24442809c055141d8323af8f6cc", + "version": "0.11.0" } } ] diff --git a/Package.swift b/Package.swift index 2c257801..0b167657 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/kylef/Stencil.git", .upToNextMinor(from: "0.10.0")) + .package(url: "https://github.com/kylef/Stencil.git", .upToNextMinor(from: "0.11.0")) ], targets: [ .target( diff --git a/Podfile.lock b/Podfile.lock index 03269ecf..b661853d 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,25 +1,31 @@ PODS: - PathKit (0.8.0) - - Stencil (0.10.1): + - Stencil (0.11.0): - PathKit (~> 0.8.0) - StencilSwiftKit (2.4.0): - - Stencil (~> 0.10) - - SwiftLint (0.25.0) + - Stencil (~> 0.11) + - SwiftLint (0.25.1) DEPENDENCIES: - StencilSwiftKit (from `.`) - SwiftLint (~> 0.25) +SPEC REPOS: + https://github.com/CocoaPods/Specs.git: + - PathKit + - Stencil + - SwiftLint + EXTERNAL SOURCES: StencilSwiftKit: - :path: . + :path: "." SPEC CHECKSUMS: PathKit: dcab05d701474011aae0e40cf892298a831f63d6 - Stencil: 40b382c52edab08f1e800e6144c1f04ae47a7a9a - StencilSwiftKit: 67d1f9598afc6785293a21bd5ebe214b02343a2e - SwiftLint: e14651157288e9e01d6e1a71db7014fb5744a8ea + Stencil: a1873ecd92cbc053c6b391de7583b9f5bfbb3de6 + StencilSwiftKit: b27ac57ac979d684d92adaf21488e8df9f23c99b + SwiftLint: ce933681be10c3266e82576dad676fa815a602e9 PODFILE CHECKSUM: 04a106459aafed0d043229000123a22c447e0e7e -COCOAPODS: 1.4.0 +COCOAPODS: 1.5.0 diff --git a/Pods/Local Podspecs/StencilSwiftKit.podspec.json b/Pods/Local Podspecs/StencilSwiftKit.podspec.json index a0fab908..5bbd9046 100644 --- a/Pods/Local Podspecs/StencilSwiftKit.podspec.json +++ b/Pods/Local Podspecs/StencilSwiftKit.podspec.json @@ -21,7 +21,7 @@ "source_files": "Sources/**/*.swift", "dependencies": { "Stencil": [ - "~> 0.10" + "~> 0.11" ] }, "frameworks": "Foundation" diff --git a/Pods/Manifest.lock b/Pods/Manifest.lock index 03269ecf..b661853d 100644 --- a/Pods/Manifest.lock +++ b/Pods/Manifest.lock @@ -1,25 +1,31 @@ PODS: - PathKit (0.8.0) - - Stencil (0.10.1): + - Stencil (0.11.0): - PathKit (~> 0.8.0) - StencilSwiftKit (2.4.0): - - Stencil (~> 0.10) - - SwiftLint (0.25.0) + - Stencil (~> 0.11) + - SwiftLint (0.25.1) DEPENDENCIES: - StencilSwiftKit (from `.`) - SwiftLint (~> 0.25) +SPEC REPOS: + https://github.com/CocoaPods/Specs.git: + - PathKit + - Stencil + - SwiftLint + EXTERNAL SOURCES: StencilSwiftKit: - :path: . + :path: "." SPEC CHECKSUMS: PathKit: dcab05d701474011aae0e40cf892298a831f63d6 - Stencil: 40b382c52edab08f1e800e6144c1f04ae47a7a9a - StencilSwiftKit: 67d1f9598afc6785293a21bd5ebe214b02343a2e - SwiftLint: e14651157288e9e01d6e1a71db7014fb5744a8ea + Stencil: a1873ecd92cbc053c6b391de7583b9f5bfbb3de6 + StencilSwiftKit: b27ac57ac979d684d92adaf21488e8df9f23c99b + SwiftLint: ce933681be10c3266e82576dad676fa815a602e9 PODFILE CHECKSUM: 04a106459aafed0d043229000123a22c447e0e7e -COCOAPODS: 1.4.0 +COCOAPODS: 1.5.0 diff --git a/Pods/Pods.xcodeproj/project.pbxproj b/Pods/Pods.xcodeproj/project.pbxproj index 7121c4fd..5ebeffc7 100644 --- a/Pods/Pods.xcodeproj/project.pbxproj +++ b/Pods/Pods.xcodeproj/project.pbxproj @@ -667,10 +667,44 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ - 065E3ACDBD3ADF7990FE7B83527453C6 /* Debug */ = { + 06DCBF99510C280223C84D8BABA015B1 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 07DCADD0683A356CBAD29F0780769F3A /* Pods-Tests.debug.xcconfig */; + baseConfigurationReference = 126BF9987F70EFF90B58E3F4E1438BFD /* StencilSwiftKit.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/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/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; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 080E10A5B7D2ECE96473813041A052E3 /* 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*]" = ""; @@ -692,17 +726,49 @@ OTHER_LIBTOOLFLAGS = ""; PODS_ROOT = "$(SRCROOT)"; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_Tests; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SDKROOT = macosx; SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 2C137AD026F05AABBD62E4FA25BF020C /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 1201924A61C0D3CB810C7604FCC3B2A4 /* 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 = "-Onone"; + SWIFT_VERSION = 3.2; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Debug; }; - 0CBB0C3F8B88C506F530B0415F7FA0C0 /* Release */ = { + 542C02DDC92653F795BD7053CE5F9D73 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -734,15 +800,19 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGNING_ALLOWED = NO; CODE_SIGNING_REQUIRED = NO; COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; + DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_RELEASE=1", + "POD_CONFIGURATION_DEBUG=1", + "DEBUG=1", "$(inherited)", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -752,18 +822,20 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.9; - MTL_ENABLE_DEBUG_INFO = NO; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; STRIP_INSTALLED_PRODUCT = NO; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SYMROOT = "${SRCROOT}/../build"; }; - name = Release; + name = Debug; }; - 233C04C320B7512786D9CD4EFFC9916D /* Release */ = { + 8387B698C6E79405404AE4E99E85A995 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 77549DFEB1FD0EB82601E5D4D2ED43E8 /* Pods-Tests.release.xcconfig */; + baseConfigurationReference = 07DCADD0683A356CBAD29F0780769F3A /* Pods-Tests.debug.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; @@ -785,48 +857,17 @@ OTHER_LIBTOOLFLAGS = ""; PODS_ROOT = "$(SRCROOT)"; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_Tests; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SDKROOT = macosx; SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 280DF9F91B067BB1970140107B811AF1 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 1201924A61C0D3CB810C7604FCC3B2A4 /* 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_NAME = Stencil; - SDKROOT = macosx; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.2; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Debug; }; - 28C721469BFD50115EFCBED092DBDF95 /* Debug */ = { + 88D838C484BA28B48BAF926800EC6846 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 126BF9987F70EFF90B58E3F4E1438BFD /* StencilSwiftKit.xcconfig */; buildSettings = { @@ -847,52 +888,79 @@ 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; SDKROOT = macosx; SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 4.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Debug; + name = Release; }; - 400CC24BABCABBBD23645E26C89EA4B1 /* Debug */ = { + 9680D5C47B34B2CB63E3B05348B50E70 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = D9331BA1AC65A9A3DF6841DC0E607CB7 /* PathKit.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/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"; + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGNING_ALLOWED = NO; + CODE_SIGNING_REQUIRED = NO; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_RELEASE=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.9; - MODULEMAP_FILE = "Target Support Files/PathKit/PathKit.modulemap"; - PRODUCT_NAME = PathKit; - SDKROOT = macosx; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; + STRIP_INSTALLED_PRODUCT = NO; + SYMROOT = "${SRCROOT}/../build"; }; - name = Debug; + name = Release; }; - 651E953DC9AC4FA34E4643DD0B279723 /* Release */ = { + 9D855597FD3670E495D83BDF79870D8E /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 126BF9987F70EFF90B58E3F4E1438BFD /* StencilSwiftKit.xcconfig */; + baseConfigurationReference = D9331BA1AC65A9A3DF6841DC0E607CB7 /* PathKit.xcconfig */; buildSettings = { CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; @@ -905,13 +973,14 @@ 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_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) "; @@ -922,7 +991,7 @@ }; name = Release; }; - A077B85149CFA6BFA91AF041CAA04D55 /* Release */ = { + E39959DFB3B604BBACB200782DD60B27 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = D9331BA1AC65A9A3DF6841DC0E607CB7 /* PathKit.xcconfig */; buildSettings = { @@ -943,18 +1012,19 @@ 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; SDKROOT = macosx; SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 4.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Release; + name = Debug; }; - DC348207046A088126029DA6C35B19FA /* Release */ = { + F111B6B34AA574180E3D314F2FEC8E60 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 1201924A61C0D3CB810C7604FCC3B2A4 /* Stencil.xcconfig */; buildSettings = { @@ -975,6 +1045,7 @@ 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; @@ -986,77 +1057,14 @@ }; name = Release; }; - E049151FCB2BA6261F95D27A97A38543 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGNING_REQUIRED = NO; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_DEBUG=1", - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.9; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; - STRIP_INSTALLED_PRODUCT = NO; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SYMROOT = "${SRCROOT}/../build"; - }; - name = Debug; - }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 129C5DBD1F855F49F876BF6123ACCEA1 /* Build configuration list for PBXNativeTarget "StencilSwiftKit" */ = { isa = XCConfigurationList; buildConfigurations = ( - 28C721469BFD50115EFCBED092DBDF95 /* Debug */, - 651E953DC9AC4FA34E4643DD0B279723 /* Release */, + 06DCBF99510C280223C84D8BABA015B1 /* Debug */, + 88D838C484BA28B48BAF926800EC6846 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1064,8 +1072,8 @@ 16979C34640D48A0B74CB98481EF3159 /* Build configuration list for PBXNativeTarget "Stencil" */ = { isa = XCConfigurationList; buildConfigurations = ( - 280DF9F91B067BB1970140107B811AF1 /* Debug */, - DC348207046A088126029DA6C35B19FA /* Release */, + 2C137AD026F05AABBD62E4FA25BF020C /* Debug */, + F111B6B34AA574180E3D314F2FEC8E60 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1073,8 +1081,8 @@ 23F10DCF4CC19FAEB872F3FF8C874D18 /* Build configuration list for PBXNativeTarget "PathKit" */ = { isa = XCConfigurationList; buildConfigurations = ( - 400CC24BABCABBBD23645E26C89EA4B1 /* Debug */, - A077B85149CFA6BFA91AF041CAA04D55 /* Release */, + E39959DFB3B604BBACB200782DD60B27 /* Debug */, + 9D855597FD3670E495D83BDF79870D8E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1082,8 +1090,8 @@ 281DCC93B5E0B5105C552F2301CC9F8A /* Build configuration list for PBXNativeTarget "Pods-Tests" */ = { isa = XCConfigurationList; buildConfigurations = ( - 065E3ACDBD3ADF7990FE7B83527453C6 /* Debug */, - 233C04C320B7512786D9CD4EFFC9916D /* Release */, + 8387B698C6E79405404AE4E99E85A995 /* Debug */, + 080E10A5B7D2ECE96473813041A052E3 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1091,8 +1099,8 @@ 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { isa = XCConfigurationList; buildConfigurations = ( - E049151FCB2BA6261F95D27A97A38543 /* Debug */, - 0CBB0C3F8B88C506F530B0415F7FA0C0 /* Release */, + 542C02DDC92653F795BD7053CE5F9D73 /* Debug */, + 9680D5C47B34B2CB63E3B05348B50E70 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/Pods/Stencil/README.md b/Pods/Stencil/README.md index ded2ca13..668c7cdc 100644 --- a/Pods/Stencil/README.md +++ b/Pods/Stencil/README.md @@ -63,6 +63,12 @@ Resources to help you integrate Stencil into a Swift project: - [API Reference](http://stencil.fuller.li/en/latest/api.html) - [Custom Template Tags and Filters](http://stencil.fuller.li/en/latest/custom-template-tags-and-filters.html) +## Projects that use Stencil + +[Sourcery](https://github.com/krzysztofzablocki/Sourcery), +[SwiftGen](https://github.com/SwiftGen/SwiftGen), +[Kitura](https://github.com/IBM-Swift/Kitura) + ## License Stencil is licensed under the BSD license. See [LICENSE](LICENSE) for more diff --git a/Pods/Stencil/Sources/Expression.swift b/Pods/Stencil/Sources/Expression.swift index 1f41afee..c7199fc6 100644 --- a/Pods/Stencil/Sources/Expression.swift +++ b/Pods/Stencil/Sources/Expression.swift @@ -105,6 +105,10 @@ final class InExpression: Expression, InfixOperator, CustomStringConvertible { if let lhs = lhsValue as? AnyHashable, let rhs = rhsValue as? [AnyHashable] { return rhs.contains(lhs) + } else if let lhs = lhsValue as? Int, let rhs = rhsValue as? CountableClosedRange { + return rhs.contains(lhs) + } else if let lhs = lhsValue as? Int, let rhs = rhsValue as? CountableRange { + return rhs.contains(lhs) } else if let lhs = lhsValue as? String, let rhs = rhsValue as? String { return rhs.contains(lhs) } else if lhsValue == nil && rhsValue == nil { diff --git a/Pods/Stencil/Sources/Extension.swift b/Pods/Stencil/Sources/Extension.swift index 9dfa879a..33a9925a 100644 --- a/Pods/Stencil/Sources/Extension.swift +++ b/Pods/Stencil/Sources/Extension.swift @@ -57,6 +57,8 @@ class DefaultExtension: Extension { registerFilter("uppercase", filter: uppercase) registerFilter("lowercase", filter: lowercase) registerFilter("join", filter: joinFilter) + registerFilter("split", filter: splitFilter) + registerFilter("indent", filter: indentFilter) } } diff --git a/Pods/Stencil/Sources/Filters.swift b/Pods/Stencil/Sources/Filters.swift index dd78ff42..fece6ebd 100644 --- a/Pods/Stencil/Sources/Filters.swift +++ b/Pods/Stencil/Sources/Filters.swift @@ -1,17 +1,30 @@ func capitalise(_ value: Any?) -> Any? { - return stringify(value).capitalized + if let array = value as? [Any?] { + return array.map { stringify($0).capitalized } + } else { + return stringify(value).capitalized + } } func uppercase(_ value: Any?) -> Any? { - return stringify(value).uppercased() + if let array = value as? [Any?] { + return array.map { stringify($0).uppercased() } + } else { + return stringify(value).uppercased() + } } func lowercase(_ value: Any?) -> Any? { - return stringify(value).lowercased() + if let array = value as? [Any?] { + return array.map { stringify($0).lowercased() } + } else { + return stringify(value).lowercased() + } } func defaultFilter(value: Any?, arguments: [Any?]) -> Any? { - if let value = value { + // value can be optional wrapping nil, so this way we check for underlying value + if let value = value, String(describing: value) != "nil" { return value } @@ -39,3 +52,62 @@ func joinFilter(value: Any?, arguments: [Any?]) throws -> Any? { return value } + +func splitFilter(value: Any?, arguments: [Any?]) throws -> Any? { + guard arguments.count < 2 else { + throw TemplateSyntaxError("'split' filter takes a single argument") + } + + let separator = stringify(arguments.first ?? " ") + if let value = value as? String { + return value.components(separatedBy: separator) + } + + return value +} + +func indentFilter(value: Any?, arguments: [Any?]) throws -> Any? { + guard arguments.count <= 3 else { + throw TemplateSyntaxError("'indent' filter can take at most 3 arguments") + } + + 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])))") + } + indentWidth = value + } + + 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]))") + } + indentationChar = value + } + + var indentFirst = false + if arguments.count > 2 { + guard let value = arguments[2] as? Bool else { + throw TemplateSyntaxError("'indent' filter indentFirst argument must be a Bool") + } + indentFirst = value + } + + let indentation = [String](repeating: indentationChar, count: indentWidth).joined(separator: "") + return indent(stringify(value), indentation: indentation, indentFirst: indentFirst) +} + + +func indent(_ content: String, indentation: String, indentFirst: Bool) -> String { + guard !indentation.isEmpty else { return content } + + var lines = content.components(separatedBy: .newlines) + let firstLine = (indentFirst ? indentation : "") + lines.removeFirst() + let result = lines.reduce([firstLine]) { (result, line) in + return result + [(line.isEmpty ? "" : "\(indentation)\(line)")] + } + return result.joined(separator: "\n") +} + diff --git a/Pods/Stencil/Sources/ForTag.swift b/Pods/Stencil/Sources/ForTag.swift index d921a827..cb96657d 100644 --- a/Pods/Stencil/Sources/ForTag.swift +++ b/Pods/Stencil/Sources/ForTag.swift @@ -10,9 +10,15 @@ class ForNode : NodeType { class func parse(_ parser:TokenParser, token:Token) throws -> NodeType { let components = token.components() - guard components.count >= 3 && components[2] == "in" && - (components.count == 4 || (components.count >= 6 && components[4] == "where")) else { - throw TemplateSyntaxError("'for' statements should use the following 'for x in y where condition' `\(token.contents)`.") + func hasToken(_ token: String, at index: Int) -> Bool { + return components.count > (index + 1) && components[index] == token + } + func endsOrHasToken(_ token: String, at index: Int) -> Bool { + return components.count == index || hasToken(token, at: index) + } + + guard hasToken("in", at: 2) && endsOrHasToken("where", at: 4) else { + throw TemplateSyntaxError("'for' statements should use the syntax: `for in [where ]") } let loopVariables = components[1].characters @@ -20,8 +26,6 @@ class ForNode : NodeType { .map(String.init) .map { $0.trimmingCharacters(in: CharacterSet.whitespaces) } - let variable = components[3] - var emptyNodes = [NodeType]() let forNodes = try parser.parse(until(["endfor", "empty"])) @@ -35,14 +39,13 @@ class ForNode : NodeType { _ = parser.nextToken() } - let filter = try parser.compileFilter(variable) - let `where`: Expression? - if components.count >= 6 { - `where` = try parseExpression(components: Array(components.suffix(from: 5)), tokenParser: parser) - } else { - `where` = nil - } - return ForNode(resolvable: filter, loopVariables: loopVariables, nodes: forNodes, emptyNodes:emptyNodes, where: `where`) + let resolvable = try parser.compileResolvable(components[3]) + + let `where` = hasToken("where", at: 4) + ? try parseExpression(components: Array(components.suffix(from: 5)), tokenParser: parser) + : nil + + return ForNode(resolvable: resolvable, loopVariables: loopVariables, nodes: forNodes, emptyNodes:emptyNodes, where: `where`) } init(resolvable: Resolvable, loopVariables: [String], nodes:[NodeType], emptyNodes:[NodeType], where: Expression? = nil) { @@ -53,25 +56,26 @@ class ForNode : NodeType { self.where = `where` } - func push(value: Any, context: Context, closure: () throws -> (Result)) rethrows -> Result { + func push(value: Any, context: Context, closure: () throws -> (Result)) throws -> Result { if loopVariables.isEmpty { return try context.push() { return try closure() } } - if let value = value as? (Any, Any) { - let first = loopVariables[0] - - if loopVariables.count == 2 { - let second = loopVariables[1] - - return try context.push(dictionary: [first: value.0, second: value.1]) { - return try closure() - } + let valueMirror = Mirror(reflecting: value) + if case .tuple? = valueMirror.displayStyle { + if loopVariables.count > Int(valueMirror.children.count) { + throw TemplateSyntaxError("Tuple '\(value)' has less values than loop variables") } + var variablesContext = [String: Any]() + valueMirror.children.prefix(loopVariables.count).enumerated().forEach({ (offset, element) in + if loopVariables[offset] != "_" { + variablesContext[loopVariables[offset]] = element.value + } + }) - return try context.push(dictionary: [first: value.0]) { + return try context.push(dictionary: variablesContext) { return try closure() } } @@ -94,6 +98,22 @@ class ForNode : NodeType { values = Array(range) } else if let range = resolved as? CountableRange { values = Array(range) + } else if let resolved = resolved { + let mirror = Mirror(reflecting: resolved) + switch mirror.displayStyle { + case .struct?, .tuple?: + values = Array(mirror.children) + case .class?: + var children = Array(mirror.children) + var currentMirror: Mirror? = mirror + while let superclassMirror = currentMirror?.superclassMirror { + children.append(contentsOf: superclassMirror.children) + currentMirror = superclassMirror + } + values = Array(children) + default: + values = [] + } } else { values = [] } @@ -115,6 +135,7 @@ class ForNode : NodeType { "last": index == (count - 1), "counter": index + 1, "counter0": index, + "length": count ] return try context.push(dictionary: ["forloop": forContext]) { diff --git a/Pods/Stencil/Sources/IfTag.swift b/Pods/Stencil/Sources/IfTag.swift index 8f3b0fda..a857d3eb 100644 --- a/Pods/Stencil/Sources/IfTag.swift +++ b/Pods/Stencil/Sources/IfTag.swift @@ -111,7 +111,7 @@ final class IfExpressionParser { } } - return .variable(try tokenParser.compileFilter(component)) + return .variable(try tokenParser.compileResolvable(component)) } } diff --git a/Pods/Stencil/Sources/Inheritence.swift b/Pods/Stencil/Sources/Inheritence.swift index 9919c163..b9bf87ac 100644 --- a/Pods/Stencil/Sources/Inheritence.swift +++ b/Pods/Stencil/Sources/Inheritence.swift @@ -1,14 +1,36 @@ class BlockContext { class var contextKey: String { return "block_context" } - var blocks: [String: BlockNode] + var blocks: [String: [BlockNode]] init(blocks: [String: BlockNode]) { - self.blocks = blocks + self.blocks = [:] + blocks.forEach { (key, value) in + self.blocks[key] = [value] + } } + func push(_ block: BlockNode, forKey blockName: String) { + if var blocks = blocks[blockName] { + blocks.append(block) + self.blocks[blockName] = blocks + } else { + self.blocks[blockName] = [block] + } + } + func pop(_ blockName: String) -> BlockNode? { - return blocks.removeValue(forKey: blockName) + if var blocks = blocks[blockName] { + let block = blocks.removeFirst() + if blocks.isEmpty { + self.blocks.removeValue(forKey: blockName) + } else { + self.blocks[blockName] = blocks + } + return block + } else { + return nil + } } } @@ -70,9 +92,7 @@ class ExtendsNode : NodeType { blockContext = context for (key, value) in blocks { - if !blockContext.blocks.keys.contains(key) { - blockContext.blocks[key] = value - } + blockContext.push(value, forKey: key) } } else { blockContext = BlockContext(blocks: blocks) @@ -109,7 +129,11 @@ class BlockNode : NodeType { func render(_ context: Context) throws -> String { if let blockContext = context[BlockContext.contextKey] as? BlockContext, let node = blockContext.pop(name) { - return try context.push(dictionary: ["block": ["super": self]]) { + let newContext: [String: Any] = [ + BlockContext.contextKey: blockContext, + "block": ["super": try self.render(context)] + ] + return try context.push(dictionary: newContext) { return try node.render(context) } } diff --git a/Pods/Stencil/Sources/Lexer.swift b/Pods/Stencil/Sources/Lexer.swift index 5bd590da..b2217752 100644 --- a/Pods/Stencil/Sources/Lexer.swift +++ b/Pods/Stencil/Sources/Lexer.swift @@ -10,7 +10,12 @@ struct Lexer { guard string.characters.count > 4 else { return "" } let start = string.index(string.startIndex, offsetBy: 2) let end = string.index(string.endIndex, offsetBy: -2) - return String(string[start.. String { if let result = result as? String { return result + } else if let array = result as? [Any?] { + return unwrap(array).description } else if let result = result as? CustomStringConvertible { return result.description } else if let result = result as? NSObject { @@ -86,3 +88,16 @@ func stringify(_ result: Any?) -> String { return "" } + +func unwrap(_ array: [Any?]) -> [Any] { + return array.map { (item: Any?) -> Any in + if let item = item { + if let items = item as? [Any?] { + return unwrap(items) + } else { + return item + } + } + else { return item as Any } + } +} diff --git a/Pods/Stencil/Sources/Parser.swift b/Pods/Stencil/Sources/Parser.swift index 1a59edba..81a44e10 100644 --- a/Pods/Stencil/Sources/Parser.swift +++ b/Pods/Stencil/Sources/Parser.swift @@ -40,7 +40,7 @@ public class TokenParser { case .text(let text): nodes.append(TextNode(text: text)) case .variable: - nodes.append(VariableNode(variable: try compileFilter(token.contents))) + nodes.append(VariableNode(variable: try compileResolvable(token.contents))) case .block: if let parse_until = parse_until , parse_until(self, token) { prependToken(token) @@ -88,11 +88,77 @@ public class TokenParser { } } - throw TemplateSyntaxError("Unknown filter '\(name)'") + let suggestedFilters = self.suggestedFilters(for: name) + if suggestedFilters.isEmpty { + throw TemplateSyntaxError("Unknown filter '\(name)'.") + } else { + throw TemplateSyntaxError("Unknown filter '\(name)'. Found similar filters: \(suggestedFilters.map({ "'\($0)'" }).joined(separator: ", "))") + } + } + + private func suggestedFilters(for name: String) -> [String] { + let allFilters = environment.extensions.flatMap({ $0.filters.keys }) + + 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 }) + guard let minDistance = filtersWithDistance.min(by: { $0.distance < $1.distance })?.distance else { + return [] + } + // suggest all filters with the same distance + return filtersWithDistance.filter({ $0.distance == minDistance }).map({ $0.filterName }) } public func compileFilter(_ token: String) throws -> Resolvable { return try FilterExpression(token: token, parser: self) } + public func compileResolvable(_ token: String) throws -> Resolvable { + return try RangeVariable(token, parser: self) + ?? compileFilter(token) + } + +} + +// https://en.wikipedia.org/wiki/Levenshtein_distance#Iterative_with_two_matrix_rows +extension String { + + subscript(_ i: Int) -> Character { + return self[self.index(self.startIndex, offsetBy: i)] + } + + func levenshteinDistance(_ target: String) -> Int { + // create two work vectors of integer distances + var last, current: [Int] + + // 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) + + for i in 0.. Bool { return lhs.variable == rhs.variable } +/// A structure used to represet range of two integer values expressed as `from...to`. +/// Values should be numbers (they will be converted to integers). +/// Rendering this variable produces array from range `from...to`. +/// If `from` is more than `to` array will contain values of reversed range. +public struct RangeVariable: Resolvable { + public let from: Resolvable + public let to: Resolvable + + public init?(_ token: String, parser: TokenParser) throws { + let components = token.components(separatedBy: "...") + guard components.count == 2 else { + return nil + } + + self.from = try parser.compileFilter(components[0]) + self.to = try parser.compileFilter(components[1]) + } + + public func resolve(_ context: Context) throws -> Any? { + let fromResolved = try from.resolve(context) + let toResolved = try to.resolve(context) + + guard let from = fromResolved.flatMap(toNumber(value:)).flatMap(Int.init) else { + throw TemplateSyntaxError("'from' value is not an Integer (\(fromResolved ?? "nil"))") + } + + guard let to = toResolved.flatMap(toNumber(value:)).flatMap(Int.init) else { + throw TemplateSyntaxError("'to' value is not an Integer (\(toResolved ?? "nil") )") + } + + let range = min(from, to)...max(from, to) + return from > to ? Array(range.reversed()) : Array(range) + } + +} + func normalize(_ current: Any?) -> Any? { if let current = current as? Normalizable { @@ -179,3 +216,40 @@ func parseFilterComponents(token: String) -> (String, [Variable]) { .map { Variable($0) } return (name, variables) } + +extension Mirror { + func getValue(for key: String) -> Any? { + let result = descendant(key) ?? Int(key).flatMap({ descendant($0) }) + if result == nil { + // go through inheritance chain to reach superclass properties + return superclassMirror?.getValue(for: key) + } else if let result = result { + guard String(describing: result) != "nil" else { + // mirror returns non-nil value even for nil-containing properties + // so we have to check if its value is actually nil or not + return nil + } + if let result = (result as? AnyOptional)?.wrapped { + return result + } else { + return result + } + } + return result + } +} + +protocol AnyOptional { + var wrapped: Any? { get } +} + +extension Optional: AnyOptional { + var wrapped: Any? { + switch self { + case let .some(value): return value + case .none: return nil + } + } +} + + diff --git a/Pods/SwiftLint/swiftlint b/Pods/SwiftLint/swiftlint index e0d594b3..2b40969d 100755 Binary files a/Pods/SwiftLint/swiftlint and b/Pods/SwiftLint/swiftlint differ diff --git a/Pods/Target Support Files/PathKit/PathKit.xcconfig b/Pods/Target Support Files/PathKit/PathKit.xcconfig index be09dfff..f8732c36 100644 --- a/Pods/Target Support Files/PathKit/PathKit.xcconfig +++ b/Pods/Target Support Files/PathKit/PathKit.xcconfig @@ -1,7 +1,6 @@ CODE_SIGN_IDENTITY = CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/PathKit GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SwiftLint" OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" PODS_BUILD_DIR = ${BUILD_DIR} PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) diff --git a/Pods/Target Support Files/Pods-Tests/Pods-Tests-frameworks.sh b/Pods/Target Support Files/Pods-Tests/Pods-Tests-frameworks.sh index 0dfc8499..18ab0c44 100755 --- a/Pods/Target Support Files/Pods-Tests/Pods-Tests-frameworks.sh +++ b/Pods/Target Support Files/Pods-Tests/Pods-Tests-frameworks.sh @@ -1,9 +1,18 @@ #!/bin/sh set -e +set -u +set -o pipefail + +if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then + # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy + # frameworks to, so exit 0 (signalling the script phase was successful). + exit 0 +fi echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" # Used as a return value for each invocation of `strip_invalid_archs` function. @@ -92,10 +101,10 @@ install_dsym() { # Signs a framework with the provided identity code_sign_if_enabled() { - if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then # Use the current code_sign_identitiy echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" - local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then code_sign_cmd="$code_sign_cmd &" diff --git a/Pods/Target Support Files/Pods-Tests/Pods-Tests-resources.sh b/Pods/Target Support Files/Pods-Tests/Pods-Tests-resources.sh index a7df4405..fe3f9c72 100755 --- a/Pods/Target Support Files/Pods-Tests/Pods-Tests-resources.sh +++ b/Pods/Target Support Files/Pods-Tests/Pods-Tests-resources.sh @@ -1,5 +1,13 @@ #!/bin/sh set -e +set -u +set -o pipefail + +if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then + # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy + # resources to, so exit 0 (signalling the script phase was successful). + exit 0 +fi mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" @@ -12,7 +20,7 @@ XCASSET_FILES=() # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") -case "${TARGETED_DEVICE_FAMILY}" in +case "${TARGETED_DEVICE_FAMILY:-}" in 1,2) TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" ;; @@ -92,7 +100,7 @@ if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then fi rm -f "$RESOURCES_TO_COPY" -if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] then # Find all other xcassets (this unfortunately includes those of path pods and other targets). OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) @@ -102,5 +110,9 @@ then fi done <<<"$OTHER_XCASSETS" - printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + else + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_BUILD_DIR}/assetcatalog_generated_info.plist" + fi fi diff --git a/Pods/Target Support Files/Pods-Tests/Pods-Tests.debug.xcconfig b/Pods/Target Support Files/Pods-Tests/Pods-Tests.debug.xcconfig index ba74e8ec..57221bda 100644 --- a/Pods/Target Support Files/Pods-Tests/Pods-Tests.debug.xcconfig +++ b/Pods/Target Support Files/Pods-Tests/Pods-Tests.debug.xcconfig @@ -2,9 +2,8 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES CODE_SIGN_IDENTITY = FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/PathKit" "${PODS_CONFIGURATION_BUILD_DIR}/Stencil" "${PODS_CONFIGURATION_BUILD_DIR}/StencilSwiftKit" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SwiftLint" LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/../Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/PathKit/PathKit.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Stencil/Stencil.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/StencilSwiftKit/StencilSwiftKit.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SwiftLint" +OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/PathKit/PathKit.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Stencil/Stencil.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/StencilSwiftKit/StencilSwiftKit.framework/Headers" OTHER_LDFLAGS = $(inherited) -framework "PathKit" -framework "Stencil" -framework "StencilSwiftKit" OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" PODS_BUILD_DIR = ${BUILD_DIR} diff --git a/Pods/Target Support Files/Pods-Tests/Pods-Tests.release.xcconfig b/Pods/Target Support Files/Pods-Tests/Pods-Tests.release.xcconfig index ba74e8ec..57221bda 100644 --- a/Pods/Target Support Files/Pods-Tests/Pods-Tests.release.xcconfig +++ b/Pods/Target Support Files/Pods-Tests/Pods-Tests.release.xcconfig @@ -2,9 +2,8 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES CODE_SIGN_IDENTITY = FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/PathKit" "${PODS_CONFIGURATION_BUILD_DIR}/Stencil" "${PODS_CONFIGURATION_BUILD_DIR}/StencilSwiftKit" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SwiftLint" LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/../Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/PathKit/PathKit.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Stencil/Stencil.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/StencilSwiftKit/StencilSwiftKit.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SwiftLint" +OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/PathKit/PathKit.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Stencil/Stencil.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/StencilSwiftKit/StencilSwiftKit.framework/Headers" OTHER_LDFLAGS = $(inherited) -framework "PathKit" -framework "Stencil" -framework "StencilSwiftKit" OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" PODS_BUILD_DIR = ${BUILD_DIR} diff --git a/Pods/Target Support Files/Stencil/Info.plist b/Pods/Target Support Files/Stencil/Info.plist index 0a7e38b9..1b8f7d0e 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.10.1 + 0.11.0 CFBundleSignature ???? CFBundleVersion diff --git a/Pods/Target Support Files/Stencil/Stencil.xcconfig b/Pods/Target Support Files/Stencil/Stencil.xcconfig index 58f4ad1d..ba33efe3 100644 --- a/Pods/Target Support Files/Stencil/Stencil.xcconfig +++ b/Pods/Target Support Files/Stencil/Stencil.xcconfig @@ -2,7 +2,6 @@ CODE_SIGN_IDENTITY = CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Stencil FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/PathKit" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SwiftLint" OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" PODS_BUILD_DIR = ${BUILD_DIR} PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) diff --git a/Pods/Target Support Files/StencilSwiftKit/StencilSwiftKit.xcconfig b/Pods/Target Support Files/StencilSwiftKit/StencilSwiftKit.xcconfig index c66735bc..bf8552c3 100644 --- a/Pods/Target Support Files/StencilSwiftKit/StencilSwiftKit.xcconfig +++ b/Pods/Target Support Files/StencilSwiftKit/StencilSwiftKit.xcconfig @@ -2,7 +2,6 @@ CODE_SIGN_IDENTITY = CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/StencilSwiftKit FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/PathKit" "${PODS_CONFIGURATION_BUILD_DIR}/Stencil" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SwiftLint" OTHER_LDFLAGS = -framework "Foundation" OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" PODS_BUILD_DIR = ${BUILD_DIR} diff --git a/Sources/StencilSwiftTemplate.swift b/Sources/StencilSwiftTemplate.swift index 975fa5d9..eb78beeb 100644 --- a/Sources/StencilSwiftTemplate.swift +++ b/Sources/StencilSwiftTemplate.swift @@ -20,6 +20,7 @@ open class StencilSwiftTemplate: Template { super.init(templateString: templateStringWithMarkedNewlines, environment: environment, name: name) } + // swiftlint:disable:next discouraged_optional_collection open override func render(_ dictionary: [String: Any]? = nil) throws -> String { return try removeExtraLines(from: super.render(dictionary)) } diff --git a/StencilSwiftKit.podspec b/StencilSwiftKit.podspec index 1655032c..777d6de1 100644 --- a/StencilSwiftKit.podspec +++ b/StencilSwiftKit.podspec @@ -22,6 +22,6 @@ Pod::Spec.new do |s| s.source = { git: 'https://github.com/SwiftGen/StencilSwiftKit.git', tag: s.version.to_s } s.source_files = 'Sources/**/*.swift' - s.dependency 'Stencil', '~> 0.10' + s.dependency 'Stencil', '~> 0.11' s.framework = 'Foundation' end diff --git a/StencilSwiftKit.xcodeproj/project.pbxproj b/StencilSwiftKit.xcodeproj/project.pbxproj index df62501f..4f50ebac 100644 --- a/StencilSwiftKit.xcodeproj/project.pbxproj +++ b/StencilSwiftKit.xcodeproj/project.pbxproj @@ -174,7 +174,6 @@ 09A87B4D1BCCA2C600D9B9F5 /* Frameworks */, 09A87B4E1BCCA2C600D9B9F5 /* Resources */, DE127EA8748200EF28090721 /* [CP] Embed Pods Frameworks */, - E927380300BBDAC26313194A /* [CP] Copy Pods Resources */, ); buildRules = ( 09A87B721BCCA60900D9B9F5 /* PBXBuildRule */, @@ -287,21 +286,6 @@ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Tests/Pods-Tests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - E927380300BBDAC26313194A /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Tests/Pods-Tests-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ diff --git a/Tests/StencilSwiftKitTests/TestsHelper.swift b/Tests/StencilSwiftKitTests/TestsHelper.swift index cc7827c3..4fe5d498 100644 --- a/Tests/StencilSwiftKitTests/TestsHelper.swift +++ b/Tests/StencilSwiftKitTests/TestsHelper.swift @@ -88,8 +88,8 @@ class Fixtures { let subDir: String? = name.hasSuffix(".stencil") ? "fixtures" : "expected" do { return try path(for: name, subDirectory: subDir).read(encoding) - } catch let e { - fatalError("Unable to load fixture content: \(e)") + } catch let error { + fatalError("Unable to load fixture content: \(error)") } } }