diff --git a/.gitignore b/.gitignore index 2c22487..89b874c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ ## Build generated build/ DerivedData/ +Fixtures/stub-env/**/*.swiftmodule ## Various settings *.pbxuser @@ -20,6 +21,7 @@ xcuserdata/ ## Other *.moved-aside *.xcuserstate +*.xcscmblueprint ## Obj-C/Swift specific *.hmap @@ -34,7 +36,7 @@ playground.xcworkspace # Swift Package Manager # # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ +Packages/ .build/ # CocoaPods @@ -48,8 +50,7 @@ playground.xcworkspace # Carthage # # Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - +Carthage/Checkouts Carthage/Build # fastlane @@ -63,3 +64,11 @@ fastlane/report.xml fastlane/Preview.html fastlane/screenshots fastlane/test_output + +# Other stuff +.apitoken +.DS_Store +.idea/ +bin/ +Frameworks/ +Rome/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6b2d511..0000000 --- a/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: objective-c -os: osx -osx_image: xcode8.2 - -install: - - gem install xcpretty --no-rdoc --no-ri --no-document --quiet - -env: - - RAKETASK=test - - RAKETASK=lint - -script: - - rake "$RAKETASK" diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cca99f..7deff43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,9 @@ _None_ ### Internal Changes -_None_ +* Switch from Travis CI to Circle CI, clean up the Rakefile in the process. + [David Jennes](https://github.com/djbe) + [#10](https://github.com/SwiftGen/SwiftGenKit/issues/10) ## 1.0.1 diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..8c13227 --- /dev/null +++ b/Gemfile @@ -0,0 +1,5 @@ +# frozen_string_literal: true +source 'https://rubygems.org' + +gem 'cocoapods', '1.2.0' +gem 'xcpretty' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..d40e2b7 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,77 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (2.3.5) + activesupport (4.2.8) + i18n (~> 0.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + claide (1.0.1) + cocoapods (1.2.0) + activesupport (>= 4.0.2, < 5) + claide (>= 1.0.1, < 2.0) + cocoapods-core (= 1.2.0) + cocoapods-deintegrate (>= 1.0.1, < 2.0) + cocoapods-downloader (>= 1.1.3, < 2.0) + cocoapods-plugins (>= 1.0.0, < 2.0) + cocoapods-search (>= 1.0.0, < 2.0) + cocoapods-stats (>= 1.0.0, < 2.0) + cocoapods-trunk (>= 1.1.2, < 2.0) + cocoapods-try (>= 1.1.0, < 2.0) + colored (~> 1.2) + escape (~> 0.0.4) + fourflusher (~> 2.0.1) + gh_inspector (~> 1.0) + molinillo (~> 0.5.5) + nap (~> 1.0) + ruby-macho (~> 0.2.5) + xcodeproj (>= 1.4.1, < 2.0) + cocoapods-core (1.2.0) + activesupport (>= 4.0.2, < 5) + fuzzy_match (~> 2.0.4) + nap (~> 1.0) + cocoapods-deintegrate (1.0.1) + cocoapods-downloader (1.1.3) + cocoapods-plugins (1.0.0) + nap + cocoapods-search (1.0.0) + cocoapods-stats (1.0.0) + cocoapods-trunk (1.1.2) + nap (>= 0.8, < 2.0) + netrc (= 0.7.8) + cocoapods-try (1.1.0) + colored (1.2) + escape (0.0.4) + fourflusher (2.0.1) + fuzzy_match (2.0.4) + gh_inspector (1.0.3) + i18n (0.8.1) + minitest (5.10.1) + molinillo (0.5.6) + nanaimo (0.2.3) + nap (1.1.0) + netrc (0.7.8) + rouge (1.11.1) + ruby-macho (0.2.6) + thread_safe (0.3.6) + tzinfo (1.2.2) + thread_safe (~> 0.1) + xcodeproj (1.4.2) + CFPropertyList (~> 2.3.3) + activesupport (>= 3) + claide (>= 1.0.1, < 2.0) + colored (~> 1.2) + nanaimo (~> 0.2.3) + xcpretty (0.2.4) + rouge (~> 1.8) + +PLATFORMS + ruby + +DEPENDENCIES + cocoapods (= 1.2.0) + xcpretty + +BUNDLED WITH + 1.13.7 diff --git a/Podfile b/Podfile index 4e94beb..338289f 100644 --- a/Podfile +++ b/Podfile @@ -2,7 +2,6 @@ platform :osx, '10.9' use_frameworks! def common_pods - pod 'Stencil', :git => 'https://github.com/kylef/Stencil', :inhibit_warnings => true pod 'SwiftGenKit', :path => '.' end diff --git a/Podfile.lock b/Podfile.lock index 3739296..a732518 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,30 +1,19 @@ PODS: - - PathKit (0.7.0) - - Stencil (0.7.1): - - PathKit (~> 0.7.0) - - SwiftGenKit (1.0.0): - - PathKit (~> 0.7.0) + - PathKit (0.8.0) + - SwiftGenKit (1.0.1): + - PathKit (~> 0.8.0) DEPENDENCIES: - - Stencil (from `https://github.com/kylef/Stencil`) - SwiftGenKit (from `.`) EXTERNAL SOURCES: - Stencil: - :git: https://github.com/kylef/Stencil SwiftGenKit: - :path: . - -CHECKOUT OPTIONS: - Stencil: - :commit: 99efba56e942270780a452e5dcdfa1a839839cf4 - :git: https://github.com/kylef/Stencil + :path: "." SPEC CHECKSUMS: - PathKit: f8260c3e41bf4d552f3603853e32a5b325a176d4 - Stencil: 4177c0cabcdc40dd9be9b7f701d710d0a121023a - SwiftGenKit: 26ad63367ff9ea8bcccc58944233e4959bb8ff5a + PathKit: dcab05d701474011aae0e40cf892298a831f63d6 + SwiftGenKit: 9b6f20360c33216663514b720016fa2d57cea478 -PODFILE CHECKSUM: 3047308663ec978cac608ea6da7bbe7c2ea1e7c3 +PODFILE CHECKSUM: c30ec8de82eda04587ffe005a6ce7372509b1340 COCOAPODS: 1.2.0 diff --git a/Pods/Local Podspecs/Stencil.podspec.json b/Pods/Local Podspecs/Stencil.podspec.json deleted file mode 100644 index fa52f69..0000000 --- a/Pods/Local Podspecs/Stencil.podspec.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "Stencil", - "version": "0.7.1", - "summary": "Stencil is a simple and powerful template language for Swift.", - "homepage": "https://stencil.fuller.li", - "license": { - "type": "BSD", - "file": "LICENSE" - }, - "authors": { - "Kyle Fuller": "kyle@fuller.li" - }, - "social_media_url": "https://twitter.com/kylefuller", - "source": { - "git": "https://github.com/kylef/Stencil.git", - "tag": "0.7.1" - }, - "source_files": [ - "Sources/*.swift" - ], - "platforms": { - "ios": "8.0", - "osx": "10.9", - "tvos": "9.0" - }, - "requires_arc": true, - "dependencies": { - "PathKit": [ - "~> 0.7.0" - ] - } -} diff --git a/Pods/Local Podspecs/SwiftGenKit.podspec.json b/Pods/Local Podspecs/SwiftGenKit.podspec.json index 36de166..925a259 100644 --- a/Pods/Local Podspecs/SwiftGenKit.podspec.json +++ b/Pods/Local Podspecs/SwiftGenKit.podspec.json @@ -1,6 +1,6 @@ { "name": "SwiftGenKit", - "version": "1.0.0", + "version": "1.0.1", "summary": "The SwiftGen framework responsible for parsing assets and turn them in a dictionary representation suitable for Stencil templates", "description": "This pod contains asset parsers for\n[SwiftGen](https://github.com/SwiftGen/SwiftGen), as well as\nmethods for converting the data into contexts for\n[Stencil](https://github.com/kylef/Stencil).", "homepage": "https://github.com/SwiftGen/SwiftGenKit", @@ -14,12 +14,12 @@ }, "source": { "git": "https://github.com/SwiftGen/SwiftGenKit.git", - "tag": "1.0.0" + "tag": "1.0.1" }, "source_files": "Sources/**/*.swift", "dependencies": { "PathKit": [ - "~> 0.7.0" + "~> 0.8.0" ] }, "frameworks": "Foundation" diff --git a/Pods/Manifest.lock b/Pods/Manifest.lock index 3739296..a732518 100644 --- a/Pods/Manifest.lock +++ b/Pods/Manifest.lock @@ -1,30 +1,19 @@ PODS: - - PathKit (0.7.0) - - Stencil (0.7.1): - - PathKit (~> 0.7.0) - - SwiftGenKit (1.0.0): - - PathKit (~> 0.7.0) + - PathKit (0.8.0) + - SwiftGenKit (1.0.1): + - PathKit (~> 0.8.0) DEPENDENCIES: - - Stencil (from `https://github.com/kylef/Stencil`) - SwiftGenKit (from `.`) EXTERNAL SOURCES: - Stencil: - :git: https://github.com/kylef/Stencil SwiftGenKit: - :path: . - -CHECKOUT OPTIONS: - Stencil: - :commit: 99efba56e942270780a452e5dcdfa1a839839cf4 - :git: https://github.com/kylef/Stencil + :path: "." SPEC CHECKSUMS: - PathKit: f8260c3e41bf4d552f3603853e32a5b325a176d4 - Stencil: 4177c0cabcdc40dd9be9b7f701d710d0a121023a - SwiftGenKit: 26ad63367ff9ea8bcccc58944233e4959bb8ff5a + PathKit: dcab05d701474011aae0e40cf892298a831f63d6 + SwiftGenKit: 9b6f20360c33216663514b720016fa2d57cea478 -PODFILE CHECKSUM: 3047308663ec978cac608ea6da7bbe7c2ea1e7c3 +PODFILE CHECKSUM: c30ec8de82eda04587ffe005a6ce7372509b1340 COCOAPODS: 1.2.0 diff --git a/Pods/PathKit/Sources/PathKit.swift b/Pods/PathKit/Sources/PathKit.swift index c9cf3e9..9f08ca5 100644 --- a/Pods/PathKit/Sources/PathKit.swift +++ b/Pods/PathKit/Sources/PathKit.swift @@ -22,6 +22,8 @@ public struct Path { internal var path: String internal static var fileManager = FileManager.default + + internal var fileSystemInfo: FileSystemInfo = DefaultFileSystemInfo() // MARK: Init @@ -77,6 +79,19 @@ extension Path : CustomStringConvertible { } +// MARK: Conversion + +extension Path { + public var string: String { + return self.path + } + + public var url: URL { + return URL(fileURLWithPath: path) + } +} + + // MARK: Hashable extension Path : Hashable { @@ -114,6 +129,11 @@ extension Path { return normalize() } + let expandedPath = Path(NSString(string: self.path).expandingTildeInPath) + if expandedPath.isAbsolute { + return expandedPath.normalize() + } + return (Path.current + self).normalize() } @@ -133,12 +153,19 @@ extension Path { /// representation. /// public func abbreviate() -> Path { -#if os(Linux) - // TODO: actually de-normalize the path - return self -#else - return Path(NSString(string: self.path).abbreviatingWithTildeInPath) -#endif + let rangeOptions: String.CompareOptions = fileSystemInfo.isFSCaseSensitiveAt(path: self) ? + [.anchored] : [.anchored, .caseInsensitive] + let home = Path.home.string + guard let homeRange = self.path.range(of: home, options: rangeOptions) else { return self } + let withoutHome = Path(self.path.replacingCharacters(in: homeRange, with: "")) + + if withoutHome.path.isEmpty || withoutHome.path == Path.separator { + return Path("~") + } else if withoutHome.isAbsolute { + return Path("~" + withoutHome.path) + } else { + return Path("~") + withoutHome.path + } } /// Returns the path of the item pointed to by a symbolic link. @@ -156,6 +183,30 @@ extension Path { } } +internal protocol FileSystemInfo { + func isFSCaseSensitiveAt(path: Path) -> Bool +} + +internal struct DefaultFileSystemInfo: FileSystemInfo { + func isFSCaseSensitiveAt(path: Path) -> Bool { + #if os(Linux) + // URL resourceValues(forKeys:) is not supported on non-darwin platforms... + // But we can (fairly?) safely assume for now that the Linux FS is case sensitive. + // TODO: refactor when/if resourceValues is available, or look into using something + // like stat or pathconf to determine if the mountpoint is case sensitive. + return true + #else + var isCaseSensitive = false + // Calling resourceValues will fail if the path does not exist on the filesystem, which + // makes sense, but means we can only guarantee the return value is correct if the + // path actually exists. + if let resourceValues = try? path.url.resourceValues(forKeys: [.volumeSupportsCaseSensitiveNamesKey]) { + isCaseSensitive = resourceValues.volumeSupportsCaseSensitiveNames ?? isCaseSensitive + } + return isCaseSensitive + #endif + } +} // MARK: Path Components @@ -452,7 +503,7 @@ extension Path { /// - Returns: the contents of the file at the specified path. /// public func read() throws -> Data { - return try Data(contentsOf: URL(fileURLWithPath: path), options: NSData.ReadingOptions(rawValue: 0)) + return try Data(contentsOf: self.url, options: NSData.ReadingOptions(rawValue: 0)) } /// Reads the file contents and encoded its bytes to string applying the given encoding. @@ -474,7 +525,7 @@ extension Path { /// - Parameter data: the contents to write to file. /// public func write(_ data: Data) throws { - try data.write(to: URL(fileURLWithPath: normalize().path), options: .atomic) + try data.write(to: normalize().url, options: .atomic) } /// Reads the file. @@ -569,29 +620,57 @@ extension Path { // MARK: SequenceType extension Path : Sequence { + public struct DirectoryEnumerationOptions : OptionSet { + public let rawValue: UInt + public init(rawValue: UInt) { + self.rawValue = rawValue + } + + public static var skipsSubdirectoryDescendants = DirectoryEnumerationOptions(rawValue: FileManager.DirectoryEnumerationOptions.skipsSubdirectoryDescendants.rawValue) + public static var skipsPackageDescendants = DirectoryEnumerationOptions(rawValue: FileManager.DirectoryEnumerationOptions.skipsPackageDescendants.rawValue) + public static var skipsHiddenFiles = DirectoryEnumerationOptions(rawValue: FileManager.DirectoryEnumerationOptions.skipsHiddenFiles.rawValue) + } + + /// Represents a path sequence with specific enumeration options + public struct PathSequence : Sequence { + private var path: Path + private var options: DirectoryEnumerationOptions + init(path: Path, options: DirectoryEnumerationOptions) { + self.path = path + self.options = options + } + + public func makeIterator() -> DirectoryEnumerator { + return DirectoryEnumerator(path: path, options: options) + } + } + /// Enumerates the contents of a directory, returning the paths of all files and directories /// contained within that directory. These paths are relative to the directory. public struct DirectoryEnumerator : IteratorProtocol { public typealias Element = Path let path: Path - let directoryEnumerator: FileManager.DirectoryEnumerator + let directoryEnumerator: FileManager.DirectoryEnumerator? - init(path: Path) { + init(path: Path, options mask: DirectoryEnumerationOptions = []) { + let options = FileManager.DirectoryEnumerationOptions(rawValue: mask.rawValue) self.path = path - self.directoryEnumerator = Path.fileManager.enumerator(atPath: path.path)! + self.directoryEnumerator = Path.fileManager.enumerator(at: path.url, includingPropertiesForKeys: nil, options: options) } public func next() -> Path? { - if let next = directoryEnumerator.nextObject() as! String? { - return path + next + let next = directoryEnumerator?.nextObject() + + if let next = next as? URL { + return Path(next.path) } return nil } /// Skip recursion into the most recently obtained subdirectory. public func skipDescendants() { - directoryEnumerator.skipDescendants() + directoryEnumerator?.skipDescendants() } } @@ -603,6 +682,17 @@ extension Path : Sequence { public func makeIterator() -> DirectoryEnumerator { return DirectoryEnumerator(path: self) } + + /// Perform a deep enumeration of a directory. + /// + /// - Parameter options: FileManager directory enumerator options. + /// + /// - Returns: a path sequence that can be used to perform a deep enumeration of the + /// directory. + /// + public func iterateChildren(options: DirectoryEnumerationOptions = []) -> PathSequence { + return PathSequence(path: self, options: options) + } } diff --git a/Pods/Pods.xcodeproj/project.pbxproj b/Pods/Pods.xcodeproj/project.pbxproj index 4ba56a3..35e4b72 100644 --- a/Pods/Pods.xcodeproj/project.pbxproj +++ b/Pods/Pods.xcodeproj/project.pbxproj @@ -7,169 +7,107 @@ objects = { /* Begin PBXBuildFile section */ - 040B29D0120B5B450B98FC67FEC958B8 /* PathKit-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CA49A25561E541E61395E8C64512F22 /* PathKit-dummy.m */; }; - 081456D04BE5EA7E78274FCF240AB051 /* Context.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8923816ECEE63BE56AD67F2A147EF787 /* Context.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; + 033700BD14168E5C5614FDB4DF37B748 /* StringsFileParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35F5C044723C7653D18C10BF6AAEF8D4 /* StringsFileParser.swift */; }; + 040B29D0120B5B450B98FC67FEC958B8 /* PathKit-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DA196CD2A6D1E393506CF19AB5B6C09 /* PathKit-dummy.m */; }; 089D6407EB1EEFC90043E9E54AD49B20 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5217ABF3BDB5EC6A276AF9B64AA38C5 /* Cocoa.framework */; }; - 09D43636F5561DE23A18E8C780273C24 /* Environment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 206DA29D6C35E14C93D2BF773A66C54C /* Environment.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 0CD6287216801231D72B9AA96F4BFB9E /* Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27AB13C581DBF4D4B41876C69872B183 /* Extension.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 11B5C106427B078EBD345284A81E5AA1 /* Expression.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12438B80ED47AD60857542BE0113ED7 /* Expression.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 185AE8119E345E2A96AEDFD06B36F1FE /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5217ABF3BDB5EC6A276AF9B64AA38C5 /* Cocoa.framework */; }; - 29B7DA7D7F154DFA0D1664A181FFBAAD /* Pods-Tests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 52E08CA96B2F20724148FF5361AD7206 /* Pods-Tests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 2BDD41BFF9EE6BDAA81D4166556CFE2F /* Filters.swift in Sources */ = {isa = PBXBuildFile; fileRef = C74DCC10F6CC9FB70BEF27A2183A5B4F /* Filters.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 3721555E579511D34B8348722B9F668C /* StoryboardParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3AE389C53E9B01E985C9E18B23C4655 /* StoryboardParser.swift */; }; - 3CC18F390B4FA48178197CE86119DDFF /* PathKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA757A33072EF52B31D4378ABCC8A05F /* PathKit.framework */; }; - 3CDD0C92ED7763897E0AB6627A522BBA /* StringsContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60889E57CE4B4802D50272BE5861F810 /* StringsContext.swift */; }; - 42BFDBC8F5D1F11BA9E29A5C60AA8078 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E3462B237C0B07B0193729BBED188874 /* Foundation.framework */; }; - 5245ABB6A66FF1DEC56583EF468DD7AA /* PathKit-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = C62389B5756FDBA46714335EE5B2079D /* PathKit-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5A30DA63271C175354B3014B13119C3E /* NowTag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D3CBAF672FD3CA25D7EE1A8E93A6F07 /* NowTag.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 60938CB9A91153FA1019355D815D35BE /* ColorsFileParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF964CF5CB6052CB65EB873ADC4C5908 /* ColorsFileParser.swift */; }; - 6272EE69D3F5DE1DF030E2B979A19909 /* PathKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B85A6D36EC20031BC5814F8D8D514E8 /* PathKit.swift */; }; - 64B15E6CCEAA44E84BD4642267BE7816 /* FilterTag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D9976A9FB02F6316003996E10007AEE /* FilterTag.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 682503B7881609AF762296196FEF9DF6 /* ForTag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8CCB7B571DD30214319D05B2A2D01268 /* ForTag.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 6C2CBA8AE73F20DAAA75B5CAE0EB0040 /* FontsFileParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D099D9232A07F0FE8E90ADF80821C6B /* FontsFileParser.swift */; }; - 702DBD4A1BC401FF162E37C6C885A364 /* StoryboardsContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61B5D27F549BC27FA003F01438250995 /* StoryboardsContext.swift */; }; - 7DC590E71685C181434AA33E60DA6A37 /* FontsContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6DD2362583ECBF6E1F27B30077A63AB4 /* FontsContext.swift */; }; - 7FD86DB6F6783CE0EEA15BA171DD737C /* Loader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2802FBB7965EA4284282522D369C6ECC /* Loader.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 836052594B4AB2E32D262FE7E89C605A /* Stencil-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 3B1C96CDE10E0238E81B06BD4DF23DAE /* Stencil-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8BC00CE11BF9DDA1BAB13112DD16EAE2 /* ColorsContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54477499963F9BB5465900CFB5D3EABD /* ColorsContext.swift */; }; - 90FEE0078E6B023282A9655192C81B1B /* Command.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A47779BD13411D93D59545E2E320338 /* Command.swift */; }; - 979F7508C5D35ADC3784CF9E24AAFA69 /* Inheritence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0F9B2CC600F3395D308525FD3F495190 /* Inheritence.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 97E3B833461AFFE8E3D224C3FA46C170 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5217ABF3BDB5EC6A276AF9B64AA38C5 /* Cocoa.framework */; }; - 9EC02625B80C5D3757E5869DE2622BFD /* Template.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69F59D1438D9D791C86016D62F2078B9 /* Template.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - AA23F6047119FF0F2705FA47227546BF /* Node.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DFDC1D3EADE4703881DF92C53FFF464 /* Node.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - C8EF04CEDE9125827B761624E39215E9 /* Stencil-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 012306C832DD6A1EBFABB3AFFE57291E /* Stencil-dummy.m */; }; - CC59909F89DA43245F7F134E8C52C9DA /* StringsFileParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35F5C044723C7653D18C10BF6AAEF8D4 /* StringsFileParser.swift */; }; - D6AB9404709C66FE2A03AE9FDEF7E632 /* AssetsCatalogParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 10977DE0E866EF9C79EEC597CBA9E4C3 /* AssetsCatalogParser.swift */; }; - DB7193B5E8577272670F23076F239B4E /* SwiftGenKit-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = EC112BC570440F79F5D325EE264243AD /* SwiftGenKit-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DC8321929E123B1B672B1C450B1B0BB1 /* Tokenizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FFA7DA1538F3CB30DA2B5074B573E52 /* Tokenizer.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - E0EE90E9C63F305F09CB1814EFE2810D /* Variable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17E001094F65D072A6D5E4A0C7F419BD /* Variable.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - E208DC9145505090458D6DD7F5C5D8EC /* Pods-Tests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = C0ABA9994C05CE2F400945671B7038BA /* Pods-Tests-dummy.m */; }; - E2D5C4E12493B5E2850AC49DC6E663E4 /* Lexer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31A007C042C580A003C9B6DB5AD1B534 /* Lexer.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - E8C32CCB4E949A48FED75450D03CFF2B /* Errors.swift in Sources */ = {isa = PBXBuildFile; fileRef = B40D2EA1B76284D2E987C4FD200B228E /* Errors.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - EBCAAE5E0862E5DABF13F12D312CEFFD /* AssetsCatalogContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = C32A299B32C23CA3C4EE49B96459105C /* AssetsCatalogContext.swift */; }; - F27D04C2DE9A578F3068D6D809A9C9A7 /* Parser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2155A4AD28DF68375EC10C46F7EDC8AF /* Parser.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - F45A92A317E56FD1379219CB12451670 /* Include.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5E20637D178539A5F5705320E6AAD3F /* Include.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - F6850EBC80FB59EAA9E825AD74D0C0B8 /* PathKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA757A33072EF52B31D4378ABCC8A05F /* PathKit.framework */; }; - F98677D67537DBF01FD7C992936DDF49 /* SwiftGenKit-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E95D3A9D0AA426730ABADF589227018 /* SwiftGenKit-dummy.m */; }; - FB460A53009DF8CFDF5FB1CF1D1E1EBF /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5217ABF3BDB5EC6A276AF9B64AA38C5 /* Cocoa.framework */; }; - FEE49DDFF96FA7B5EF15E324D0710B79 /* IfTag.swift in Sources */ = {isa = PBXBuildFile; fileRef = D887BD539929925B9535E5136F861F20 /* IfTag.swift */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; + 0BE4A6E9E72DEA5E50CCCD991721D814 /* ColorsContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54477499963F9BB5465900CFB5D3EABD /* ColorsContext.swift */; }; + 1DBE65BBA7CC2D0C93544B240F73D17E /* StoryboardsContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61B5D27F549BC27FA003F01438250995 /* StoryboardsContext.swift */; }; + 32828B158518F56B137CC015B0ADBFDD /* FontsFileParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D099D9232A07F0FE8E90ADF80821C6B /* FontsFileParser.swift */; }; + 45E65D38B12A5C4F8DE2E3D45D94B856 /* Pods-Tests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = C0ABA9994C05CE2F400945671B7038BA /* Pods-Tests-dummy.m */; }; + 49BCFF59F33C503487A6416F323BD9C7 /* ColorsFileParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF964CF5CB6052CB65EB873ADC4C5908 /* ColorsFileParser.swift */; }; + 5245ABB6A66FF1DEC56583EF468DD7AA /* PathKit-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B6B294B11B511ECDAC699FAD09EFACF /* PathKit-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 52CBC3F8EBEB51C1379F805BFF7226AD /* Command.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A47779BD13411D93D59545E2E320338 /* Command.swift */; }; + 52F98F41ED713D8FCD42A8987488D5E4 /* SwiftGenKit-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = EC112BC570440F79F5D325EE264243AD /* SwiftGenKit-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5E5FC679DE8A404241F31D47EFFDE7D6 /* SwiftGenKit-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E95D3A9D0AA426730ABADF589227018 /* SwiftGenKit-dummy.m */; }; + 61E711CF6EDDC6B9AFE79D2FF56ABD71 /* FontsContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6DD2362583ECBF6E1F27B30077A63AB4 /* FontsContext.swift */; }; + 6272EE69D3F5DE1DF030E2B979A19909 /* PathKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 394708266BE40343609A83EF49CA09CB /* PathKit.swift */; }; + 725AE61C5F77217CC6DE6A6212BC8545 /* AssetsCatalogContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = C32A299B32C23CA3C4EE49B96459105C /* AssetsCatalogContext.swift */; }; + 84349FC390D9D0D9836345C172D4CB77 /* StringsContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60889E57CE4B4802D50272BE5861F810 /* StringsContext.swift */; }; + A03C593A5675875DD832EB79EA5DC346 /* StoryboardParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3AE389C53E9B01E985C9E18B23C4655 /* StoryboardParser.swift */; }; + A182631AA7A124BA5AE0A35DF6F9CA2A /* PathKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA757A33072EF52B31D4378ABCC8A05F /* PathKit.framework */; }; + B421707C84526F27BFDC8D624A640478 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5217ABF3BDB5EC6A276AF9B64AA38C5 /* Cocoa.framework */; }; + C601DE32381083B10AE5A0C77A78AC89 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5217ABF3BDB5EC6A276AF9B64AA38C5 /* Cocoa.framework */; }; + C7F7C330DADACA0003C83B5638C61049 /* Pods-Tests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 52E08CA96B2F20724148FF5361AD7206 /* Pods-Tests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + E525BFF8CF5A5B6BC19AE9E32F292654 /* AssetsCatalogParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 10977DE0E866EF9C79EEC597CBA9E4C3 /* AssetsCatalogParser.swift */; }; + F18E5A0804C120D24533995DB1E61F64 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E3462B237C0B07B0193729BBED188874 /* Foundation.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 43E95A50B34E0C6A694B97073053BD99 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 272489B87F3C869B3BDD73E83662E4E4; - remoteInfo = Stencil; - }; - 4913E152C48483A6E797A913793ED6EF /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = CAD38709AA14638482603AE3702E40C7; - remoteInfo = SwiftGenKit; - }; - BBAAAB8271E8CC200B0F934CCF079048 /* PBXContainerItemProxy */ = { + 2EC96566BFCB9356ED32B9A05B7186AF /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; proxyType = 1; remoteGlobalIDString = BBB46569A79C52426939AF96DA290CF9; remoteInfo = PathKit; }; - BCA52025E1B185D5D1DCCE085CB2D108 /* PBXContainerItemProxy */ = { + 310556C1AC23FA9B012D1E1620F2537B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; proxyType = 1; remoteGlobalIDString = BBB46569A79C52426939AF96DA290CF9; remoteInfo = PathKit; }; - FA2FA7AB985ACB1A21BD37DAB3D741F3 /* PBXContainerItemProxy */ = { + 7CD6504691C5DDD496360AC4BD0B6A7F /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; proxyType = 1; - remoteGlobalIDString = BBB46569A79C52426939AF96DA290CF9; - remoteInfo = PathKit; + remoteGlobalIDString = 8FFA80ED512C8E7FD5452CF15F21EDB8; + remoteInfo = SwiftGenKit; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 012306C832DD6A1EBFABB3AFFE57291E /* Stencil-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Stencil-dummy.m"; sourceTree = ""; }; 06E5680F77898FA7B456DBF80297AB23 /* Pods-Tests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-Tests-frameworks.sh"; sourceTree = ""; }; - 0D3CBAF672FD3CA25D7EE1A8E93A6F07 /* NowTag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NowTag.swift; path = Sources/NowTag.swift; sourceTree = ""; }; - 0DFDC1D3EADE4703881DF92C53FFF464 /* Node.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Node.swift; path = Sources/Node.swift; sourceTree = ""; }; - 0F9B2CC600F3395D308525FD3F495190 /* Inheritence.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Inheritence.swift; path = Sources/Inheritence.swift; sourceTree = ""; }; 10977DE0E866EF9C79EEC597CBA9E4C3 /* AssetsCatalogParser.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AssetsCatalogParser.swift; sourceTree = ""; }; 1143DC189DEAEC4A1278249254968FB1 /* Pods-Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Tests.debug.xcconfig"; sourceTree = ""; }; - 17E001094F65D072A6D5E4A0C7F419BD /* Variable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Variable.swift; path = Sources/Variable.swift; sourceTree = ""; }; - 206DA29D6C35E14C93D2BF773A66C54C /* Environment.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Environment.swift; path = Sources/Environment.swift; sourceTree = ""; }; - 2155A4AD28DF68375EC10C46F7EDC8AF /* Parser.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Parser.swift; path = Sources/Parser.swift; sourceTree = ""; }; - 265F975B73073835FB84065AFE716801 /* SwiftGenKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = SwiftGenKit.framework; path = SwiftGenKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 279273F061523D66B55D27131FEB6148 /* Stencil.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Stencil.framework; path = Stencil.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 27AB13C581DBF4D4B41876C69872B183 /* Extension.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Extension.swift; path = Sources/Extension.swift; sourceTree = ""; }; - 2802FBB7965EA4284282522D369C6ECC /* Loader.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Loader.swift; path = Sources/Loader.swift; sourceTree = ""; }; + 1CF8AF2446D00EFF6BC384F0188571B7 /* PathKit-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PathKit-prefix.pch"; sourceTree = ""; }; + 2B6B294B11B511ECDAC699FAD09EFACF /* PathKit-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PathKit-umbrella.h"; sourceTree = ""; }; 2C8AAD97E22D7F6B08B73B0AE02BFA6D /* Pods-Tests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-Tests-resources.sh"; sourceTree = ""; }; 2E6EDE0590FA1A030C93F83C2EEFC65C /* Pods-Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Tests.release.xcconfig"; sourceTree = ""; }; - 31A007C042C580A003C9B6DB5AD1B534 /* Lexer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Lexer.swift; path = Sources/Lexer.swift; sourceTree = ""; }; 35F5C044723C7653D18C10BF6AAEF8D4 /* StringsFileParser.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StringsFileParser.swift; sourceTree = ""; }; - 3B1C96CDE10E0238E81B06BD4DF23DAE /* Stencil-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Stencil-umbrella.h"; sourceTree = ""; }; - 3D9976A9FB02F6316003996E10007AEE /* FilterTag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = FilterTag.swift; path = Sources/FilterTag.swift; sourceTree = ""; }; + 394708266BE40343609A83EF49CA09CB /* PathKit.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PathKit.swift; path = Sources/PathKit.swift; sourceTree = ""; }; + 4072D484B16EEBD81EF9991C8ED66ADD /* PathKit.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = PathKit.modulemap; sourceTree = ""; }; 4073060E93266F46D895562DC8E1B5BB /* SwiftGenKit-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SwiftGenKit-prefix.pch"; sourceTree = ""; }; 4309AA7478DD6B254C478AE5335748BA /* Pods-Tests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-Tests-acknowledgements.plist"; sourceTree = ""; }; 4F35C03EE539651D8168B79F18A1DF5B /* Pods-Tests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-Tests.modulemap"; sourceTree = ""; }; 52E08CA96B2F20724148FF5361AD7206 /* Pods-Tests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-Tests-umbrella.h"; sourceTree = ""; }; 54477499963F9BB5465900CFB5D3EABD /* ColorsContext.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ColorsContext.swift; sourceTree = ""; }; - 5B85A6D36EC20031BC5814F8D8D514E8 /* PathKit.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PathKit.swift; path = Sources/PathKit.swift; sourceTree = ""; }; + 57BEF236ED0935C9190818809B5658A0 /* PathKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = PathKit.framework; path = PathKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 5E95D3A9D0AA426730ABADF589227018 /* SwiftGenKit-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "SwiftGenKit-dummy.m"; sourceTree = ""; }; 60889E57CE4B4802D50272BE5861F810 /* StringsContext.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StringsContext.swift; sourceTree = ""; }; 61B5D27F549BC27FA003F01438250995 /* StoryboardsContext.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StoryboardsContext.swift; sourceTree = ""; }; - 650CAC0D1F80EFE1AEB678D05530141B /* PathKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = PathKit.framework; path = PathKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 6581541EB16C55BF3C9668C7AB304D9C /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 69F59D1438D9D791C86016D62F2078B9 /* Template.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Template.swift; path = Sources/Template.swift; sourceTree = ""; }; 6D099D9232A07F0FE8E90ADF80821C6B /* FontsFileParser.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FontsFileParser.swift; sourceTree = ""; }; 6DD2362583ECBF6E1F27B30077A63AB4 /* FontsContext.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FontsContext.swift; sourceTree = ""; }; 6E3DE9DADD254D64C598089530A5932B /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 749318FE61E9EC318ED19250766267E2 /* Stencil-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Stencil-prefix.pch"; sourceTree = ""; }; 7A47779BD13411D93D59545E2E320338 /* Command.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Command.swift; sourceTree = ""; }; 7D849BEE3993512EB3DC1DB84A51D5FB /* SwiftGenKit.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = SwiftGenKit.xcconfig; sourceTree = ""; }; - 8923816ECEE63BE56AD67F2A147EF787 /* Context.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Context.swift; path = Sources/Context.swift; sourceTree = ""; }; - 8CA49A25561E541E61395E8C64512F22 /* PathKit-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PathKit-dummy.m"; sourceTree = ""; }; - 8CCB7B571DD30214319D05B2A2D01268 /* ForTag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ForTag.swift; path = Sources/ForTag.swift; sourceTree = ""; }; - 8FFA7DA1538F3CB30DA2B5074B573E52 /* Tokenizer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Tokenizer.swift; path = Sources/Tokenizer.swift; sourceTree = ""; }; - 919EAEDB009B1AA70C305AC91847AC41 /* PathKit.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = PathKit.modulemap; sourceTree = ""; }; - 93A3BA06E90B797B9126411EF449E61E /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 8DA196CD2A6D1E393506CF19AB5B6C09 /* PathKit-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PathKit-dummy.m"; sourceTree = ""; }; 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - A5E20637D178539A5F5705320E6AAD3F /* Include.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Include.swift; path = Sources/Include.swift; sourceTree = ""; }; AF964CF5CB6052CB65EB873ADC4C5908 /* ColorsFileParser.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ColorsFileParser.swift; sourceTree = ""; }; - B0A2858DB038304C5239C4738D8E3643 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - B40D2EA1B76284D2E987C4FD200B228E /* Errors.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Errors.swift; path = Sources/Errors.swift; sourceTree = ""; }; - B51EE1F2CACBC9829B2FEC2985DEA9D2 /* Stencil.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Stencil.xcconfig; sourceTree = ""; }; + B6D0D3405A260E50A632D90481AD939E /* Pods_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_Tests.framework; path = "Pods-Tests.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + BB116B04D23E71A2DEB352995B9A4043 /* PathKit.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PathKit.xcconfig; sourceTree = ""; }; BFE531A4BA3F8D5F7B6C9BD6D217DA29 /* Pods-Tests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-Tests-acknowledgements.markdown"; sourceTree = ""; }; C0ABA9994C05CE2F400945671B7038BA /* Pods-Tests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-Tests-dummy.m"; sourceTree = ""; }; - C1E8657D8A2E60CA5179FDE94F283B2A /* PathKit.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PathKit.xcconfig; sourceTree = ""; }; C32A299B32C23CA3C4EE49B96459105C /* AssetsCatalogContext.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AssetsCatalogContext.swift; sourceTree = ""; }; - C62389B5756FDBA46714335EE5B2079D /* PathKit-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PathKit-umbrella.h"; sourceTree = ""; }; - C74DCC10F6CC9FB70BEF27A2183A5B4F /* Filters.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Filters.swift; path = Sources/Filters.swift; sourceTree = ""; }; CA757A33072EF52B31D4378ABCC8A05F /* PathKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PathKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - D12438B80ED47AD60857542BE0113ED7 /* Expression.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Expression.swift; path = Sources/Expression.swift; sourceTree = ""; }; D3AE389C53E9B01E985C9E18B23C4655 /* StoryboardParser.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StoryboardParser.swift; sourceTree = ""; }; - D5846CC8D36C9B97B51ACC82399D6A12 /* PathKit-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PathKit-prefix.pch"; sourceTree = ""; }; - D6C2D28B3980163C3F38852C8437E5C2 /* Stencil.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = Stencil.modulemap; sourceTree = ""; }; - D887BD539929925B9535E5136F861F20 /* IfTag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = IfTag.swift; path = Sources/IfTag.swift; sourceTree = ""; }; + D9F3535A5FE4365AC94D730F3917F739 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; E3462B237C0B07B0193729BBED188874 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; E54EE79893AE60BDD4725EE82D2CD3CD /* SwiftGenKit.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = SwiftGenKit.modulemap; sourceTree = ""; }; EC112BC570440F79F5D325EE264243AD /* SwiftGenKit-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SwiftGenKit-umbrella.h"; sourceTree = ""; }; F5217ABF3BDB5EC6A276AF9B64AA38C5 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/Cocoa.framework; sourceTree = DEVELOPER_DIR; }; - FC50E6B59E54BE94B0C05E2FCD93D230 /* Pods_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_Tests.framework; path = "Pods-Tests.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + FBC70719DFB58EAECC4DCBA06C2586DF /* SwiftGenKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = SwiftGenKit.framework; path = SwiftGenKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 2AF5E2CEAA396C88B6A51FF771AFFCA0 /* Frameworks */ = { + 1AAAB27F6AEC527FF4309EC04B5BF3FB /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - FB460A53009DF8CFDF5FB1CF1D1E1EBF /* Cocoa.framework in Frameworks */, - F6850EBC80FB59EAA9E825AD74D0C0B8 /* PathKit.framework in Frameworks */, + C601DE32381083B10AE5A0C77A78AC89 /* Cocoa.framework in Frameworks */, + F18E5A0804C120D24533995DB1E61F64 /* Foundation.framework in Frameworks */, + A182631AA7A124BA5AE0A35DF6F9CA2A /* PathKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -181,21 +119,11 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 991E9DDE7DFEE09E85D54F19C522679D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 97E3B833461AFFE8E3D224C3FA46C170 /* Cocoa.framework in Frameworks */, - 42BFDBC8F5D1F11BA9E29A5C60AA8078 /* Foundation.framework in Frameworks */, - 3CC18F390B4FA48178197CE86119DDFF /* PathKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - B15C62E3EE211DE142105019A35DD37B /* Frameworks */ = { + 55AA21EE565967A545808BFE740FB56A /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 185AE8119E345E2A96AEDFD06B36F1FE /* Cocoa.framework in Frameworks */, + B421707C84526F27BFDC8D624A640478 /* Cocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -210,6 +138,20 @@ name = "Targets Support Files"; sourceTree = ""; }; + 33D60351AC18B2DA603A389F697B9513 /* Support Files */ = { + isa = PBXGroup; + children = ( + D9F3535A5FE4365AC94D730F3917F739 /* Info.plist */, + 4072D484B16EEBD81EF9991C8ED66ADD /* PathKit.modulemap */, + BB116B04D23E71A2DEB352995B9A4043 /* PathKit.xcconfig */, + 8DA196CD2A6D1E393506CF19AB5B6C09 /* PathKit-dummy.m */, + 1CF8AF2446D00EFF6BC384F0188571B7 /* PathKit-prefix.pch */, + 2B6B294B11B511ECDAC699FAD09EFACF /* PathKit-umbrella.h */, + ); + name = "Support Files"; + path = "../Target Support Files/PathKit"; + sourceTree = ""; + }; 3CA136037933FE078CE6099E3BDC7784 /* Parsers */ = { isa = PBXGroup; children = ( @@ -241,20 +183,6 @@ path = "Target Support Files/Pods-Tests"; sourceTree = ""; }; - 472C634E13CB5E53C65AA1985F35C13D /* Support Files */ = { - isa = PBXGroup; - children = ( - B0A2858DB038304C5239C4738D8E3643 /* Info.plist */, - D6C2D28B3980163C3F38852C8437E5C2 /* Stencil.modulemap */, - B51EE1F2CACBC9829B2FEC2985DEA9D2 /* Stencil.xcconfig */, - 012306C832DD6A1EBFABB3AFFE57291E /* Stencil-dummy.m */, - 749318FE61E9EC318ED19250766267E2 /* Stencil-prefix.pch */, - 3B1C96CDE10E0238E81B06BD4DF23DAE /* Stencil-umbrella.h */, - ); - name = "Support Files"; - path = "../Target Support Files/Stencil"; - sourceTree = ""; - }; 4979DD1D7D3B4A12CB870FBE64355D7C /* Support Files */ = { isa = PBXGroup; children = ( @@ -279,27 +207,22 @@ path = ..; sourceTree = ""; }; - 6724D708D9DFD7974FF62943F623BFBB /* Pods */ = { + 696D9BB769F03CC42897D46ACE48D690 /* Pods */ = { isa = PBXGroup; children = ( - B9F06EE06B0E06ED5586D027457DE2DA /* PathKit */, - B8785D26B65358E2BC40AF9F996EC4B3 /* Stencil */, + A87E80C71F4BBFD7BB1AB87FA7D2BFA1 /* PathKit */, ); name = Pods; sourceTree = ""; }; - 693A6FD601295700FF3115312779D86A /* Support Files */ = { + 7CF3977A8D8061C1B529E0C462F03CF5 /* Products */ = { isa = PBXGroup; children = ( - 93A3BA06E90B797B9126411EF449E61E /* Info.plist */, - 919EAEDB009B1AA70C305AC91847AC41 /* PathKit.modulemap */, - C1E8657D8A2E60CA5179FDE94F283B2A /* PathKit.xcconfig */, - 8CA49A25561E541E61395E8C64512F22 /* PathKit-dummy.m */, - D5846CC8D36C9B97B51ACC82399D6A12 /* PathKit-prefix.pch */, - C62389B5756FDBA46714335EE5B2079D /* PathKit-umbrella.h */, + 57BEF236ED0935C9190818809B5658A0 /* PathKit.framework */, + B6D0D3405A260E50A632D90481AD939E /* Pods_Tests.framework */, + FBC70719DFB58EAECC4DCBA06C2586DF /* SwiftGenKit.framework */, ); - name = "Support Files"; - path = "../Target Support Files/PathKit"; + name = Products; sourceTree = ""; }; 7DB346D0F39D3F0E887471402A8071AB = { @@ -308,8 +231,8 @@ 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, DCB3B37466882D14AE1F9B20055DF4C3 /* Development Pods */, 8FFDBAF3675CBB79B3E2A5703E16F958 /* Frameworks */, - 6724D708D9DFD7974FF62943F623BFBB /* Pods */, - AD44D9685C1729342C47B82F98F06B95 /* Products */, + 696D9BB769F03CC42897D46ACE48D690 /* Pods */, + 7CF3977A8D8061C1B529E0C462F03CF5 /* Products */, 000722C3134BAC39CFC2600254B1E03E /* Targets Support Files */, ); sourceTree = ""; @@ -323,50 +246,11 @@ name = Frameworks; sourceTree = ""; }; - AD44D9685C1729342C47B82F98F06B95 /* Products */ = { + A87E80C71F4BBFD7BB1AB87FA7D2BFA1 /* PathKit */ = { isa = PBXGroup; children = ( - 650CAC0D1F80EFE1AEB678D05530141B /* PathKit.framework */, - FC50E6B59E54BE94B0C05E2FCD93D230 /* Pods_Tests.framework */, - 279273F061523D66B55D27131FEB6148 /* Stencil.framework */, - 265F975B73073835FB84065AFE716801 /* SwiftGenKit.framework */, - ); - name = Products; - sourceTree = ""; - }; - B8785D26B65358E2BC40AF9F996EC4B3 /* Stencil */ = { - isa = PBXGroup; - children = ( - 8923816ECEE63BE56AD67F2A147EF787 /* Context.swift */, - 206DA29D6C35E14C93D2BF773A66C54C /* Environment.swift */, - B40D2EA1B76284D2E987C4FD200B228E /* Errors.swift */, - D12438B80ED47AD60857542BE0113ED7 /* Expression.swift */, - 27AB13C581DBF4D4B41876C69872B183 /* Extension.swift */, - C74DCC10F6CC9FB70BEF27A2183A5B4F /* Filters.swift */, - 3D9976A9FB02F6316003996E10007AEE /* FilterTag.swift */, - 8CCB7B571DD30214319D05B2A2D01268 /* ForTag.swift */, - D887BD539929925B9535E5136F861F20 /* IfTag.swift */, - A5E20637D178539A5F5705320E6AAD3F /* Include.swift */, - 0F9B2CC600F3395D308525FD3F495190 /* Inheritence.swift */, - 31A007C042C580A003C9B6DB5AD1B534 /* Lexer.swift */, - 2802FBB7965EA4284282522D369C6ECC /* Loader.swift */, - 0DFDC1D3EADE4703881DF92C53FFF464 /* Node.swift */, - 0D3CBAF672FD3CA25D7EE1A8E93A6F07 /* NowTag.swift */, - 2155A4AD28DF68375EC10C46F7EDC8AF /* Parser.swift */, - 69F59D1438D9D791C86016D62F2078B9 /* Template.swift */, - 8FFA7DA1538F3CB30DA2B5074B573E52 /* Tokenizer.swift */, - 17E001094F65D072A6D5E4A0C7F419BD /* Variable.swift */, - 472C634E13CB5E53C65AA1985F35C13D /* Support Files */, - ); - name = Stencil; - path = Stencil; - sourceTree = ""; - }; - B9F06EE06B0E06ED5586D027457DE2DA /* PathKit */ = { - isa = PBXGroup; - children = ( - 5B85A6D36EC20031BC5814F8D8D514E8 /* PathKit.swift */, - 693A6FD601295700FF3115312779D86A /* Support Files */, + 394708266BE40343609A83EF49CA09CB /* PathKit.swift */, + 33D60351AC18B2DA603A389F697B9513 /* Support Files */, ); name = PathKit; path = PathKit; @@ -425,14 +309,6 @@ /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ - 229F72D213FFF1BC15B307BEC91561E9 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - DB7193B5E8577272670F23076F239B4E /* SwiftGenKit-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 3695CC57AAB057789DAA4445DC5DF883 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -441,61 +317,60 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 45A533AA7924A88D87AE816354B91431 /* Headers */ = { + BE11556B1D57507D13CE94413711333E /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 836052594B4AB2E32D262FE7E89C605A /* Stencil-umbrella.h in Headers */, + 52F98F41ED713D8FCD42A8987488D5E4 /* SwiftGenKit-umbrella.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; - E03B997993C97623E1B6ADDDD9A47FC6 /* Headers */ = { + C1FE368D6E3B81013555272F469215D5 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 29B7DA7D7F154DFA0D1664A181FFBAAD /* Pods-Tests-umbrella.h in Headers */, + C7F7C330DADACA0003C83B5638C61049 /* Pods-Tests-umbrella.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - 272489B87F3C869B3BDD73E83662E4E4 /* Stencil */ = { + 2B25436536D3E02FBBCC038F17E7B3FE /* Pods-Tests */ = { isa = PBXNativeTarget; - buildConfigurationList = F6DDC1032D2FFBEED9D425443CF3103A /* Build configuration list for PBXNativeTarget "Stencil" */; + buildConfigurationList = 5A3B7E66B17CF98929746314768620E9 /* Build configuration list for PBXNativeTarget "Pods-Tests" */; buildPhases = ( - 18430210851039768DC52CFEB7B5FBEC /* Sources */, - 2AF5E2CEAA396C88B6A51FF771AFFCA0 /* Frameworks */, - 45A533AA7924A88D87AE816354B91431 /* Headers */, + D6192B9A5EF0FAA58D5B94E4065650F9 /* Sources */, + 55AA21EE565967A545808BFE740FB56A /* Frameworks */, + C1FE368D6E3B81013555272F469215D5 /* Headers */, ); buildRules = ( ); dependencies = ( - ED062BBB6B774B12DFFA9D60033BE7B1 /* PBXTargetDependency */, + C6C56EEC74AA734F80D0639EF6FBE623 /* PBXTargetDependency */, + 0BF1D0A7B30AD69BC4603C5FC7BE999E /* PBXTargetDependency */, ); - name = Stencil; - productName = Stencil; - productReference = 279273F061523D66B55D27131FEB6148 /* Stencil.framework */; + name = "Pods-Tests"; + productName = "Pods-Tests"; + productReference = B6D0D3405A260E50A632D90481AD939E /* Pods_Tests.framework */; productType = "com.apple.product-type.framework"; }; - 4E1460B0DD6B108888ADADDD9704965F /* Pods-Tests */ = { + 8FFA80ED512C8E7FD5452CF15F21EDB8 /* SwiftGenKit */ = { isa = PBXNativeTarget; - buildConfigurationList = E4F8D5C8E247ADD24B4E3C4A3CDA291B /* Build configuration list for PBXNativeTarget "Pods-Tests" */; + buildConfigurationList = 36E973EC1DD37B6F4D9D653A69DE8CD4 /* Build configuration list for PBXNativeTarget "SwiftGenKit" */; buildPhases = ( - FEC64B0BCA3AE33889E6336CFA1BA32B /* Sources */, - B15C62E3EE211DE142105019A35DD37B /* Frameworks */, - E03B997993C97623E1B6ADDDD9A47FC6 /* Headers */, + 7FD3EF5A275A1619B08B18E85EA3C681 /* Sources */, + 1AAAB27F6AEC527FF4309EC04B5BF3FB /* Frameworks */, + BE11556B1D57507D13CE94413711333E /* Headers */, ); buildRules = ( ); dependencies = ( - EB3DF52B0B9B5C6E2E7C3826E7A58A40 /* PBXTargetDependency */, - 2F83F5A463A0D1254999C6C6E0CD3A19 /* PBXTargetDependency */, - 301A58C5B89C446A9E8DF0190213EF8A /* PBXTargetDependency */, + 1F47521EA14027297B9FFDEF10BCFCD0 /* PBXTargetDependency */, ); - name = "Pods-Tests"; - productName = "Pods-Tests"; - productReference = FC50E6B59E54BE94B0C05E2FCD93D230 /* Pods_Tests.framework */; + name = SwiftGenKit; + productName = SwiftGenKit; + productReference = FBC70719DFB58EAECC4DCBA06C2586DF /* SwiftGenKit.framework */; productType = "com.apple.product-type.framework"; }; BBB46569A79C52426939AF96DA290CF9 /* PathKit */ = { @@ -512,25 +387,7 @@ ); name = PathKit; productName = PathKit; - productReference = 650CAC0D1F80EFE1AEB678D05530141B /* PathKit.framework */; - productType = "com.apple.product-type.framework"; - }; - CAD38709AA14638482603AE3702E40C7 /* SwiftGenKit */ = { - isa = PBXNativeTarget; - buildConfigurationList = E2D676D0AACFB1C2B588E7A081F28FB0 /* Build configuration list for PBXNativeTarget "SwiftGenKit" */; - buildPhases = ( - 95D8546380646E96BCA69E790B9516AF /* Sources */, - 991E9DDE7DFEE09E85D54F19C522679D /* Frameworks */, - 229F72D213FFF1BC15B307BEC91561E9 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - 74114BFC06C253C94986BA75B043585B /* PBXTargetDependency */, - ); - name = SwiftGenKit; - productName = SwiftGenKit; - productReference = 265F975B73073835FB84065AFE716801 /* SwiftGenKit.framework */; + productReference = 57BEF236ED0935C9190818809B5658A0 /* PathKit.framework */; productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ @@ -550,46 +407,18 @@ en, ); mainGroup = 7DB346D0F39D3F0E887471402A8071AB; - productRefGroup = AD44D9685C1729342C47B82F98F06B95 /* Products */; + productRefGroup = 7CF3977A8D8061C1B529E0C462F03CF5 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( BBB46569A79C52426939AF96DA290CF9 /* PathKit */, - 4E1460B0DD6B108888ADADDD9704965F /* Pods-Tests */, - 272489B87F3C869B3BDD73E83662E4E4 /* Stencil */, - CAD38709AA14638482603AE3702E40C7 /* SwiftGenKit */, + 2B25436536D3E02FBBCC038F17E7B3FE /* Pods-Tests */, + 8FFA80ED512C8E7FD5452CF15F21EDB8 /* SwiftGenKit */, ); }; /* End PBXProject section */ /* Begin PBXSourcesBuildPhase section */ - 18430210851039768DC52CFEB7B5FBEC /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 081456D04BE5EA7E78274FCF240AB051 /* Context.swift in Sources */, - 09D43636F5561DE23A18E8C780273C24 /* Environment.swift in Sources */, - E8C32CCB4E949A48FED75450D03CFF2B /* Errors.swift in Sources */, - 11B5C106427B078EBD345284A81E5AA1 /* Expression.swift in Sources */, - 0CD6287216801231D72B9AA96F4BFB9E /* Extension.swift in Sources */, - 2BDD41BFF9EE6BDAA81D4166556CFE2F /* Filters.swift in Sources */, - 64B15E6CCEAA44E84BD4642267BE7816 /* FilterTag.swift in Sources */, - 682503B7881609AF762296196FEF9DF6 /* ForTag.swift in Sources */, - FEE49DDFF96FA7B5EF15E324D0710B79 /* IfTag.swift in Sources */, - F45A92A317E56FD1379219CB12451670 /* Include.swift in Sources */, - 979F7508C5D35ADC3784CF9E24AAFA69 /* Inheritence.swift in Sources */, - E2D5C4E12493B5E2850AC49DC6E663E4 /* Lexer.swift in Sources */, - 7FD86DB6F6783CE0EEA15BA171DD737C /* Loader.swift in Sources */, - AA23F6047119FF0F2705FA47227546BF /* Node.swift in Sources */, - 5A30DA63271C175354B3014B13119C3E /* NowTag.swift in Sources */, - F27D04C2DE9A578F3068D6D809A9C9A7 /* Parser.swift in Sources */, - C8EF04CEDE9125827B761624E39215E9 /* Stencil-dummy.m in Sources */, - 9EC02625B80C5D3757E5869DE2622BFD /* Template.swift in Sources */, - DC8321929E123B1B672B1C450B1B0BB1 /* Tokenizer.swift in Sources */, - E0EE90E9C63F305F09CB1814EFE2810D /* Variable.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 5FCA4CE5597481B9D6D11D12673C7E41 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -599,72 +428,60 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 95D8546380646E96BCA69E790B9516AF /* Sources */ = { + 7FD3EF5A275A1619B08B18E85EA3C681 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - EBCAAE5E0862E5DABF13F12D312CEFFD /* AssetsCatalogContext.swift in Sources */, - D6AB9404709C66FE2A03AE9FDEF7E632 /* AssetsCatalogParser.swift in Sources */, - 8BC00CE11BF9DDA1BAB13112DD16EAE2 /* ColorsContext.swift in Sources */, - 60938CB9A91153FA1019355D815D35BE /* ColorsFileParser.swift in Sources */, - 90FEE0078E6B023282A9655192C81B1B /* Command.swift in Sources */, - 7DC590E71685C181434AA33E60DA6A37 /* FontsContext.swift in Sources */, - 6C2CBA8AE73F20DAAA75B5CAE0EB0040 /* FontsFileParser.swift in Sources */, - 3721555E579511D34B8348722B9F668C /* StoryboardParser.swift in Sources */, - 702DBD4A1BC401FF162E37C6C885A364 /* StoryboardsContext.swift in Sources */, - 3CDD0C92ED7763897E0AB6627A522BBA /* StringsContext.swift in Sources */, - CC59909F89DA43245F7F134E8C52C9DA /* StringsFileParser.swift in Sources */, - F98677D67537DBF01FD7C992936DDF49 /* SwiftGenKit-dummy.m in Sources */, + 725AE61C5F77217CC6DE6A6212BC8545 /* AssetsCatalogContext.swift in Sources */, + E525BFF8CF5A5B6BC19AE9E32F292654 /* AssetsCatalogParser.swift in Sources */, + 0BE4A6E9E72DEA5E50CCCD991721D814 /* ColorsContext.swift in Sources */, + 49BCFF59F33C503487A6416F323BD9C7 /* ColorsFileParser.swift in Sources */, + 52CBC3F8EBEB51C1379F805BFF7226AD /* Command.swift in Sources */, + 61E711CF6EDDC6B9AFE79D2FF56ABD71 /* FontsContext.swift in Sources */, + 32828B158518F56B137CC015B0ADBFDD /* FontsFileParser.swift in Sources */, + A03C593A5675875DD832EB79EA5DC346 /* StoryboardParser.swift in Sources */, + 1DBE65BBA7CC2D0C93544B240F73D17E /* StoryboardsContext.swift in Sources */, + 84349FC390D9D0D9836345C172D4CB77 /* StringsContext.swift in Sources */, + 033700BD14168E5C5614FDB4DF37B748 /* StringsFileParser.swift in Sources */, + 5E5FC679DE8A404241F31D47EFFDE7D6 /* SwiftGenKit-dummy.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - FEC64B0BCA3AE33889E6336CFA1BA32B /* Sources */ = { + D6192B9A5EF0FAA58D5B94E4065650F9 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - E208DC9145505090458D6DD7F5C5D8EC /* Pods-Tests-dummy.m in Sources */, + 45E65D38B12A5C4F8DE2E3D45D94B856 /* Pods-Tests-dummy.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 2F83F5A463A0D1254999C6C6E0CD3A19 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = Stencil; - target = 272489B87F3C869B3BDD73E83662E4E4 /* Stencil */; - targetProxy = 43E95A50B34E0C6A694B97073053BD99 /* PBXContainerItemProxy */; - }; - 301A58C5B89C446A9E8DF0190213EF8A /* PBXTargetDependency */ = { + 0BF1D0A7B30AD69BC4603C5FC7BE999E /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = SwiftGenKit; - target = CAD38709AA14638482603AE3702E40C7 /* SwiftGenKit */; - targetProxy = 4913E152C48483A6E797A913793ED6EF /* PBXContainerItemProxy */; - }; - 74114BFC06C253C94986BA75B043585B /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = PathKit; - target = BBB46569A79C52426939AF96DA290CF9 /* PathKit */; - targetProxy = FA2FA7AB985ACB1A21BD37DAB3D741F3 /* PBXContainerItemProxy */; + target = 8FFA80ED512C8E7FD5452CF15F21EDB8 /* SwiftGenKit */; + targetProxy = 7CD6504691C5DDD496360AC4BD0B6A7F /* PBXContainerItemProxy */; }; - EB3DF52B0B9B5C6E2E7C3826E7A58A40 /* PBXTargetDependency */ = { + 1F47521EA14027297B9FFDEF10BCFCD0 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = PathKit; target = BBB46569A79C52426939AF96DA290CF9 /* PathKit */; - targetProxy = BBAAAB8271E8CC200B0F934CCF079048 /* PBXContainerItemProxy */; + targetProxy = 310556C1AC23FA9B012D1E1620F2537B /* PBXContainerItemProxy */; }; - ED062BBB6B774B12DFFA9D60033BE7B1 /* PBXTargetDependency */ = { + C6C56EEC74AA734F80D0639EF6FBE623 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = PathKit; target = BBB46569A79C52426939AF96DA290CF9 /* PathKit */; - targetProxy = BCA52025E1B185D5D1DCCE085CB2D108 /* PBXContainerItemProxy */; + targetProxy = 2EC96566BFCB9356ED32B9A05B7186AF /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ 07D806167CD6B3291DDD8EABAE2E5033 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C1E8657D8A2E60CA5179FDE94F283B2A /* PathKit.xcconfig */; + baseConfigurationReference = BB116B04D23E71A2DEB352995B9A4043 /* PathKit.xcconfig */; buildSettings = { CODE_SIGN_IDENTITY = "-"; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; @@ -697,75 +514,6 @@ }; name = Debug; }; - 11C76A908CB67823D4B13C56E8DE6A1E /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7D849BEE3993512EB3DC1DB84A51D5FB /* SwiftGenKit.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; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - FRAMEWORK_VERSION = A; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/SwiftGenKit/SwiftGenKit-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/SwiftGenKit/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/SwiftGenKit/SwiftGenKit.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = SwiftGenKit; - SDKROOT = macosx; - SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 3D7C6A62F7E50ADFD4D286F294D83B66 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = B51EE1F2CACBC9829B2FEC2985DEA9D2 /* 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; - DEBUG_INFORMATION_FORMAT = dwarf; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - FRAMEWORK_VERSION = A; - GCC_NO_COMMON_BLOCKS = YES; - 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"; - MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_NAME = Stencil; - SDKROOT = macosx; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; 4ECF5F3A7DCBE32E59B23B0C7F362504 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { @@ -806,9 +554,9 @@ }; name = Release; }; - 8D6F5CAF357910B2EE5D8779AAC2A1CD /* Release */ = { + 9CD50A07554EA982182CBCD20EC471EF /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 2E6EDE0590FA1A030C93F83C2EEFC65C /* Pods-Tests.release.xcconfig */; + baseConfigurationReference = 1143DC189DEAEC4A1278249254968FB1 /* Pods-Tests.debug.xcconfig */; buildSettings = { CODE_SIGN_IDENTITY = "-"; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; @@ -816,7 +564,7 @@ "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = dwarf; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -830,7 +578,7 @@ MACH_O_TYPE = staticlib; MACOSX_DEPLOYMENT_TARGET = 10.9; MODULEMAP_FILE = "Target Support Files/Pods-Tests/Pods-Tests.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; + MTL_ENABLE_DEBUG_INFO = YES; OTHER_LDFLAGS = ""; OTHER_LIBTOOLFLAGS = ""; PODS_ROOT = "$(SRCROOT)"; @@ -838,14 +586,15 @@ PRODUCT_NAME = Pods_Tests; SDKROOT = macosx; SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Release; + name = Debug; }; - B9A2613B4E5ED40369F3E0B64484FDFA /* Debug */ = { + B275D4928868AD4A4DC50272392281A2 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7D849BEE3993512EB3DC1DB84A51D5FB /* SwiftGenKit.xcconfig */; + baseConfigurationReference = 2E6EDE0590FA1A030C93F83C2EEFC65C /* Pods-Tests.release.xcconfig */; buildSettings = { CODE_SIGN_IDENTITY = "-"; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; @@ -853,7 +602,7 @@ "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -861,26 +610,28 @@ ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_VERSION = A; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/SwiftGenKit/SwiftGenKit-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/SwiftGenKit/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/SwiftGenKit/SwiftGenKit.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_NAME = SwiftGenKit; + MODULEMAP_FILE = "Target Support Files/Pods-Tests/Pods-Tests.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_Tests; SDKROOT = macosx; SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Debug; + name = Release; }; C0615970E7397BC442586C7600152196 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C1E8657D8A2E60CA5179FDE94F283B2A /* PathKit.xcconfig */; + baseConfigurationReference = BB116B04D23E71A2DEB352995B9A4043 /* PathKit.xcconfig */; buildSettings = { CODE_SIGN_IDENTITY = "-"; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; @@ -956,9 +707,9 @@ }; name = Debug; }; - CA8039A0E7F003C031E56069F975EE74 /* Release */ = { + D0E04B46020C527A14B001BE755AA305 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = B51EE1F2CACBC9829B2FEC2985DEA9D2 /* Stencil.xcconfig */; + baseConfigurationReference = 7D849BEE3993512EB3DC1DB84A51D5FB /* SwiftGenKit.xcconfig */; buildSettings = { CODE_SIGN_IDENTITY = "-"; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; @@ -974,14 +725,14 @@ ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_VERSION = A; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/Stencil/Stencil-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/Stencil/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/SwiftGenKit/SwiftGenKit-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/SwiftGenKit/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"; + MODULEMAP_FILE = "Target Support Files/SwiftGenKit/SwiftGenKit.modulemap"; MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = Stencil; + PRODUCT_NAME = SwiftGenKit; SDKROOT = macosx; SKIP_INSTALL = YES; SWIFT_VERSION = 3.0; @@ -990,9 +741,9 @@ }; name = Release; }; - FEA150BF68393505606EDBF0F917B0F1 /* Debug */ = { + D5BF708AB45225C2586039CA010E4396 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 1143DC189DEAEC4A1278249254968FB1 /* Pods-Tests.debug.xcconfig */; + baseConfigurationReference = 7D849BEE3993512EB3DC1DB84A51D5FB /* SwiftGenKit.xcconfig */; buildSettings = { CODE_SIGN_IDENTITY = "-"; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; @@ -1008,21 +759,18 @@ ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_VERSION = A; GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-Tests/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/SwiftGenKit/SwiftGenKit-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/SwiftGenKit/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"; + MODULEMAP_FILE = "Target Support Files/SwiftGenKit/SwiftGenKit.modulemap"; MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_Tests; + PRODUCT_NAME = SwiftGenKit; SDKROOT = macosx; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -1049,29 +797,20 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - E2D676D0AACFB1C2B588E7A081F28FB0 /* Build configuration list for PBXNativeTarget "SwiftGenKit" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - B9A2613B4E5ED40369F3E0B64484FDFA /* Debug */, - 11C76A908CB67823D4B13C56E8DE6A1E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - E4F8D5C8E247ADD24B4E3C4A3CDA291B /* Build configuration list for PBXNativeTarget "Pods-Tests" */ = { + 36E973EC1DD37B6F4D9D653A69DE8CD4 /* Build configuration list for PBXNativeTarget "SwiftGenKit" */ = { isa = XCConfigurationList; buildConfigurations = ( - FEA150BF68393505606EDBF0F917B0F1 /* Debug */, - 8D6F5CAF357910B2EE5D8779AAC2A1CD /* Release */, + D5BF708AB45225C2586039CA010E4396 /* Debug */, + D0E04B46020C527A14B001BE755AA305 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - F6DDC1032D2FFBEED9D425443CF3103A /* Build configuration list for PBXNativeTarget "Stencil" */ = { + 5A3B7E66B17CF98929746314768620E9 /* Build configuration list for PBXNativeTarget "Pods-Tests" */ = { isa = XCConfigurationList; buildConfigurations = ( - 3D7C6A62F7E50ADFD4D286F294D83B66 /* Debug */, - CA8039A0E7F003C031E56069F975EE74 /* Release */, + 9CD50A07554EA982182CBCD20EC471EF /* Debug */, + B275D4928868AD4A4DC50272392281A2 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/Pods/Stencil/LICENSE b/Pods/Stencil/LICENSE deleted file mode 100644 index a8c6d13..0000000 --- a/Pods/Stencil/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2014, Kyle Fuller -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -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/README.md b/Pods/Stencil/README.md deleted file mode 100644 index d03c3b4..0000000 --- a/Pods/Stencil/README.md +++ /dev/null @@ -1,69 +0,0 @@ -# Stencil - -[![Build Status](https://travis-ci.org/kylef/Stencil.svg?branch=master)](https://travis-ci.org/kylef/Stencil) - -Stencil is a simple and powerful template language for Swift. It provides a -syntax similar to Django and Mustache. If you're familiar with these, you will -feel right at home with Stencil. - -## Example - -```html+django -There are {{ articles.count }} articles. - -
    - {% for article in articles %} -
  • {{ article.title }} by {{ article.author }}
  • - {% endfor %} -
-``` - -```swift -import Stencil - -struct Article { - let title: String - let author: String -} - -let context = [ - "articles": [ - Article(title: "Migrating from OCUnit to XCTest", author: "Kyle Fuller"), - Article(title: "Memory Management with ARC", author: "Kyle Fuller"), - ] -] - -let environment = Environment(loader: FileSystemLoader(paths: ["templates/"]) -let rendered = try environment.renderTemplate(name: context) - -print(rendered) -``` - -## Philosophy - -Stencil follows the same philosophy of Django: - -> If you have a background in programming, or if you’re used to languages which -> mix programming code directly into HTML, you’ll want to bear in mind that the -> Django template system is not simply Python embedded into HTML. This is by -> design: the template system is meant to express presentation, not program -> logic. - -## The User Guide - -Resources for Stencil template authors to write Stencil templates: - -- [Language overview](http://stencil.fuller.li/en/latest/templates.html) -- [Built-in template tags and filters](http://stencil.fuller.li/en/latest/builtins.html) - -Resources to help you integrate Stencil into a Swift project: - -- [Installation](http://stencil.fuller.li/en/latest/installation.html) -- [Getting Started](http://stencil.fuller.li/en/latest/getting-started.html) -- [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) - -## License - -Stencil is licensed under the BSD license. See [LICENSE](LICENSE) for more -info. diff --git a/Pods/Stencil/Sources/Context.swift b/Pods/Stencil/Sources/Context.swift deleted file mode 100644 index a87ddb9..0000000 --- a/Pods/Stencil/Sources/Context.swift +++ /dev/null @@ -1,69 +0,0 @@ -/// A container for template variables. -public class Context { - var dictionaries: [[String: Any?]] - - public let environment: Environment - - init(dictionary: [String: Any]? = nil, environment: Environment? = nil) { - if let dictionary = dictionary { - dictionaries = [dictionary] - } else { - dictionaries = [] - } - - self.environment = environment ?? Environment() - } - - public subscript(key: String) -> Any? { - /// Retrieves a variable's value, starting at the current context and going upwards - get { - for dictionary in Array(dictionaries.reversed()) { - if let value = dictionary[key] { - return value - } - } - - return nil - } - - /// Set a variable in the current context, deleting the variable if it's nil - set(value) { - if let dictionary = dictionaries.popLast() { - var mutable_dictionary = dictionary - mutable_dictionary[key] = value - dictionaries.append(mutable_dictionary) - } - } - } - - /// Push a new level into the Context - fileprivate func push(_ dictionary: [String: Any]? = nil) { - dictionaries.append(dictionary ?? [:]) - } - - /// Pop the last level off of the Context - fileprivate func pop() -> [String: Any]? { - return dictionaries.popLast() - } - - /// Push a new level onto the context for the duration of the execution of the given closure - public func push(dictionary: [String: Any]? = nil, closure: (() throws -> Result)) rethrows -> Result { - push(dictionary) - defer { _ = pop() } - return try closure() - } - - public func flatten() -> [String: Any] { - var accumulator: [String: Any] = [:] - - for dictionary in dictionaries { - for (key, value) in dictionary { - if let value = value { - accumulator.updateValue(value, forKey: key) - } - } - } - - return accumulator - } -} diff --git a/Pods/Stencil/Sources/Environment.swift b/Pods/Stencil/Sources/Environment.swift deleted file mode 100644 index d220bf8..0000000 --- a/Pods/Stencil/Sources/Environment.swift +++ /dev/null @@ -1,38 +0,0 @@ -public struct Environment { - public let templateClass: Template.Type - public let extensions: [Extension] - - public var loader: Loader? - - public init(loader: Loader? = nil, extensions: [Extension]? = nil, templateClass: Template.Type = Template.self) { - self.templateClass = templateClass - self.loader = loader - self.extensions = (extensions ?? []) + [DefaultExtension()] - } - - public func loadTemplate(name: String) throws -> Template { - if let loader = loader { - return try loader.loadTemplate(name: name, environment: self) - } else { - throw TemplateDoesNotExist(templateNames: [name], loader: nil) - } - } - - public func loadTemplate(names: [String]) throws -> Template { - if let loader = loader { - return try loader.loadTemplate(names: names, environment: self) - } else { - throw TemplateDoesNotExist(templateNames: names, loader: nil) - } - } - - public func renderTemplate(name: String, context: [String: Any]? = nil) throws -> String { - let template = try loadTemplate(name: name) - return try template.render(context) - } - - public func renderTemplate(string: String, context: [String: Any]? = nil) throws -> String { - let template = templateClass.init(templateString: string, environment: self) - return try template.render(context) - } -} diff --git a/Pods/Stencil/Sources/Errors.swift b/Pods/Stencil/Sources/Errors.swift deleted file mode 100644 index 964eeae..0000000 --- a/Pods/Stencil/Sources/Errors.swift +++ /dev/null @@ -1,19 +0,0 @@ -public class TemplateDoesNotExist: Error, CustomStringConvertible { - let templateNames: [String] - let loader: Loader? - - public init(templateNames: [String], loader: Loader? = nil) { - self.templateNames = templateNames - self.loader = loader - } - - public var description: String { - let templates = templateNames.joined(separator: ", ") - - if let loader = loader { - return "Template named `\(templates)` does not exist in loader \(loader)" - } - - return "Template named `\(templates)` does not exist. No loaders found" - } -} diff --git a/Pods/Stencil/Sources/Expression.swift b/Pods/Stencil/Sources/Expression.swift deleted file mode 100644 index f2c8a48..0000000 --- a/Pods/Stencil/Sources/Expression.swift +++ /dev/null @@ -1,300 +0,0 @@ -protocol Expression: CustomStringConvertible { - func evaluate(context: Context) throws -> Bool -} - - -protocol InfixOperator: Expression { - init(lhs: Expression, rhs: Expression) -} - - -protocol PrefixOperator: Expression { - init(expression: Expression) -} - - -final class StaticExpression: Expression, CustomStringConvertible { - let value: Bool - - init(value: Bool) { - self.value = value - } - - func evaluate(context: Context) throws -> Bool { - return value - } - - var description: String { - return "\(value)" - } -} - - -final class VariableExpression: Expression, CustomStringConvertible { - let variable: Resolvable - - init(variable: Resolvable) { - self.variable = variable - } - - var description: String { - return "(variable: \(variable))" - } - - /// Resolves a variable in the given context as boolean - func resolve(context: Context, variable: Resolvable) throws -> Bool { - let result = try variable.resolve(context) - var truthy = false - - if let result = result as? [Any] { - truthy = !result.isEmpty - } else if let result = result as? [String:Any] { - truthy = !result.isEmpty - } else if let result = result as? Bool { - truthy = result - } else if let result = result as? String { - truthy = !result.isEmpty - } else if let value = result, let result = toNumber(value: value) { - truthy = result > 0 - } else if result != nil { - truthy = true - } - - return truthy - } - - func evaluate(context: Context) throws -> Bool { - return try resolve(context: context, variable: variable) - } -} - - -final class NotExpression: Expression, PrefixOperator, CustomStringConvertible { - let expression: Expression - - init(expression: Expression) { - self.expression = expression - } - - var description: String { - return "not \(expression)" - } - - func evaluate(context: Context) throws -> Bool { - return try !expression.evaluate(context: context) - } -} - - -final class OrExpression: Expression, InfixOperator, CustomStringConvertible { - let lhs: Expression - let rhs: Expression - - init(lhs: Expression, rhs: Expression) { - self.lhs = lhs - self.rhs = rhs - } - - var description: String { - return "(\(lhs) or \(rhs))" - } - - func evaluate(context: Context) throws -> Bool { - let lhs = try self.lhs.evaluate(context: context) - if lhs { - return lhs - } - - return try rhs.evaluate(context: context) - } -} - - -final class AndExpression: Expression, InfixOperator, CustomStringConvertible { - let lhs: Expression - let rhs: Expression - - init(lhs: Expression, rhs: Expression) { - self.lhs = lhs - self.rhs = rhs - } - - var description: String { - return "(\(lhs) and \(rhs))" - } - - func evaluate(context: Context) throws -> Bool { - let lhs = try self.lhs.evaluate(context: context) - if !lhs { - return lhs - } - - return try rhs.evaluate(context: context) - } -} - - -class EqualityExpression: Expression, InfixOperator, CustomStringConvertible { - let lhs: Expression - let rhs: Expression - - required init(lhs: Expression, rhs: Expression) { - self.lhs = lhs - self.rhs = rhs - } - - var description: String { - return "(\(lhs) == \(rhs))" - } - - func evaluate(context: Context) throws -> Bool { - if let lhs = lhs as? VariableExpression, let rhs = rhs as? VariableExpression { - let lhsValue = try lhs.variable.resolve(context) - let rhsValue = try rhs.variable.resolve(context) - - if let lhs = lhsValue, let rhs = rhsValue { - if let lhs = toNumber(value: lhs), let rhs = toNumber(value: rhs) { - return lhs == rhs - } else if let lhs = lhsValue as? String, let rhs = rhsValue as? String { - return lhs == rhs - } else if let lhs = lhsValue as? Bool, let rhs = rhsValue as? Bool { - return lhs == rhs - } - } else if lhsValue == nil && rhsValue == nil { - return true - } - } - - return false - } -} - - -class NumericExpression: Expression, InfixOperator, CustomStringConvertible { - let lhs: Expression - let rhs: Expression - - required init(lhs: Expression, rhs: Expression) { - self.lhs = lhs - self.rhs = rhs - } - - var description: String { - return "(\(lhs) \(op) \(rhs))" - } - - func evaluate(context: Context) throws -> Bool { - if let lhs = lhs as? VariableExpression, let rhs = rhs as? VariableExpression { - let lhsValue = try lhs.variable.resolve(context) - let rhsValue = try rhs.variable.resolve(context) - - if let lhs = lhsValue, let rhs = rhsValue { - if let lhs = toNumber(value: lhs), let rhs = toNumber(value: rhs) { - return compare(lhs: lhs, rhs: rhs) - } - } - } - - return false - } - - var op: String { - return "" - } - - func compare(lhs: Number, rhs: Number) -> Bool { - return false - } -} - - -class MoreThanExpression: NumericExpression { - override var op: String { - return ">" - } - - override func compare(lhs: Number, rhs: Number) -> Bool { - return lhs > rhs - } -} - - -class MoreThanEqualExpression: NumericExpression { - override var op: String { - return ">=" - } - - override func compare(lhs: Number, rhs: Number) -> Bool { - return lhs >= rhs - } -} - - -class LessThanExpression: NumericExpression { - override var op: String { - return "<" - } - - override func compare(lhs: Number, rhs: Number) -> Bool { - return lhs < rhs - } -} - - -class LessThanEqualExpression: NumericExpression { - override var op: String { - return "<=" - } - - override func compare(lhs: Number, rhs: Number) -> Bool { - return lhs <= rhs - } -} - - -class InequalityExpression: EqualityExpression { - override var description: String { - return "(\(lhs) != \(rhs))" - } - - override func evaluate(context: Context) throws -> Bool { - return try !super.evaluate(context: context) - } -} - - -func toNumber(value: Any) -> Number? { - if let value = value as? Float { - return Number(value) - } else if let value = value as? Double { - return Number(value) - } else if let value = value as? UInt { - return Number(value) - } else if let value = value as? Int { - return Number(value) - } else if let value = value as? Int8 { - return Number(value) - } else if let value = value as? Int16 { - return Number(value) - } else if let value = value as? Int32 { - return Number(value) - } else if let value = value as? Int64 { - return Number(value) - } else if let value = value as? UInt8 { - return Number(value) - } else if let value = value as? UInt16 { - return Number(value) - } else if let value = value as? UInt32 { - return Number(value) - } else if let value = value as? UInt64 { - return Number(value) - } else if let value = value as? Number { - return value - } else if let value = value as? Float64 { - return Number(value) - } else if let value = value as? Float32 { - return Number(value) - } - - return nil -} diff --git a/Pods/Stencil/Sources/Extension.swift b/Pods/Stencil/Sources/Extension.swift deleted file mode 100644 index 9dfa879..0000000 --- a/Pods/Stencil/Sources/Extension.swift +++ /dev/null @@ -1,84 +0,0 @@ -open class Extension { - typealias TagParser = (TokenParser, Token) throws -> NodeType - var tags = [String: TagParser]() - - var filters = [String: Filter]() - - public init() { - } - - /// Registers a new template tag - public func registerTag(_ name: String, parser: @escaping (TokenParser, Token) throws -> NodeType) { - tags[name] = parser - } - - /// Registers a simple template tag with a name and a handler - public func registerSimpleTag(_ name: String, handler: @escaping (Context) throws -> String) { - registerTag(name, parser: { parser, token in - return SimpleNode(handler: handler) - }) - } - - /// Registers a template filter with the given name - public func registerFilter(_ name: String, filter: @escaping (Any?) throws -> Any?) { - filters[name] = .simple(filter) - } - - /// Registers a template filter with the given name - public func registerFilter(_ name: String, filter: @escaping (Any?, [Any?]) throws -> Any?) { - filters[name] = .arguments(filter) - } -} - - -class DefaultExtension: Extension { - override init() { - super.init() - registerDefaultTags() - registerDefaultFilters() - } - - fileprivate func registerDefaultTags() { - registerTag("for", parser: ForNode.parse) - registerTag("if", parser: IfNode.parse) - registerTag("ifnot", parser: IfNode.parse_ifnot) -#if !os(Linux) - registerTag("now", parser: NowNode.parse) -#endif - registerTag("include", parser: IncludeNode.parse) - registerTag("extends", parser: ExtendsNode.parse) - registerTag("block", parser: BlockNode.parse) - registerTag("filter", parser: FilterNode.parse) - } - - fileprivate func registerDefaultFilters() { - registerFilter("default", filter: defaultFilter) - registerFilter("capitalize", filter: capitalise) - registerFilter("uppercase", filter: uppercase) - registerFilter("lowercase", filter: lowercase) - registerFilter("join", filter: joinFilter) - } -} - - -protocol FilterType { - func invoke(value: Any?, arguments: [Any?]) throws -> Any? -} - -enum Filter: FilterType { - case simple(((Any?) throws -> Any?)) - case arguments(((Any?, [Any?]) throws -> Any?)) - - func invoke(value: Any?, arguments: [Any?]) throws -> Any? { - switch self { - case let .simple(filter): - if !arguments.isEmpty { - throw TemplateSyntaxError("cannot invoke filter with an argument") - } - - return try filter(value) - case let .arguments(filter): - return try filter(value, arguments) - } - } -} diff --git a/Pods/Stencil/Sources/FilterTag.swift b/Pods/Stencil/Sources/FilterTag.swift deleted file mode 100644 index 63ce321..0000000 --- a/Pods/Stencil/Sources/FilterTag.swift +++ /dev/null @@ -1,35 +0,0 @@ -class FilterNode : NodeType { - let resolvable: Resolvable - let nodes: [NodeType] - - class func parse(_ parser: TokenParser, token: Token) throws -> NodeType { - let bits = token.components() - - guard bits.count == 2 else { - throw TemplateSyntaxError("'filter' tag takes one argument, the filter expression") - } - - let blocks = try parser.parse(until(["endfilter"])) - - guard parser.nextToken() != nil else { - throw TemplateSyntaxError("`endfilter` was not found.") - } - - let resolvable = try parser.compileFilter("filter_value|\(bits[1])") - return FilterNode(nodes: blocks, resolvable: resolvable) - } - - init(nodes: [NodeType], resolvable: Resolvable) { - self.nodes = nodes - self.resolvable = resolvable - } - - func render(_ context: Context) throws -> String { - let value = try renderNodes(nodes, context) - - return try context.push(dictionary: ["filter_value": value]) { - return try VariableNode(variable: resolvable).render(context) - } - } -} - diff --git a/Pods/Stencil/Sources/Filters.swift b/Pods/Stencil/Sources/Filters.swift deleted file mode 100644 index dd78ff4..0000000 --- a/Pods/Stencil/Sources/Filters.swift +++ /dev/null @@ -1,41 +0,0 @@ -func capitalise(_ value: Any?) -> Any? { - return stringify(value).capitalized -} - -func uppercase(_ value: Any?) -> Any? { - return stringify(value).uppercased() -} - -func lowercase(_ value: Any?) -> Any? { - return stringify(value).lowercased() -} - -func defaultFilter(value: Any?, arguments: [Any?]) -> Any? { - if let value = value { - return value - } - - for argument in arguments { - if let argument = argument { - return argument - } - } - - return nil -} - -func joinFilter(value: Any?, arguments: [Any?]) throws -> Any? { - guard arguments.count < 2 else { - throw TemplateSyntaxError("'join' filter takes a single argument") - } - - let separator = stringify(arguments.first ?? "") - - if let value = value as? [Any] { - return value - .map(stringify) - .joined(separator: separator) - } - - return value -} diff --git a/Pods/Stencil/Sources/ForTag.swift b/Pods/Stencil/Sources/ForTag.swift deleted file mode 100644 index 5628bbe..0000000 --- a/Pods/Stencil/Sources/ForTag.swift +++ /dev/null @@ -1,63 +0,0 @@ -class ForNode : NodeType { - let resolvable: Resolvable - let loopVariable:String - let nodes:[NodeType] - let emptyNodes: [NodeType] - - class func parse(_ parser:TokenParser, token:Token) throws -> NodeType { - let components = token.components() - - guard components.count == 4 && components[2] == "in" else { - throw TemplateSyntaxError("'for' statements should use the following 'for x in y' `\(token.contents)`.") - } - - let loopVariable = components[1] - let variable = components[3] - - var emptyNodes = [NodeType]() - - let forNodes = try parser.parse(until(["endfor", "empty"])) - - guard let token = parser.nextToken() else { - throw TemplateSyntaxError("`endfor` was not found.") - } - - if token.contents == "empty" { - emptyNodes = try parser.parse(until(["endfor"])) - _ = parser.nextToken() - } - - let filter = try parser.compileFilter(variable) - return ForNode(resolvable: filter, loopVariable: loopVariable, nodes: forNodes, emptyNodes:emptyNodes) - } - - init(resolvable: Resolvable, loopVariable:String, nodes:[NodeType], emptyNodes:[NodeType]) { - self.resolvable = resolvable - self.loopVariable = loopVariable - self.nodes = nodes - self.emptyNodes = emptyNodes - } - - func render(_ context: Context) throws -> String { - let values = try resolvable.resolve(context) - - if let values = values as? [Any] , values.count > 0 { - let count = values.count - return try values.enumerated().map { index, item in - let forContext: [String: Any] = [ - "first": index == 0, - "last": index == (count - 1), - "counter": index + 1, - ] - - return try context.push(dictionary: [loopVariable: item, "forloop": forContext]) { - try renderNodes(nodes, context) - } - }.joined(separator: "") - } - - return try context.push { - try renderNodes(emptyNodes, context) - } - } -} diff --git a/Pods/Stencil/Sources/IfTag.swift b/Pods/Stencil/Sources/IfTag.swift deleted file mode 100644 index bd89b5e..0000000 --- a/Pods/Stencil/Sources/IfTag.swift +++ /dev/null @@ -1,230 +0,0 @@ -enum Operator { - case infix(String, Int, InfixOperator.Type) - case prefix(String, Int, PrefixOperator.Type) - - var name: String { - switch self { - case .infix(let name, _, _): - return name - case .prefix(let name, _, _): - return name - } - } -} - - -let operators: [Operator] = [ - .infix("or", 6, OrExpression.self), - .infix("and", 7, AndExpression.self), - .prefix("not", 8, NotExpression.self), - .infix("==", 10, EqualityExpression.self), - .infix("!=", 10, InequalityExpression.self), - .infix(">", 10, MoreThanExpression.self), - .infix(">=", 10, MoreThanEqualExpression.self), - .infix("<", 10, LessThanExpression.self), - .infix("<=", 10, LessThanEqualExpression.self), -] - - -func findOperator(name: String) -> Operator? { - for op in operators { - if op.name == name { - return op - } - } - - return nil -} - - -enum IfToken { - case infix(name: String, bindingPower: Int, op: InfixOperator.Type) - case prefix(name: String, bindingPower: Int, op: PrefixOperator.Type) - case variable(Resolvable) - case end - - var bindingPower: Int { - switch self { - case .infix(_, let bindingPower, _): - return bindingPower - case .prefix(_, let bindingPower, _): - return bindingPower - case .variable(_): - return 0 - case .end: - return 0 - } - } - - func nullDenotation(parser: IfExpressionParser) throws -> Expression { - switch self { - case .infix(let name, _, _): - throw TemplateSyntaxError("'if' expression error: infix operator '\(name)' doesn't have a left hand side") - case .prefix(_, let bindingPower, let op): - let expression = try parser.expression(bindingPower: bindingPower) - return op.init(expression: expression) - case .variable(let variable): - return VariableExpression(variable: variable) - case .end: - throw TemplateSyntaxError("'if' expression error: end") - } - } - - func leftDenotation(left: Expression, parser: IfExpressionParser) throws -> Expression { - switch self { - case .infix(_, let bindingPower, let op): - let right = try parser.expression(bindingPower: bindingPower) - return op.init(lhs: left, rhs: right) - case .prefix(let name, _, _): - 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 .end: - throw TemplateSyntaxError("'if' expression error: end") - } - } - - var isEnd: Bool { - switch self { - case .end: - return true - default: - return false - } - } -} - - -final class IfExpressionParser { - let tokens: [IfToken] - var position: Int = 0 - - init(components: [String], tokenParser: TokenParser) 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) - } - } - - return .variable(try tokenParser.compileFilter(component)) - } - } - - var currentToken: IfToken { - if tokens.count > position { - return tokens[position] - } - - return .end - } - - var nextToken: IfToken { - position += 1 - return currentToken - } - - func parse() throws -> Expression { - let expression = try self.expression() - - if !currentToken.isEnd { - throw TemplateSyntaxError("'if' expression error: dangling token") - } - - return expression - } - - func expression(bindingPower: Int = 0) throws -> Expression { - var token = currentToken - position += 1 - - var left = try token.nullDenotation(parser: self) - - while bindingPower < currentToken.bindingPower { - token = currentToken - position += 1 - left = try token.leftDenotation(left: left, parser: self) - } - - return left - } -} - - -func parseExpression(components: [String], tokenParser: TokenParser) throws -> Expression { - let parser = try IfExpressionParser(components: components, tokenParser: tokenParser) - return try parser.parse() -} - - -class IfNode : NodeType { - let expression: Expression - let trueNodes: [NodeType] - let falseNodes: [NodeType] - - class func parse(_ parser: TokenParser, token: Token) throws -> NodeType { - var components = token.components() - components.removeFirst() - var trueNodes = [NodeType]() - var falseNodes = [NodeType]() - - trueNodes = try parser.parse(until(["endif", "else"])) - - guard let token = parser.nextToken() else { - throw TemplateSyntaxError("`endif` was not found.") - } - - if token.contents == "else" { - falseNodes = try parser.parse(until(["endif"])) - _ = parser.nextToken() - } - - let expression = try parseExpression(components: components, tokenParser: parser) - return IfNode(expression: expression, trueNodes: trueNodes, falseNodes: falseNodes) - } - - class func parse_ifnot(_ parser: TokenParser, token: Token) throws -> NodeType { - var components = token.components() - guard components.count == 2 else { - throw TemplateSyntaxError("'ifnot' statements should use the following 'ifnot condition' `\(token.contents)`.") - } - components.removeFirst() - var trueNodes = [NodeType]() - var falseNodes = [NodeType]() - - falseNodes = try parser.parse(until(["endif", "else"])) - - guard let token = parser.nextToken() else { - throw TemplateSyntaxError("`endif` was not found.") - } - - if token.contents == "else" { - trueNodes = try parser.parse(until(["endif"])) - _ = parser.nextToken() - } - - let expression = try parseExpression(components: components, tokenParser: parser) - return IfNode(expression: expression, trueNodes: trueNodes, falseNodes: falseNodes) - } - - init(expression: Expression, trueNodes: [NodeType], falseNodes: [NodeType]) { - self.expression = expression - self.trueNodes = trueNodes - self.falseNodes = falseNodes - } - - func render(_ context: Context) throws -> String { - let truthy = try expression.evaluate(context: context) - - return try context.push { - if truthy { - return try renderNodes(trueNodes, context) - } else { - return try renderNodes(falseNodes, context) - } - } - } -} diff --git a/Pods/Stencil/Sources/Include.swift b/Pods/Stencil/Sources/Include.swift deleted file mode 100644 index cd9cc5c..0000000 --- a/Pods/Stencil/Sources/Include.swift +++ /dev/null @@ -1,33 +0,0 @@ -import PathKit - - -class IncludeNode : NodeType { - let templateName: Variable - - class func parse(_ parser: TokenParser, token: Token) throws -> NodeType { - let bits = token.components() - - guard bits.count == 2 else { - throw TemplateSyntaxError("'include' tag takes one argument, the template file to be included") - } - - return IncludeNode(templateName: Variable(bits[1])) - } - - init(templateName: Variable) { - self.templateName = templateName - } - - func render(_ context: Context) throws -> String { - guard let templateName = try self.templateName.resolve(context) as? String else { - throw TemplateSyntaxError("'\(self.templateName)' could not be resolved as a string") - } - - let template = try context.environment.loadTemplate(name: templateName) - - return try context.push { - return try template.render(context) - } - } -} - diff --git a/Pods/Stencil/Sources/Inheritence.swift b/Pods/Stencil/Sources/Inheritence.swift deleted file mode 100644 index 9919c16..0000000 --- a/Pods/Stencil/Sources/Inheritence.swift +++ /dev/null @@ -1,119 +0,0 @@ -class BlockContext { - class var contextKey: String { return "block_context" } - - var blocks: [String: BlockNode] - - init(blocks: [String: BlockNode]) { - self.blocks = blocks - } - - func pop(_ blockName: String) -> BlockNode? { - return blocks.removeValue(forKey: blockName) - } -} - - -extension Collection { - func any(_ closure: (Iterator.Element) -> Bool) -> Iterator.Element? { - for element in self { - if closure(element) { - return element - } - } - - return nil - } -} - - -class ExtendsNode : NodeType { - let templateName: Variable - let blocks: [String:BlockNode] - - class func parse(_ parser: TokenParser, token: Token) throws -> NodeType { - let bits = token.components() - - guard bits.count == 2 else { - throw TemplateSyntaxError("'extends' takes one argument, the template file to be extended") - } - - let parsedNodes = try parser.parse() - guard (parsedNodes.any { $0 is ExtendsNode }) == nil else { - throw TemplateSyntaxError("'extends' cannot appear more than once in the same template") - } - - let blockNodes = parsedNodes.flatMap { $0 as? BlockNode } - - let nodes = blockNodes.reduce([String: BlockNode]()) { (accumulator, node) -> [String: BlockNode] in - var dict = accumulator - dict[node.name] = node - return dict - } - - return ExtendsNode(templateName: Variable(bits[1]), blocks: nodes) - } - - init(templateName: Variable, blocks: [String: BlockNode]) { - self.templateName = templateName - self.blocks = blocks - } - - func render(_ context: Context) throws -> String { - guard let templateName = try self.templateName.resolve(context) as? String else { - throw TemplateSyntaxError("'\(self.templateName)' could not be resolved as a string") - } - - let template = try context.environment.loadTemplate(name: templateName) - - let blockContext: BlockContext - if let context = context[BlockContext.contextKey] as? BlockContext { - blockContext = context - - for (key, value) in blocks { - if !blockContext.blocks.keys.contains(key) { - blockContext.blocks[key] = value - } - } - } else { - blockContext = BlockContext(blocks: blocks) - } - - return try context.push(dictionary: [BlockContext.contextKey: blockContext]) { - return try template.render(context) - } - } -} - - -class BlockNode : NodeType { - let name: String - let nodes: [NodeType] - - class func parse(_ parser: TokenParser, token: Token) throws -> NodeType { - let bits = token.components() - - guard bits.count == 2 else { - throw TemplateSyntaxError("'block' tag takes one argument, the block name") - } - - let blockName = bits[1] - let nodes = try parser.parse(until(["endblock"])) - _ = parser.nextToken() - return BlockNode(name:blockName, nodes:nodes) - } - - init(name: String, nodes: [NodeType]) { - self.name = name - self.nodes = nodes - } - - 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]]) { - return try node.render(context) - } - } - - return try renderNodes(nodes, context) - } -} diff --git a/Pods/Stencil/Sources/Lexer.swift b/Pods/Stencil/Sources/Lexer.swift deleted file mode 100644 index e7fcd7c..0000000 --- a/Pods/Stencil/Sources/Lexer.swift +++ /dev/null @@ -1,152 +0,0 @@ -struct Lexer { - let templateString: String - - init(templateString: String) { - self.templateString = templateString - } - - func createToken(string:String) -> Token { - func strip() -> String { - let start = string.index(string.startIndex, offsetBy: 2) - let end = string.index(string.endIndex, offsetBy: -2) - return string[start.. [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)) - } - - let end = map[text.0]! - let result = scanner.scan(until: end, returnUntil: true) - tokens.append(createToken(string: result)) - } else { - tokens.append(createToken(string: scanner.content)) - scanner.content = "" - } - } - - return tokens - } -} - - -class Scanner { - var content: String - - init(_ content: String) { - self.content = content - } - - var isEmpty: Bool { - return content.isEmpty - } - - func scan(until: String, returnUntil: Bool = false) -> String { - if until.isEmpty { - return "" - } - - var index = content.startIndex - while index != content.endIndex { - let substring = content.substring(from: index) - - if substring.hasPrefix(until) { - let result = content.substring(to: index) - content = substring - - if returnUntil { - content = content.substring(from: until.endIndex) - return result + until - } - - return result - } - - index = content.index(after: index) - } - - return "" - } - - func scan(until: [String]) -> (String, String)? { - if until.isEmpty { - return nil - } - - var index = content.startIndex - while index != content.endIndex { - let substring = content.substring(from: index) - for string in until { - if substring.hasPrefix(string) { - let result = content.substring(to: index) - content = substring - return (string, result) - } - } - - index = content.index(after: index) - } - - return nil - } -} - - -extension String { - func findFirstNot(character: Character) -> String.Index? { - var index = startIndex - - while index != endIndex { - if character != self[index] { - return index - } - index = self.index(after: index) - } - - return nil - } - - func findLastNot(character: Character) -> String.Index? { - var index = self.index(before: endIndex) - - while index != startIndex { - if character != self[index] { - return self.index(after: index) - } - index = self.index(before: index) - } - - return nil - } - - func trim(character: Character) -> String { - let first = findFirstNot(character: character) ?? startIndex - let last = findLastNot(character: character) ?? endIndex - return self[first.. Template - func loadTemplate(names: [String], environment: Environment) throws -> Template -} - - -extension Loader { - public func loadTemplate(names: [String], environment: Environment) throws -> Template { - for name in names { - do { - return try loadTemplate(name: name, environment: environment) - } catch is TemplateDoesNotExist { - continue - } catch { - throw error - } - } - - throw TemplateDoesNotExist(templateNames: names, loader: self) - } -} - - -// A class for loading a template from disk -public class FileSystemLoader: Loader, CustomStringConvertible { - public let paths: [Path] - - public init(paths: [Path]) { - self.paths = paths - } - - public init(bundle: [Bundle]) { - self.paths = bundle.map { - return Path($0.bundlePath) - } - } - - public var description: String { - return "FileSystemLoader(\(paths))" - } - - public func loadTemplate(name: String, environment: Environment) throws -> Template { - for path in paths { - let templatePath = try path.safeJoin(path: Path(name)) - - if !templatePath.exists { - continue - } - - let content: String = try templatePath.read() - return try environment.templateClass.init(templateString: content, environment: environment, name: name) - } - - throw TemplateDoesNotExist(templateNames: [name], loader: self) - } - - public func loadTemplate(names: [String], environment: Environment) throws -> Template { - for path in paths { - for templateName in names { - let templatePath = try path.safeJoin(path: Path(templateName)) - - if templatePath.exists { - let content: String = try templatePath.read() - return try environment.templateClass.init(templateString: content, environment: environment, name: templateName) - } - } - } - - throw TemplateDoesNotExist(templateNames: names, loader: self) - } -} - - -extension Path { - func safeJoin(path: Path) throws -> Path { - let newPath = self + path - - if !newPath.absolute().description.hasPrefix(absolute().description) { - throw SuspiciousFileOperation(basePath: self, path: newPath) - } - - return newPath - } -} - - -class SuspiciousFileOperation: Error { - let basePath: Path - let path: Path - - init(basePath: Path, path: Path) { - self.basePath = basePath - self.path = path - } - - var description: String { - return "Path `\(path)` is located outside of base path `\(basePath)`" - } -} diff --git a/Pods/Stencil/Sources/Node.swift b/Pods/Stencil/Sources/Node.swift deleted file mode 100644 index 5b47177..0000000 --- a/Pods/Stencil/Sources/Node.swift +++ /dev/null @@ -1,88 +0,0 @@ -import Foundation - - -public struct TemplateSyntaxError : Error, Equatable, CustomStringConvertible { - public let description:String - - public init(_ description:String) { - self.description = description - } -} - - -public func ==(lhs:TemplateSyntaxError, rhs:TemplateSyntaxError) -> Bool { - return lhs.description == rhs.description -} - - -public protocol NodeType { - /// Render the node in the given context - func render(_ context:Context) throws -> String -} - - -/// Render the collection of nodes in the given context -public func renderNodes(_ nodes:[NodeType], _ context:Context) throws -> String { - return try nodes.map { try $0.render(context) }.joined(separator: "") -} - -public class SimpleNode : NodeType { - public let handler:(Context) throws -> String - - public init(handler: @escaping (Context) throws -> String) { - self.handler = handler - } - - public func render(_ context: Context) throws -> String { - return try handler(context) - } -} - - -public class TextNode : NodeType { - public let text:String - - public init(text:String) { - self.text = text - } - - public func render(_ context:Context) throws -> String { - return self.text - } -} - - -public protocol Resolvable { - func resolve(_ context: Context) throws -> Any? -} - - -public class VariableNode : NodeType { - public let variable: Resolvable - - public init(variable: Resolvable) { - self.variable = variable - } - - public init(variable: String) { - self.variable = Variable(variable) - } - - public func render(_ context: Context) throws -> String { - let result = try variable.resolve(context) - return stringify(result) - } -} - - -func stringify(_ result: Any?) -> String { - if let result = result as? String { - return result - } else if let result = result as? CustomStringConvertible { - return result.description - } else if let result = result as? NSObject { - return result.description - } - - return "" -} diff --git a/Pods/Stencil/Sources/NowTag.swift b/Pods/Stencil/Sources/NowTag.swift deleted file mode 100644 index cd6e4ea..0000000 --- a/Pods/Stencil/Sources/NowTag.swift +++ /dev/null @@ -1,43 +0,0 @@ -#if !os(Linux) -import Foundation - - -class NowNode : NodeType { - let format:Variable - - class func parse(_ parser:TokenParser, token:Token) throws -> NodeType { - var format:Variable? - - let components = token.components() - guard components.count <= 2 else { - throw TemplateSyntaxError("'now' tags may only have one argument: the format string `\(token.contents)`.") - } - if components.count == 2 { - format = Variable(components[1]) - } - - return NowNode(format:format) - } - - init(format:Variable?) { - self.format = format ?? Variable("\"yyyy-MM-dd 'at' HH:mm\"") - } - - func render(_ context: Context) throws -> String { - let date = Date() - let format = try self.format.resolve(context) - var formatter:DateFormatter? - - if let format = format as? DateFormatter { - formatter = format - } else if let format = format as? String { - formatter = DateFormatter() - formatter!.dateFormat = format - } else { - return "" - } - - return formatter!.string(from: date) - } -} -#endif diff --git a/Pods/Stencil/Sources/Parser.swift b/Pods/Stencil/Sources/Parser.swift deleted file mode 100644 index 1a59edb..0000000 --- a/Pods/Stencil/Sources/Parser.swift +++ /dev/null @@ -1,98 +0,0 @@ -public func until(_ tags: [String]) -> ((TokenParser, Token) -> Bool) { - return { parser, token in - if let name = token.components().first { - for tag in tags { - if name == tag { - return true - } - } - } - - return false - } -} - - -/// A class for parsing an array of tokens and converts them into a collection of Node's -public class TokenParser { - public typealias TagParser = (TokenParser, Token) throws -> NodeType - - fileprivate var tokens: [Token] - fileprivate let environment: Environment - - public init(tokens: [Token], environment: Environment) { - self.tokens = tokens - self.environment = environment - } - - /// Parse the given tokens into nodes - public func parse() throws -> [NodeType] { - return try parse(nil) - } - - public func parse(_ parse_until:((_ parser:TokenParser, _ token:Token) -> (Bool))?) throws -> [NodeType] { - var nodes = [NodeType]() - - while tokens.count > 0 { - let token = nextToken()! - - switch token { - case .text(let text): - nodes.append(TextNode(text: text)) - case .variable: - nodes.append(VariableNode(variable: try compileFilter(token.contents))) - case .block: - if let parse_until = parse_until , parse_until(self, token) { - prependToken(token) - return nodes - } - - if let tag = token.components().first { - let parser = try findTag(name: tag) - nodes.append(try parser(self, token)) - } - case .comment: - continue - } - } - - return nodes - } - - public func nextToken() -> Token? { - if tokens.count > 0 { - return tokens.remove(at: 0) - } - - return nil - } - - public func prependToken(_ token:Token) { - tokens.insert(token, at: 0) - } - - func findTag(name: String) throws -> Extension.TagParser { - for ext in environment.extensions { - if let filter = ext.tags[name] { - return filter - } - } - - throw TemplateSyntaxError("Unknown template tag '\(name)'") - } - - func findFilter(_ name: String) throws -> FilterType { - for ext in environment.extensions { - if let filter = ext.filters[name] { - return filter - } - } - - throw TemplateSyntaxError("Unknown filter '\(name)'") - } - - public func compileFilter(_ token: String) throws -> Resolvable { - return try FilterExpression(token: token, parser: self) - } - -} diff --git a/Pods/Stencil/Sources/Template.swift b/Pods/Stencil/Sources/Template.swift deleted file mode 100644 index d9b1893..0000000 --- a/Pods/Stencil/Sources/Template.swift +++ /dev/null @@ -1,77 +0,0 @@ -import Foundation -import PathKit - -#if os(Linux) -let NSFileNoSuchFileError = 4 -#endif - -/// A class representing a template -open class Template: ExpressibleByStringLiteral { - let environment: Environment - let tokens: [Token] - - /// The name of the loaded Template if the Template was loaded from a Loader - public let name: String? - - /// Create a template with a template string - public required init(templateString: String, environment: Environment? = nil, name: String? = nil) { - self.environment = environment ?? Environment() - self.name = name - - let lexer = Lexer(templateString: templateString) - tokens = lexer.tokenize() - } - - /// Create a template with the given name inside the given bundle - @available(*, deprecated, message: "Use Environment/FileSystemLoader instead") - public convenience init(named:String, inBundle bundle:Bundle? = nil) throws { - let useBundle = bundle ?? Bundle.main - guard let url = useBundle.url(forResource: named, withExtension: nil) else { - throw NSError(domain: NSCocoaErrorDomain, code: NSFileNoSuchFileError, userInfo: nil) - } - - try self.init(URL:url) - } - - /// Create a template with a file found at the given URL - @available(*, deprecated, message: "Use Environment/FileSystemLoader instead") - public convenience init(URL:Foundation.URL) throws { - try self.init(path: Path(URL.path)) - } - - /// Create a template with a file found at the given path - @available(*, deprecated, message: "Use Environment/FileSystemLoader instead") - public convenience init(path: Path, environment: Environment? = nil, name: String? = nil) throws { - self.init(templateString: try path.read(), environment: environment, name: name) - } - - // MARK: ExpressibleByStringLiteral - - // Create a templaVte with a template string literal - public convenience required init(stringLiteral value: String) { - self.init(templateString: value) - } - - // Create a template with a template string literal - public convenience required init(extendedGraphemeClusterLiteral value: StringLiteralType) { - self.init(stringLiteral: value) - } - - // Create a template with a template string literal - public convenience required init(unicodeScalarLiteral value: StringLiteralType) { - self.init(stringLiteral: value) - } - - /// Render the given template with a context - func render(_ context: Context) throws -> String { - let context = context - let parser = TokenParser(tokens: tokens, environment: context.environment) - let nodes = try parser.parse() - return try renderNodes(nodes, context) - } - - /// Render the given template - open func render(_ dictionary: [String: Any]? = nil) throws -> String { - return try render(Context(dictionary: dictionary, environment: environment)) - } -} diff --git a/Pods/Stencil/Sources/Tokenizer.swift b/Pods/Stencil/Sources/Tokenizer.swift deleted file mode 100644 index 18713bc..0000000 --- a/Pods/Stencil/Sources/Tokenizer.swift +++ /dev/null @@ -1,95 +0,0 @@ -import Foundation - - -extension String { - /// Split a string by a separator leaving quoted phrases together - func smartSplit(separator: Character = " ") -> [String] { - var word = "" - var components: [String] = [] - var separate: Character = separator - - for character in self.characters { - if character == separate { - if separate != separator { - word.append(separate) - } - - if !word.isEmpty { - components.append(word) - word = "" - } - - separate = separator - } else { - if separate == separator && (character == "'" || character == "\"") { - separate = character - } - word.append(character) - } - } - - if !word.isEmpty { - components.append(word) - } - - return components - } -} - - -public enum Token : Equatable { - /// A token representing a piece of text. - case text(value: String) - - /// A token representing a variable. - case variable(value: String) - - /// A token representing a comment. - case comment(value: String) - - /// A token representing a template block. - case block(value: String) - - /// Returns the underlying value as an array seperated by spaces - public func components() -> [String] { - switch self { - case .block(let value): - return value.smartSplit() - case .variable(let value): - return value.smartSplit() - case .text(let value): - return value.smartSplit() - case .comment(let value): - return value.smartSplit() - } - } - - public var contents: String { - switch self { - case .block(let value): - return value - case .variable(let value): - return value - case .text(let value): - return value - case .comment(let value): - return value - } - } -} - - -public func == (lhs: Token, rhs: Token) -> Bool { - switch (lhs, rhs) { - case (.text(let lhsValue), .text(let rhsValue)): - return lhsValue == rhsValue - case (.variable(let lhsValue), .variable(let rhsValue)): - return lhsValue == rhsValue - case (.block(let lhsValue), .block(let rhsValue)): - return lhsValue == rhsValue - case (.comment(let lhsValue), .comment(let rhsValue)): - return lhsValue == rhsValue - default: - return false - } -} diff --git a/Pods/Stencil/Sources/Variable.swift b/Pods/Stencil/Sources/Variable.swift deleted file mode 100644 index ea0353a..0000000 --- a/Pods/Stencil/Sources/Variable.swift +++ /dev/null @@ -1,173 +0,0 @@ -import Foundation - - -typealias Number = Float - - -class FilterExpression : Resolvable { - let filters: [(FilterType, [Variable])] - let variable: Variable - - init(token: String, parser: TokenParser) throws { - let bits = token.characters.split(separator: "|").map({ String($0).trim(character: " ") }) - if bits.isEmpty { - filters = [] - variable = Variable("") - throw TemplateSyntaxError("Variable tags must include at least 1 argument") - } - - variable = Variable(bits[0]) - let filterBits = bits[bits.indices.suffix(from: 1)] - - do { - filters = try filterBits.map { - let (name, arguments) = parseFilterComponents(token: $0) - let filter = try parser.findFilter(name) - return (filter, arguments) - } - } catch { - filters = [] - throw error - } - } - - func resolve(_ context: Context) throws -> Any? { - let result = try variable.resolve(context) - - return try filters.reduce(result) { x, y in - let arguments = try y.1.map { try $0.resolve(context) } - return try y.0.invoke(value: x, arguments: arguments) - } - } -} - -/// A structure used to represent a template variable, and to resolve it in a given context. -public struct Variable : Equatable, Resolvable { - public let variable: String - - /// Create a variable with a string representing the variable - public init(_ variable: String) { - self.variable = variable - } - - fileprivate func lookup() -> [String] { - return variable.characters.split(separator: ".").map(String.init) - } - - /// Resolve the variable in the given context - public func resolve(_ context: Context) throws -> Any? { - var current: Any? = context - - if (variable.hasPrefix("'") && variable.hasSuffix("'")) || (variable.hasPrefix("\"") && variable.hasSuffix("\"")) { - // String literal - return variable[variable.characters.index(after: variable.startIndex) ..< variable.characters.index(before: variable.endIndex)] - } - - if let number = Number(variable) { - // Number literal - return number - } - - for bit in lookup() { - current = normalize(current) - - if let context = current as? Context { - current = context[bit] - } else if let dictionary = current as? [String: Any] { - 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 - } - } else if let object = current as? NSObject { // NSKeyValueCoding -#if os(Linux) - return nil -#else - current = object.value(forKey: bit) -#endif - } else if let value = current { - let mirror = Mirror(reflecting: value) - current = mirror.descendant(bit) - - if current == nil { - return nil - } - } else { - return nil - } - } - - if let resolvable = current as? Resolvable { - current = try resolvable.resolve(context) - } else if let node = current as? NodeType { - current = try node.render(context) - } - - return normalize(current) - } -} - -public func ==(lhs: Variable, rhs: Variable) -> Bool { - return lhs.variable == rhs.variable -} - - -func normalize(_ current: Any?) -> Any? { - if let current = current as? Normalizable { - return current.normalize() - } - - return current -} - -protocol Normalizable { - func normalize() -> Any? -} - -extension Array : Normalizable { - func normalize() -> Any? { - return map { $0 as Any } - } -} - -extension NSArray : Normalizable { - func normalize() -> Any? { - return map { $0 as Any } - } -} - -extension Dictionary : Normalizable { - func normalize() -> Any? { - var dictionary: [String: Any] = [:] - - for (key, value) in self { - if let key = key as? String { - dictionary[key] = Stencil.normalize(value) - } else if let key = key as? CustomStringConvertible { - dictionary[key.description] = Stencil.normalize(value) - } - } - - return dictionary - } -} - -func parseFilterComponents(token: String) -> (String, [Variable]) { - var components = token.smartSplit(separator: ":") - let name = components.removeFirst() - let variables = components - .joined(separator: ":") - .smartSplit(separator: ",") - .map { Variable($0) } - return (name, variables) -} diff --git a/Pods/Target Support Files/PathKit/Info.plist b/Pods/Target Support Files/PathKit/Info.plist index 75ba4d0..2cf03a7 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.7.0 + 0.8.0 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 95af982..b1f5731 100644 --- a/Pods/Target Support Files/Pods-Tests/Pods-Tests-acknowledgements.markdown +++ b/Pods/Target Support Files/Pods-Tests/Pods-Tests-acknowledgements.markdown @@ -28,34 +28,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -## Stencil - -Copyright (c) 2014, Kyle Fuller -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -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. - - - ## SwiftGenKit 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 2b50f69..7274c80 100644 --- a/Pods/Target Support Files/Pods-Tests/Pods-Tests-acknowledgements.plist +++ b/Pods/Target Support Files/Pods-Tests/Pods-Tests-acknowledgements.plist @@ -45,40 +45,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Type PSGroupSpecifier - - FooterText - Copyright (c) 2014, Kyle Fuller -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -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 - Title - Stencil - Type - PSGroupSpecifier - FooterText MIT License 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 66b6862..f06a001 100755 --- a/Pods/Target Support Files/Pods-Tests/Pods-Tests-frameworks.sh +++ b/Pods/Target Support Files/Pods-Tests/Pods-Tests-frameworks.sh @@ -90,12 +90,10 @@ strip_invalid_archs() { if [[ "$CONFIGURATION" == "Debug" ]]; then install_framework "$BUILT_PRODUCTS_DIR/PathKit/PathKit.framework" - install_framework "$BUILT_PRODUCTS_DIR/Stencil/Stencil.framework" install_framework "$BUILT_PRODUCTS_DIR/SwiftGenKit/SwiftGenKit.framework" fi if [[ "$CONFIGURATION" == "Release" ]]; then install_framework "$BUILT_PRODUCTS_DIR/PathKit/PathKit.framework" - install_framework "$BUILT_PRODUCTS_DIR/Stencil/Stencil.framework" install_framework "$BUILT_PRODUCTS_DIR/SwiftGenKit/SwiftGenKit.framework" fi if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 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 d2a5b21..c2cadb4 100644 --- a/Pods/Target Support Files/Pods-Tests/Pods-Tests.debug.xcconfig +++ b/Pods/Target Support Files/Pods-Tests/Pods-Tests.debug.xcconfig @@ -1,10 +1,10 @@ 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/SwiftGenKit" +FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/PathKit" "$PODS_CONFIGURATION_BUILD_DIR/SwiftGenKit" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 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/SwiftGenKit/SwiftGenKit.framework/Headers" -OTHER_LDFLAGS = $(inherited) -framework "PathKit" -framework "Stencil" -framework "SwiftGenKit" +OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/PathKit/PathKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SwiftGenKit/SwiftGenKit.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "PathKit" -framework "SwiftGenKit" 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.release.xcconfig b/Pods/Target Support Files/Pods-Tests/Pods-Tests.release.xcconfig index d2a5b21..c2cadb4 100644 --- a/Pods/Target Support Files/Pods-Tests/Pods-Tests.release.xcconfig +++ b/Pods/Target Support Files/Pods-Tests/Pods-Tests.release.xcconfig @@ -1,10 +1,10 @@ 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/SwiftGenKit" +FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/PathKit" "$PODS_CONFIGURATION_BUILD_DIR/SwiftGenKit" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 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/SwiftGenKit/SwiftGenKit.framework/Headers" -OTHER_LDFLAGS = $(inherited) -framework "PathKit" -framework "Stencil" -framework "SwiftGenKit" +OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/PathKit/PathKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SwiftGenKit/SwiftGenKit.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "PathKit" -framework "SwiftGenKit" 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/Stencil/Info.plist b/Pods/Target Support Files/Stencil/Info.plist deleted file mode 100644 index cc1a0c6..0000000 --- a/Pods/Target Support Files/Stencil/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - ${PRODUCT_BUNDLE_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - FMWK - CFBundleShortVersionString - 0.7.1 - CFBundleSignature - ???? - CFBundleVersion - ${CURRENT_PROJECT_VERSION} - NSPrincipalClass - - - diff --git a/Pods/Target Support Files/Stencil/Stencil-dummy.m b/Pods/Target Support Files/Stencil/Stencil-dummy.m deleted file mode 100644 index faace6f..0000000 --- a/Pods/Target Support Files/Stencil/Stencil-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_Stencil : NSObject -@end -@implementation PodsDummy_Stencil -@end diff --git a/Pods/Target Support Files/Stencil/Stencil-prefix.pch b/Pods/Target Support Files/Stencil/Stencil-prefix.pch deleted file mode 100644 index 082f8af..0000000 --- a/Pods/Target Support Files/Stencil/Stencil-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/Pods/Target Support Files/Stencil/Stencil-umbrella.h b/Pods/Target Support Files/Stencil/Stencil-umbrella.h deleted file mode 100644 index 92fb219..0000000 --- a/Pods/Target Support Files/Stencil/Stencil-umbrella.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - - -FOUNDATION_EXPORT double StencilVersionNumber; -FOUNDATION_EXPORT const unsigned char StencilVersionString[]; - diff --git a/Pods/Target Support Files/Stencil/Stencil.modulemap b/Pods/Target Support Files/Stencil/Stencil.modulemap deleted file mode 100644 index 37e43bb..0000000 --- a/Pods/Target Support Files/Stencil/Stencil.modulemap +++ /dev/null @@ -1,6 +0,0 @@ -framework module Stencil { - umbrella header "Stencil-umbrella.h" - - export * - module * { export * } -} diff --git a/Pods/Target Support Files/Stencil/Stencil.xcconfig b/Pods/Target Support Files/Stencil/Stencil.xcconfig deleted file mode 100644 index 2819d38..0000000 --- a/Pods/Target Support Files/Stencil/Stencil.xcconfig +++ /dev/null @@ -1,12 +0,0 @@ -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" -OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" "-suppress-warnings" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/Stencil -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/Pods/Target Support Files/SwiftGenKit/Info.plist b/Pods/Target Support Files/SwiftGenKit/Info.plist index 2243fe6..3c175b6 100644 --- a/Pods/Target Support Files/SwiftGenKit/Info.plist +++ b/Pods/Target Support Files/SwiftGenKit/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.0.0 + 1.0.1 CFBundleSignature ???? CFBundleVersion diff --git a/README.md b/README.md index ff19b06..4c270a5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # SwiftGenKit -[![Build Status](https://travis-ci.org/SwiftGen/SwiftGenKit.svg?branch=master)](https://travis-ci.org/SwiftGen/SwiftGenKit) +[![CircleCI](https://circleci.com/gh/SwiftGen/SwiftGenKit/tree/master.svg?style=svg)](https://circleci.com/gh/SwiftGen/SwiftGenKit/tree/master) [![CocoaPods Compatible](https://img.shields.io/cocoapods/v/SwiftGenKit.svg)](https://img.shields.io/cocoapods/v/SwiftGenKit.svg) [![Platform](https://img.shields.io/cocoapods/p/SwiftGenKit.svg?style=flat)](http://cocoadocs.org/docsets/SwiftGenKit) ![Swift 3.0](https://img.shields.io/badge/Swift-3.0-orange.svg) diff --git a/Rakefile b/Rakefile index af81ca7..49d6345 100644 --- a/Rakefile +++ b/Rakefile @@ -1,23 +1,11 @@ -def xcpretty(cmd) - if `which xcpretty` && $?.success? - sh "set -o pipefail && #{cmd} | xcpretty -c" - else - sh cmd - end -end +#!/usr/bin/rake -task :build_for_testing do - xcpretty "xcodebuild -workspace SwiftGenKit.xcworkspace -scheme Tests build-for-testing" -end +## [ Constants ] ############################################################## -desc 'Run Unit Tests' -task :test => :build_for_testing do - xcpretty "xcodebuild -workspace SwiftGenKit.xcworkspace -scheme Tests test-without-building" -end +WORKSPACE = 'SwiftGenKit' +SCHEME_NAME = 'Tests' +CONFIGURATION = 'Debug' +POD_NAME = 'SwiftGenKit' -desc 'Lint the Pod' -task :lint do - sh "pod lib lint SwiftGenKit.podspec --quick" -end -task :default => :test +task :default => 'xcode:test' diff --git a/Sources/Parsers/AssetsCatalogParser.swift b/Sources/Parsers/AssetsCatalogParser.swift index 3bbc7f0..7ca1cb3 100644 --- a/Sources/Parsers/AssetsCatalogParser.swift +++ b/Sources/Parsers/AssetsCatalogParser.swift @@ -36,10 +36,10 @@ private enum AssetCatalog { static let filename = "filename" static let providesNamespace = "provides-namespace" static let root = "com.apple.actool.catalog-contents" - + enum Extension { static let imageSet = "imageset" - + /** * This is a list of supported asset catalog item types, for now we just * support `image set`s. If you want to add support for new types, just add diff --git a/Sources/Parsers/ColorsFileParser.swift b/Sources/Parsers/ColorsFileParser.swift index d73c48f..73995f0 100644 --- a/Sources/Parsers/ColorsFileParser.swift +++ b/Sources/Parsers/ColorsFileParser.swift @@ -176,9 +176,9 @@ public final class ColorsXMLFileParser: ColorsFileParser { private class ParserDelegate: NSObject, XMLParserDelegate { var parsedColors = [String: UInt32]() - var currentColorName: String? = nil - var currentColorValue: String? = nil - var colorParserError: Error? = nil + var currentColorName: String? + var currentColorValue: String? + var colorParserError: Error? @objc func parser(_ parser: XMLParser, didStartElement elementName: String, namespaceURI: String?, qualifiedName qName: String?, diff --git a/Sources/Stencil/AssetsCatalogContext.swift b/Sources/Stencil/AssetsCatalogContext.swift index c0fc39c..17c2f11 100644 --- a/Sources/Stencil/AssetsCatalogContext.swift +++ b/Sources/Stencil/AssetsCatalogContext.swift @@ -23,7 +23,7 @@ extension AssetsCatalogParser { return [ "enumName": enumName, "catalogs": structured, - + // NOTE: This is a deprecated variable "images": images ] diff --git a/Sources/Stencil/FontsContext.swift b/Sources/Stencil/FontsContext.swift index 1c682a1..791c79a 100644 --- a/Sources/Stencil/FontsContext.swift +++ b/Sources/Stencil/FontsContext.swift @@ -6,7 +6,6 @@ import Foundation - /* - `enumName`: `String` - `families`: `Array` diff --git a/Sources/Stencil/StoryboardsContext.swift b/Sources/Stencil/StoryboardsContext.swift index 06f49c9..711ef24 100644 --- a/Sources/Stencil/StoryboardsContext.swift +++ b/Sources/Stencil/StoryboardsContext.swift @@ -37,7 +37,7 @@ private func uppercaseFirst(_ string: String) -> String { */ extension StoryboardParser { public func stencilContext(sceneEnumName: String = "StoryboardScene", - segueEnumName: String = "StoryboardSegue") -> [String: Any] { + segueEnumName: String = "StoryboardSegue") -> [String: Any] { let storyboards = Set(storyboardsScenes.keys).union(storyboardsSegues.keys).sorted(by: <) let storyboardsMap = storyboards.map { (storyboardName: String) -> [String:Any] in var sbMap: [String:Any] = ["name": storyboardName] @@ -49,7 +49,7 @@ extension StoryboardParser { } else { initial = [ "baseType": uppercaseFirst(initialScene.tag), - + // NOTE: This is a deprecated variable "isBaseViewController": initialScene.tag == "viewController" ] @@ -71,7 +71,7 @@ extension StoryboardParser { return [ "identifier": scene.storyboardID, "baseType": uppercaseFirst(scene.tag), - + // NOTE: This is a deprecated variable "isBaseViewController": scene.tag == "viewController" ] diff --git a/Sources/Stencil/StringsContext.swift b/Sources/Stencil/StringsContext.swift index f44bae4..4758828 100644 --- a/Sources/Stencil/StringsContext.swift +++ b/Sources/Stencil/StringsContext.swift @@ -41,7 +41,7 @@ extension StringsFileParser { if entry.types.count > 0 { let params: [String: Any] = [ "types": entry.types.map { $0.rawValue }, - + // NOTE: These are deprecated variables "count": entry.types.count, "declarations": entry.types.indices.map { "let p\($0)" }, diff --git a/SwiftGenKit.xcodeproj/project.pbxproj b/SwiftGenKit.xcodeproj/project.pbxproj index 7f96263..66e09a9 100644 --- a/SwiftGenKit.xcodeproj/project.pbxproj +++ b/SwiftGenKit.xcodeproj/project.pbxproj @@ -8,18 +8,18 @@ /* Begin PBXBuildFile section */ 82EF0CC0752D216C67279A16 /* Pods_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8BF798509C76E5A9ACE03491 /* Pods_Tests.framework */; }; - DD5F341B1E21993A00AEB5DA /* TestsHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD5F341A1E21993A00AEB5DA /* TestsHelper.swift */; }; - DD5F34391E21B72900AEB5DA /* FontsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD5F34341E21B72900AEB5DA /* FontsTests.swift */; }; - DD5F34C71E21B76500AEB5DA /* Fixtures in Resources */ = {isa = PBXBuildFile; fileRef = DD5F34C51E21B76500AEB5DA /* Fixtures */; }; - DD5F34D61E2293B400AEB5DA /* Contexts in Resources */ = {isa = PBXBuildFile; fileRef = DD5F34D51E2293B400AEB5DA /* Contexts */; }; - DD5F34D71E22B20300AEB5DA /* ImagesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD5F34351E21B72900AEB5DA /* ImagesTests.swift */; }; - DD5F34D81E22B30F00AEB5DA /* ColorsCLRFileTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD5F34CA1E21D2CB00AEB5DA /* ColorsCLRFileTests.swift */; }; - DD5F34D91E22B3A300AEB5DA /* ColorsJSONFileTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD5F34CB1E21D2CB00AEB5DA /* ColorsJSONFileTests.swift */; }; - DD5F34DA1E22B41500AEB5DA /* ColorsTextFileTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD5F34CC1E21D2CB00AEB5DA /* ColorsTextFileTests.swift */; }; - DD5F34DB1E22B4BF00AEB5DA /* ColorsXMLFileTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD5F34CD1E21D2CB00AEB5DA /* ColorsXMLFileTests.swift */; }; - DD5F34DC1E22BA8A00AEB5DA /* StringsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD5F34371E21B72900AEB5DA /* StringsTests.swift */; }; - DD5F34E01E22CA5400AEB5DA /* StoryboardsiOSTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD5F34DE1E22CA5400AEB5DA /* StoryboardsiOSTests.swift */; }; - DD5F34E11E22CA5400AEB5DA /* StoryboardsMacOSTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD5F34DF1E22CA5400AEB5DA /* StoryboardsMacOSTests.swift */; }; + DDF573231E6103DC0033C01B /* ColorsCLRFileTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDF573171E6103DC0033C01B /* ColorsCLRFileTests.swift */; }; + DDF573241E6103DC0033C01B /* ColorsJSONFileTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDF573181E6103DC0033C01B /* ColorsJSONFileTests.swift */; }; + DDF573251E6103DC0033C01B /* ColorsTextFileTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDF573191E6103DC0033C01B /* ColorsTextFileTests.swift */; }; + DDF573261E6103DC0033C01B /* ColorsXMLFileTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDF5731A1E6103DC0033C01B /* ColorsXMLFileTests.swift */; }; + DDF573271E6103DC0033C01B /* FontsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDF5731B1E6103DC0033C01B /* FontsTests.swift */; }; + DDF573281E6103DC0033C01B /* ImagesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDF5731C1E6103DC0033C01B /* ImagesTests.swift */; }; + DDF5732A1E6103DC0033C01B /* StoryboardsiOSTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDF5731F1E6103DC0033C01B /* StoryboardsiOSTests.swift */; }; + DDF5732B1E6103DC0033C01B /* StoryboardsMacOSTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDF573201E6103DC0033C01B /* StoryboardsMacOSTests.swift */; }; + DDF5732C1E6103DC0033C01B /* StringsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDF573211E6103DC0033C01B /* StringsTests.swift */; }; + DDF5732D1E6103DC0033C01B /* TestsHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDF573221E6103DC0033C01B /* TestsHelper.swift */; }; + DDF573301E6103F90033C01B /* Contexts in Resources */ = {isa = PBXBuildFile; fileRef = DDF5732E1E6103F90033C01B /* Contexts */; }; + DDF573311E6103F90033C01B /* Fixtures in Resources */ = {isa = PBXBuildFile; fileRef = DDF5732F1E6103F90033C01B /* Fixtures */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -27,18 +27,19 @@ 47888DD528DEC4C84FD8F15B /* Pods-Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Tests/Pods-Tests.debug.xcconfig"; sourceTree = ""; }; 4B3D39DBCD15D8F6BB891D92 /* Pods-Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-Tests/Pods-Tests.release.xcconfig"; sourceTree = ""; }; 8BF798509C76E5A9ACE03491 /* Pods_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - DD5F341A1E21993A00AEB5DA /* TestsHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestsHelper.swift; sourceTree = ""; }; - DD5F34341E21B72900AEB5DA /* FontsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FontsTests.swift; sourceTree = ""; }; - DD5F34351E21B72900AEB5DA /* ImagesTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImagesTests.swift; sourceTree = ""; }; - DD5F34371E21B72900AEB5DA /* StringsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StringsTests.swift; sourceTree = ""; }; - DD5F34C51E21B76500AEB5DA /* Fixtures */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Fixtures; sourceTree = ""; }; - DD5F34CA1E21D2CB00AEB5DA /* ColorsCLRFileTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ColorsCLRFileTests.swift; sourceTree = ""; }; - DD5F34CB1E21D2CB00AEB5DA /* ColorsJSONFileTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ColorsJSONFileTests.swift; sourceTree = ""; }; - DD5F34CC1E21D2CB00AEB5DA /* ColorsTextFileTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ColorsTextFileTests.swift; sourceTree = ""; }; - DD5F34CD1E21D2CB00AEB5DA /* ColorsXMLFileTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ColorsXMLFileTests.swift; sourceTree = ""; }; - DD5F34D51E2293B400AEB5DA /* Contexts */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Contexts; sourceTree = ""; }; - DD5F34DE1E22CA5400AEB5DA /* StoryboardsiOSTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoryboardsiOSTests.swift; sourceTree = ""; }; - DD5F34DF1E22CA5400AEB5DA /* StoryboardsMacOSTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoryboardsMacOSTests.swift; sourceTree = ""; }; + DDF573171E6103DC0033C01B /* ColorsCLRFileTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ColorsCLRFileTests.swift; sourceTree = ""; }; + DDF573181E6103DC0033C01B /* ColorsJSONFileTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ColorsJSONFileTests.swift; sourceTree = ""; }; + DDF573191E6103DC0033C01B /* ColorsTextFileTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ColorsTextFileTests.swift; sourceTree = ""; }; + DDF5731A1E6103DC0033C01B /* ColorsXMLFileTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ColorsXMLFileTests.swift; sourceTree = ""; }; + DDF5731B1E6103DC0033C01B /* FontsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FontsTests.swift; sourceTree = ""; }; + DDF5731C1E6103DC0033C01B /* ImagesTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImagesTests.swift; sourceTree = ""; }; + DDF5731E1E6103DC0033C01B /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + DDF5731F1E6103DC0033C01B /* StoryboardsiOSTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoryboardsiOSTests.swift; sourceTree = ""; }; + DDF573201E6103DC0033C01B /* StoryboardsMacOSTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoryboardsMacOSTests.swift; sourceTree = ""; }; + DDF573211E6103DC0033C01B /* StringsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StringsTests.swift; sourceTree = ""; }; + DDF573221E6103DC0033C01B /* TestsHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestsHelper.swift; sourceTree = ""; }; + DDF5732E1E6103F90033C01B /* Contexts */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Contexts; path = Tests/Resources/Contexts; sourceTree = SOURCE_ROOT; }; + DDF5732F1E6103F90033C01B /* Fixtures */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Fixtures; path = Tests/Resources/Fixtures; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -94,34 +95,35 @@ DD5F34111E21657700AEB5DA /* Tests */ = { isa = PBXGroup; children = ( - DD5F34411E21B75400AEB5DA /* Resources */, - DD5F34321E21B72900AEB5DA /* TestSuites */, - DD5F341A1E21993A00AEB5DA /* TestsHelper.swift */, + DDF573161E6103DC0033C01B /* SwiftGenKitTests */, ); path = Tests; sourceTree = ""; }; - DD5F34321E21B72900AEB5DA /* TestSuites */ = { + DDF573161E6103DC0033C01B /* SwiftGenKitTests */ = { isa = PBXGroup; children = ( - DD5F34CA1E21D2CB00AEB5DA /* ColorsCLRFileTests.swift */, - DD5F34CB1E21D2CB00AEB5DA /* ColorsJSONFileTests.swift */, - DD5F34CC1E21D2CB00AEB5DA /* ColorsTextFileTests.swift */, - DD5F34CD1E21D2CB00AEB5DA /* ColorsXMLFileTests.swift */, - DD5F34341E21B72900AEB5DA /* FontsTests.swift */, - DD5F34351E21B72900AEB5DA /* ImagesTests.swift */, - DD5F34371E21B72900AEB5DA /* StringsTests.swift */, - DD5F34DE1E22CA5400AEB5DA /* StoryboardsiOSTests.swift */, - DD5F34DF1E22CA5400AEB5DA /* StoryboardsMacOSTests.swift */, + DDF5731D1E6103DC0033C01B /* Resources */, + DDF573171E6103DC0033C01B /* ColorsCLRFileTests.swift */, + DDF573181E6103DC0033C01B /* ColorsJSONFileTests.swift */, + DDF573191E6103DC0033C01B /* ColorsTextFileTests.swift */, + DDF5731A1E6103DC0033C01B /* ColorsXMLFileTests.swift */, + DDF5731B1E6103DC0033C01B /* FontsTests.swift */, + DDF5731C1E6103DC0033C01B /* ImagesTests.swift */, + DDF5731F1E6103DC0033C01B /* StoryboardsiOSTests.swift */, + DDF573201E6103DC0033C01B /* StoryboardsMacOSTests.swift */, + DDF573211E6103DC0033C01B /* StringsTests.swift */, + DDF573221E6103DC0033C01B /* TestsHelper.swift */, ); - path = TestSuites; + path = SwiftGenKitTests; sourceTree = ""; }; - DD5F34411E21B75400AEB5DA /* Resources */ = { + DDF5731D1E6103DC0033C01B /* Resources */ = { isa = PBXGroup; children = ( - DD5F34D51E2293B400AEB5DA /* Contexts */, - DD5F34C51E21B76500AEB5DA /* Fixtures */, + DDF5732E1E6103F90033C01B /* Contexts */, + DDF5732F1E6103F90033C01B /* Fixtures */, + DDF5731E1E6103DC0033C01B /* Info.plist */, ); path = Resources; sourceTree = ""; @@ -134,6 +136,7 @@ buildConfigurationList = 09A87B551BCCA2C600D9B9F5 /* Build configuration list for PBXNativeTarget "Tests" */; buildPhases = ( C3989F9D7584D08720E81BDA /* [CP] Check Pods Manifest.lock */, + DD3EE1BA1E65DB7B00EA1599 /* ⚠️ SwiftLint */, 09A87B4C1BCCA2C600D9B9F5 /* Sources */, 09A87B4D1BCCA2C600D9B9F5 /* Frameworks */, 09A87B4E1BCCA2C600D9B9F5 /* Resources */, @@ -188,8 +191,8 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - DD5F34D61E2293B400AEB5DA /* Contexts in Resources */, - DD5F34C71E21B76500AEB5DA /* Fixtures in Resources */, + DDF573311E6103F90033C01B /* Fixtures in Resources */, + DDF573301E6103F90033C01B /* Contexts in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -211,6 +214,20 @@ shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; showEnvVarsInLog = 0; }; + DD3EE1BA1E65DB7B00EA1599 /* ⚠️ SwiftLint */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "⚠️ SwiftLint"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "if [[ ! $CI ]]; then\n rake lint:code\n rake lint:tests\nfi"; + }; DE127EA8748200EF28090721 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -248,16 +265,16 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - DD5F34D71E22B20300AEB5DA /* ImagesTests.swift in Sources */, - DD5F34D81E22B30F00AEB5DA /* ColorsCLRFileTests.swift in Sources */, - DD5F34DC1E22BA8A00AEB5DA /* StringsTests.swift in Sources */, - DD5F34391E21B72900AEB5DA /* FontsTests.swift in Sources */, - DD5F341B1E21993A00AEB5DA /* TestsHelper.swift in Sources */, - DD5F34DB1E22B4BF00AEB5DA /* ColorsXMLFileTests.swift in Sources */, - DD5F34DA1E22B41500AEB5DA /* ColorsTextFileTests.swift in Sources */, - DD5F34E01E22CA5400AEB5DA /* StoryboardsiOSTests.swift in Sources */, - DD5F34D91E22B3A300AEB5DA /* ColorsJSONFileTests.swift in Sources */, - DD5F34E11E22CA5400AEB5DA /* StoryboardsMacOSTests.swift in Sources */, + DDF5732B1E6103DC0033C01B /* StoryboardsMacOSTests.swift in Sources */, + DDF5732D1E6103DC0033C01B /* TestsHelper.swift in Sources */, + DDF573231E6103DC0033C01B /* ColorsCLRFileTests.swift in Sources */, + DDF573261E6103DC0033C01B /* ColorsXMLFileTests.swift in Sources */, + DDF573251E6103DC0033C01B /* ColorsTextFileTests.swift in Sources */, + DDF573281E6103DC0033C01B /* ImagesTests.swift in Sources */, + DDF5732C1E6103DC0033C01B /* StringsTests.swift in Sources */, + DDF573241E6103DC0033C01B /* ColorsJSONFileTests.swift in Sources */, + DDF5732A1E6103DC0033C01B /* StoryboardsiOSTests.swift in Sources */, + DDF573271E6103DC0033C01B /* FontsTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -354,7 +371,7 @@ baseConfigurationReference = 47888DD528DEC4C84FD8F15B /* Pods-Tests.debug.xcconfig */; buildSettings = { COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = Tests/Info.plist; + INFOPLIST_FILE = Tests/SwiftGenKitTests/Resources/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_BUNDLE_IDENTIFIER = com.alisoftware.SwiftGenKitTests; @@ -368,7 +385,7 @@ baseConfigurationReference = 4B3D39DBCD15D8F6BB891D92 /* Pods-Tests.release.xcconfig */; buildSettings = { COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = Tests/Info.plist; + INFOPLIST_FILE = Tests/SwiftGenKitTests/Resources/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_BUNDLE_IDENTIFIER = com.alisoftware.SwiftGenKitTests; diff --git a/SwiftGenKit.xcworkspace/xcshareddata/SwiftGenKit.xcscmblueprint b/SwiftGenKit.xcworkspace/xcshareddata/SwiftGenKit.xcscmblueprint deleted file mode 100644 index 4d70151..0000000 --- a/SwiftGenKit.xcworkspace/xcshareddata/SwiftGenKit.xcscmblueprint +++ /dev/null @@ -1,30 +0,0 @@ -{ - "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "AEF165BA8F93126FEE01F9EEA4D115525F732D3E", - "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { - - }, - "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { - "09C809DD6F7EA7924A5C2AA89D4846DBCD528769" : 9223372036854775807, - "AEF165BA8F93126FEE01F9EEA4D115525F732D3E" : 9223372036854775807 - }, - "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "26B01BE5-8DA0-49F3-94B8-DDFE91ACFA0A", - "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { - "09C809DD6F7EA7924A5C2AA89D4846DBCD528769" : "SwiftGenKit\/Tests\/Resources\/", - "AEF165BA8F93126FEE01F9EEA4D115525F732D3E" : "SwiftGenKit\/" - }, - "DVTSourceControlWorkspaceBlueprintNameKey" : "SwiftGenKit", - "DVTSourceControlWorkspaceBlueprintVersion" : 204, - "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "SwiftGenKit.xcworkspace", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:SwiftGen\/templates.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "09C809DD6F7EA7924A5C2AA89D4846DBCD528769" - }, - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:SwiftGen\/SwiftGenKit.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "AEF165BA8F93126FEE01F9EEA4D115525F732D3E" - } - ] -} \ No newline at end of file diff --git a/Tests/TestSuites/ColorsCLRFileTests.swift b/Tests/SwiftGenKitTests/ColorsCLRFileTests.swift similarity index 84% rename from Tests/TestSuites/ColorsCLRFileTests.swift rename to Tests/SwiftGenKitTests/ColorsCLRFileTests.swift index 2c260c2..c1153e1 100644 --- a/Tests/TestSuites/ColorsCLRFileTests.swift +++ b/Tests/SwiftGenKitTests/ColorsCLRFileTests.swift @@ -14,27 +14,27 @@ class ColorsCLRFileTests: XCTestCase { let result = parser.stencilContext() let expected = Fixtures.context(for: "empty.plist", sub: .colors) - + XCTDiffContexts(result, expected) } - func testFileWithDefaults() { + func testFileWithDefaults() throws { let parser = ColorsCLRFileParser() - try! parser.parseFile(at: Fixtures.path(for: "colors.clr", sub: .colors)) + try parser.parseFile(at: Fixtures.path(for: "colors.clr", sub: .colors)) let result = parser.stencilContext() let expected = Fixtures.context(for: "defaults.plist", sub: .colors) - + XCTDiffContexts(result, expected) } - func testFileWithCustomName() { + func testFileWithCustomName() throws { let parser = ColorsCLRFileParser() - try! parser.parseFile(at: Fixtures.path(for: "colors.clr", sub: .colors)) + try parser.parseFile(at: Fixtures.path(for: "colors.clr", sub: .colors)) let result = parser.stencilContext(enumName: "XCTColors") let expected = Fixtures.context(for: "customname.plist", sub: .colors) - + XCTDiffContexts(result, expected) } diff --git a/Tests/TestSuites/ColorsJSONFileTests.swift b/Tests/SwiftGenKitTests/ColorsJSONFileTests.swift similarity index 81% rename from Tests/TestSuites/ColorsJSONFileTests.swift rename to Tests/SwiftGenKitTests/ColorsJSONFileTests.swift index d4ab680..cc27002 100644 --- a/Tests/TestSuites/ColorsJSONFileTests.swift +++ b/Tests/SwiftGenKitTests/ColorsJSONFileTests.swift @@ -14,35 +14,27 @@ class ColorsJSONFileTests: XCTestCase { let result = parser.stencilContext() let expected = Fixtures.context(for: "empty.plist", sub: .colors) - + XCTDiffContexts(result, expected) } - func testFileWithDefaults() { + func testFileWithDefaults() throws { let parser = ColorsJSONFileParser() - do { - try parser.parseFile(at: Fixtures.path(for: "colors.json", sub: .colors)) - } catch { - XCTFail("Exception while parsing file: \(error)") - } + try parser.parseFile(at: Fixtures.path(for: "colors.json", sub: .colors)) let result = parser.stencilContext() let expected = Fixtures.context(for: "defaults.plist", sub: .colors) - + XCTDiffContexts(result, expected) } - func testFileWithCustomName() { + func testFileWithCustomName() throws { let parser = ColorsJSONFileParser() - do { - try parser.parseFile(at: Fixtures.path(for: "colors.json", sub: .colors)) - } catch { - XCTFail("Exception while parsing file: \(error)") - } + try parser.parseFile(at: Fixtures.path(for: "colors.json", sub: .colors)) let result = parser.stencilContext(enumName: "XCTColors") let expected = Fixtures.context(for: "customname.plist", sub: .colors) - + XCTDiffContexts(result, expected) } diff --git a/Tests/TestSuites/ColorsTextFileTests.swift b/Tests/SwiftGenKitTests/ColorsTextFileTests.swift similarity index 77% rename from Tests/TestSuites/ColorsTextFileTests.swift rename to Tests/SwiftGenKitTests/ColorsTextFileTests.swift index df85e00..e28fb2c 100644 --- a/Tests/TestSuites/ColorsTextFileTests.swift +++ b/Tests/SwiftGenKitTests/ColorsTextFileTests.swift @@ -14,43 +14,40 @@ class ColorsTextFileTests: XCTestCase { let result = parser.stencilContext() let expected = Fixtures.context(for: "empty.plist", sub: .colors) - + XCTDiffContexts(result, expected) } - func testListWithDefaults() { + func testListWithDefaults() throws { let parser = ColorsTextFileParser() - do { - try parser.addColor(named: "Text&Body Color", value: "0x999999") - try parser.addColor(named: "ArticleTitle", value: "#996600") - try parser.addColor(named: "ArticleBackground", value: "#ffcc0099") - } catch { - XCTFail("Failed with unexpected error \(error)") - } + + try parser.addColor(named: "Text&Body Color", value: "0x999999") + try parser.addColor(named: "ArticleTitle", value: "#996600") + try parser.addColor(named: "ArticleBackground", value: "#ffcc0099") let result = parser.stencilContext() let expected = Fixtures.context(for: "entries.plist", sub: .colors) - + XCTDiffContexts(result, expected) } - func testFileWithDefaults() { + func testFileWithDefaults() throws { let parser = ColorsTextFileParser() - try! parser.parseFile(at: Fixtures.path(for: "colors.txt", sub: .colors)) + try parser.parseFile(at: Fixtures.path(for: "colors.txt", sub: .colors)) let result = parser.stencilContext() let expected = Fixtures.context(for: "text-defaults.plist", sub: .colors) - + XCTDiffContexts(result, expected) } - func testFileWithCustomName() { + func testFileWithCustomName() throws { let parser = ColorsTextFileParser() - try! parser.parseFile(at: Fixtures.path(for: "colors.txt", sub: .colors)) + try parser.parseFile(at: Fixtures.path(for: "colors.txt", sub: .colors)) let result = parser.stencilContext(enumName: "XCTColors") let expected = Fixtures.context(for: "text-customname.plist", sub: .colors) - + XCTDiffContexts(result, expected) } diff --git a/Tests/TestSuites/ColorsXMLFileTests.swift b/Tests/SwiftGenKitTests/ColorsXMLFileTests.swift similarity index 81% rename from Tests/TestSuites/ColorsXMLFileTests.swift rename to Tests/SwiftGenKitTests/ColorsXMLFileTests.swift index 2d229f2..ce20473 100644 --- a/Tests/TestSuites/ColorsXMLFileTests.swift +++ b/Tests/SwiftGenKitTests/ColorsXMLFileTests.swift @@ -14,35 +14,27 @@ class ColorsXMLFileTests: XCTestCase { let result = parser.stencilContext() let expected = Fixtures.context(for: "empty.plist", sub: .colors) - + XCTDiffContexts(result, expected) } - func testFileWithDefaults() { + func testFileWithDefaults() throws { let parser = ColorsXMLFileParser() - do { - try parser.parseFile(at: Fixtures.path(for: "colors.xml", sub: .colors)) - } catch { - XCTFail("Exception while parsing file: \(error)") - } + try parser.parseFile(at: Fixtures.path(for: "colors.xml", sub: .colors)) let result = parser.stencilContext() let expected = Fixtures.context(for: "defaults.plist", sub: .colors) - + XCTDiffContexts(result, expected) } - func testFileWithCustomName() { + func testFileWithCustomName() throws { let parser = ColorsXMLFileParser() - do { - try parser.parseFile(at: Fixtures.path(for: "colors.xml", sub: .colors)) - } catch { - XCTFail("Exception while parsing file: \(error)") - } + try parser.parseFile(at: Fixtures.path(for: "colors.xml", sub: .colors)) let result = parser.stencilContext(enumName: "XCTColors") let expected = Fixtures.context(for: "customname.plist", sub: .colors) - + XCTDiffContexts(result, expected) } diff --git a/Tests/TestSuites/FontsTests.swift b/Tests/SwiftGenKitTests/FontsTests.swift similarity index 98% rename from Tests/TestSuites/FontsTests.swift rename to Tests/SwiftGenKitTests/FontsTests.swift index ac62f59..2cab041 100644 --- a/Tests/TestSuites/FontsTests.swift +++ b/Tests/SwiftGenKitTests/FontsTests.swift @@ -13,10 +13,10 @@ import AppKit.NSFont class FontsTests: XCTestCase { func testEmpty() { let parser = FontsFileParser() - + let result = parser.stencilContext() let expected = Fixtures.context(for: "empty.plist", sub: .fonts) - + XCTDiffContexts(result, expected) } @@ -26,7 +26,7 @@ class FontsTests: XCTestCase { let result = parser.stencilContext() let expected = Fixtures.context(for: "defaults.plist", sub: .fonts) - + XCTDiffContexts(result, expected) } @@ -36,7 +36,7 @@ class FontsTests: XCTestCase { let result = parser.stencilContext(enumName: "CustomFamily") let expected = Fixtures.context(for: "customname.plist", sub: .fonts) - + XCTDiffContexts(result, expected) } } diff --git a/Tests/TestSuites/ImagesTests.swift b/Tests/SwiftGenKitTests/ImagesTests.swift similarity index 98% rename from Tests/TestSuites/ImagesTests.swift rename to Tests/SwiftGenKitTests/ImagesTests.swift index 63035dd..2632c9b 100644 --- a/Tests/TestSuites/ImagesTests.swift +++ b/Tests/SwiftGenKitTests/ImagesTests.swift @@ -20,7 +20,7 @@ class ImagesTests: XCTestCase { let result = parser.stencilContext() let expected = Fixtures.context(for: "empty.plist", sub: .images) - + XCTDiffContexts(result, expected) } @@ -30,7 +30,7 @@ class ImagesTests: XCTestCase { let result = parser.stencilContext() let expected = Fixtures.context(for: "defaults.plist", sub: .images) - + XCTDiffContexts(result, expected) } @@ -40,7 +40,7 @@ class ImagesTests: XCTestCase { let result = parser.stencilContext(enumName: "XCTImages") let expected = Fixtures.context(for: "customname.plist", sub: .images) - + XCTDiffContexts(result, expected) } } diff --git a/Tests/Info.plist b/Tests/SwiftGenKitTests/Resources/Info.plist similarity index 100% rename from Tests/Info.plist rename to Tests/SwiftGenKitTests/Resources/Info.plist diff --git a/Tests/TestSuites/StoryboardsMacOSTests.swift b/Tests/SwiftGenKitTests/StoryboardsMacOSTests.swift similarity index 98% rename from Tests/TestSuites/StoryboardsMacOSTests.swift rename to Tests/SwiftGenKitTests/StoryboardsMacOSTests.swift index b31e5b8..434dc37 100644 --- a/Tests/TestSuites/StoryboardsMacOSTests.swift +++ b/Tests/SwiftGenKitTests/StoryboardsMacOSTests.swift @@ -13,14 +13,13 @@ import SwiftGenKit * See Project -> Target "UnitTests" -> Build Rules -> « Files "*.storyboard" using PBXCp » */ - class StoryboardsMacOSTests: XCTestCase { func testEmpty() { let parser = StoryboardParser() let result = parser.stencilContext() let expected = Fixtures.context(for: "empty.plist", sub: .storyboardsMacOS) - + XCTDiffContexts(result, expected) } @@ -34,7 +33,7 @@ class StoryboardsMacOSTests: XCTestCase { let result = parser.stencilContext() let expected = Fixtures.context(for: "messages.plist", sub: .storyboardsMacOS) - + XCTDiffContexts(result, expected) } @@ -48,7 +47,7 @@ class StoryboardsMacOSTests: XCTestCase { let result = parser.stencilContext() let expected = Fixtures.context(for: "anonymous.plist", sub: .storyboardsMacOS) - + XCTDiffContexts(result, expected) } @@ -62,7 +61,7 @@ class StoryboardsMacOSTests: XCTestCase { let result = parser.stencilContext() let expected = Fixtures.context(for: "all.plist", sub: .storyboardsMacOS) - + XCTDiffContexts(result, expected) } } diff --git a/Tests/TestSuites/StoryboardsiOSTests.swift b/Tests/SwiftGenKitTests/StoryboardsiOSTests.swift similarity index 98% rename from Tests/TestSuites/StoryboardsiOSTests.swift rename to Tests/SwiftGenKitTests/StoryboardsiOSTests.swift index 5d7880d..43f3336 100644 --- a/Tests/TestSuites/StoryboardsiOSTests.swift +++ b/Tests/SwiftGenKitTests/StoryboardsiOSTests.swift @@ -20,7 +20,7 @@ class StoryboardsiOSTests: XCTestCase { let result = parser.stencilContext() let expected = Fixtures.context(for: "empty.plist", sub: .storyboardsiOS) - + XCTDiffContexts(result, expected) } @@ -34,7 +34,7 @@ class StoryboardsiOSTests: XCTestCase { let result = parser.stencilContext() let expected = Fixtures.context(for: "messages.plist", sub: .storyboardsiOS) - + XCTDiffContexts(result, expected) } @@ -48,7 +48,7 @@ class StoryboardsiOSTests: XCTestCase { let result = parser.stencilContext() let expected = Fixtures.context(for: "anonymous.plist", sub: .storyboardsiOS) - + XCTDiffContexts(result, expected) } @@ -62,7 +62,7 @@ class StoryboardsiOSTests: XCTestCase { let result = parser.stencilContext() let expected = Fixtures.context(for: "all.plist", sub: .storyboardsiOS) - + XCTDiffContexts(result, expected) } @@ -76,7 +76,7 @@ class StoryboardsiOSTests: XCTestCase { let result = parser.stencilContext(sceneEnumName: "XCTStoryboardsScene", segueEnumName: "XCTStoryboardsSegue") let expected = Fixtures.context(for: "customname.plist", sub: .storyboardsiOS) - + XCTDiffContexts(result, expected) } } diff --git a/Tests/TestSuites/StringsTests.swift b/Tests/SwiftGenKitTests/StringsTests.swift similarity index 78% rename from Tests/TestSuites/StringsTests.swift rename to Tests/SwiftGenKitTests/StringsTests.swift index ccf487d..96450a1 100644 --- a/Tests/TestSuites/StringsTests.swift +++ b/Tests/SwiftGenKitTests/StringsTests.swift @@ -20,71 +20,74 @@ class StringsTests: XCTestCase { let result = parser.stencilContext() let expected = Fixtures.context(for: "empty.plist", sub: .strings) - + XCTDiffContexts(result, expected) } func testEntriesWithDefaults() { let parser = StringsFileParser() - parser.addEntry(StringsFileParser.Entry(key: "Title", translation: "My awesome title")) - parser.addEntry(StringsFileParser.Entry(key: "Greetings", translation: "Hello, my name is %@ and I'm %d", types: .Object, .Int)) + parser.addEntry(StringsFileParser.Entry(key: "Title", + translation: "My awesome title")) + parser.addEntry(StringsFileParser.Entry(key: "Greetings", + translation: "Hello, my name is %@ and I'm %d", + types: .Object, .Int)) let result = parser.stencilContext() let expected = Fixtures.context(for: "entries.plist", sub: .strings) - + XCTDiffContexts(result, expected) } - func testFileWithDefaults() { + func testFileWithDefaults() throws { let parser = StringsFileParser() - try! parser.parseFile(at: Fixtures.path(for: "Localizable.strings", sub: .strings)) + try parser.parseFile(at: Fixtures.path(for: "Localizable.strings", sub: .strings)) let result = parser.stencilContext() let expected = Fixtures.context(for: "defaults.plist", sub: .strings) - + XCTDiffContexts(result, expected) } - func testMultiline() { + func testMultiline() throws { let parser = StringsFileParser() - try! parser.parseFile(at: Fixtures.path(for: "LocMultiline.strings", sub: .strings)) + try parser.parseFile(at: Fixtures.path(for: "LocMultiline.strings", sub: .strings)) let result = parser.stencilContext() let expected = Fixtures.context(for: "multiline.plist", sub: .strings) - + XCTDiffContexts(result, expected) } - func testUTF8FileWithDefaults() { + func testUTF8FileWithDefaults() throws { let parser = StringsFileParser() - try! parser.parseFile(at: Fixtures.path(for: "LocUTF8.strings", sub: .strings)) + try parser.parseFile(at: Fixtures.path(for: "LocUTF8.strings", sub: .strings)) let result = parser.stencilContext() let expected = Fixtures.context(for: "utf8.plist", sub: .strings) - + XCTDiffContexts(result, expected) } - func testFileWithCustomName() { + func testFileWithCustomName() throws { let parser = StringsFileParser() - try! parser.parseFile(at: Fixtures.path(for: "Localizable.strings", sub: .strings)) + try parser.parseFile(at: Fixtures.path(for: "Localizable.strings", sub: .strings)) let result = parser.stencilContext(enumName: "XCTLoc") let expected = Fixtures.context(for: "customname.plist", sub: .strings) - + XCTDiffContexts(result, expected) } - func testFileWithStructuredOnly() { + func testFileWithStructuredOnly() throws { let parser = StringsFileParser() - try! parser.parseFile(at: Fixtures.path(for: "LocStructuredOnly.strings", sub: .strings)) + try parser.parseFile(at: Fixtures.path(for: "LocStructuredOnly.strings", sub: .strings)) let result = parser.stencilContext() let expected = Fixtures.context(for: "structuredonly.plist", sub: .strings) - + XCTDiffContexts(result, expected) } - + //////////////////////////////////////////////////////////////////////// func testParseStringPlaceholder() { @@ -123,7 +126,8 @@ class StringsTests: XCTestCase { } func testParseComplexFormatPlaceholders() { - let placeholders = StringsFileParser.PlaceholderType.placeholders(fromFormat: "%2$1.3d - %4$-.7f - %3$@ - %% - %5$+3c - %%") + let format = "%2$1.3d - %4$-.7f - %3$@ - %% - %5$+3c - %%" + let placeholders = StringsFileParser.PlaceholderType.placeholders(fromFormat: format) // positions 2, 4, 3, 5 set to Int, Float, Object, Char, and position 1 not matched, defaulting to Unknown XCTAssertEqual(placeholders, [.Unknown, .Int, .Object, .Float, .Char]) } diff --git a/Tests/TestsHelper.swift b/Tests/SwiftGenKitTests/TestsHelper.swift similarity index 70% rename from Tests/TestsHelper.swift rename to Tests/SwiftGenKitTests/TestsHelper.swift index adbb431..918ad34 100644 --- a/Tests/TestsHelper.swift +++ b/Tests/SwiftGenKitTests/TestsHelper.swift @@ -8,41 +8,48 @@ import Foundation import XCTest import PathKit -private let colorCode: (String) -> String = ProcessInfo().environment["XcodeColors"] == "YES" ? { "\u{001b}[\($0);" } : { _ in "" } +private let colorCode: (String) -> String = + 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")) +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: Any], _ expected: [String: Any], path: String = "") -> String? { - + // check keys if Set(result.keys) != Set(expected.keys) { - let lhs = result.keys.map{" - \($0): \(result[$0] ?? "")"}.joined(separator: "\n") - let rhs = expected.keys.map{" - \($0): \(expected[$0] ?? "")"}.joined(separator: "\n") + let lhs = result.keys.map { " - \($0): \(result[$0] ?? "")" }.joined(separator: "\n") + let rhs = expected.keys.map { " - \($0): \(expected[$0] ?? "")" }.joined(separator: "\n") let path = (path != "") ? " at '\(path)'" : "" return "\(msgColor)Keys do not match\(path):\(reset)\n>>>>>> result\n\(lhs)\n======\n\(rhs)\n<<<<<< expected" } - + // check values for (key, lhs) in result { guard let rhs = expected[key] else { continue } - + if let error = compare(lhs, rhs, key: key, path: path) { return error } } - + return nil } func compare(_ lhs: Any, _ rhs: Any, key: String, path: String) -> String? { let keyPath = (path == "") ? key : "\(path).\(key)" - - if let lhs = lhs as? Bool, let rhs = rhs as? Bool, lhs == rhs { return nil} - else if let lhs = lhs as? Int, let rhs = rhs as? Int, lhs == rhs { return nil } - else if let lhs = lhs as? Float, let rhs = rhs as? Float, lhs == rhs { return nil } - else if let lhs = lhs as? String, let rhs = rhs as? String, lhs == rhs { return nil } - else if let lhs = lhs as? [Any], let rhs = rhs as? [Any], lhs.count == rhs.count { + + if let lhs = lhs as? Bool, let rhs = rhs as? Bool, lhs == rhs { + return nil + } else if let lhs = lhs as? Int, let rhs = rhs as? Int, lhs == rhs { + return nil + } else if let lhs = lhs as? Float, let rhs = rhs as? Float, lhs == rhs { + return nil + } else if let lhs = lhs as? String, let rhs = rhs as? String, lhs == rhs { + return nil + } else if let lhs = lhs as? [Any], let rhs = rhs as? [Any], lhs.count == rhs.count { for (lhs, rhs) in zip(lhs, rhs) { if let error = compare(lhs, rhs, key: key, path: path) { return error @@ -51,13 +58,21 @@ func compare(_ lhs: Any, _ rhs: Any, key: String, path: String) -> String? { } else if let lhs = lhs as? [String: Any], let rhs = rhs as? [String: Any] { return diff(lhs, rhs, path: "\(keyPath)") } else { - return "\(msgColor)Values do not match for '\(keyPath)':\(reset)\n>>>>>> result\n\(lhs)\n======\n\(rhs)\n<<<<<< expected" + return [ + "\(msgColor)Values do not match for '\(keyPath)':\(reset)", + ">>>>>> result", + "\(lhs)", + "======", + "\(rhs)", + "<<<<<< expected" + ].joined(separator: "\n") } - + return nil } -func XCTDiffContexts(_ result: [String: Any], _ expected: [String: Any], file: StaticString = #file, line: UInt = #line) { +func XCTDiffContexts(_ result: [String: Any], _ expected: [String: Any], + file: StaticString = #file, line: UInt = #line) { guard let error = diff(result, expected) else { return } XCTFail(error, file: file, line: line) } @@ -71,7 +86,7 @@ class Fixtures { case storyboardsMacOS = "Storyboards-macOS" case strings = "Strings" } - + private static let testBundle = Bundle(for: Fixtures.self) private init() {} @@ -84,7 +99,7 @@ class Fixtures { guard let dir = sub else { return rsrc } return rsrc + dir.rawValue } - + static func path(for name: String, sub: Directory) -> Path { return path(for: name, subDirectory: "Fixtures/\(sub.rawValue)") } @@ -95,14 +110,14 @@ class Fixtures { } return Path(path) } - + static func context(for name: String, sub: Directory) -> [String: Any] { let path = self.path(for: name, subDirectory: "Contexts/\(sub.rawValue)") - + guard let data = NSDictionary(contentsOfFile: path.description) as? [String: Any] else { fatalError("Unable to load fixture content") } - + return data } } diff --git a/circle.yml b/circle.yml new file mode 100644 index 0000000..4214f76 --- /dev/null +++ b/circle.yml @@ -0,0 +1,20 @@ +machine: + xcode: + version: 8.2 + +checkout: + post: + - git submodule update --init --recursive + +dependencies: + post: + - rake lint:install + - curl -sS https://cocoapods-specs.circleci.com/fetch-cocoapods-repo-from-s3.sh | bash + +test: + override: + - rake lint:code + - rake lint:tests + - rake xcode:test + post: + - rake pod:lint diff --git a/rakelib/changelog.rake b/rakelib/changelog.rake new file mode 100644 index 0000000..ddc630b --- /dev/null +++ b/rakelib/changelog.rake @@ -0,0 +1,35 @@ +# Used constants: +# none + +namespace :changelog do + desc 'Add the empty CHANGELOG entries after a new release' + task :reset do |task| + changelog = File.read('CHANGELOG.md') + abort('A Master entry already exists') if changelog =~ /^##\s*Master$/ + changelog.sub!(/^##[^#]/, "#{header}\\0") + File.write('CHANGELOG.md', changelog) + end + + def header + return <<-HEADER.gsub(/^\s*\|/,'') + |## Master + | + |### Bug Fixes + | + |_None_ + | + |### Breaking Changes + | + |_None_ + | + |### New Features + | + |_None_ + | + |### Internal Changes + | + |_None_ + | + HEADER + end +end diff --git a/rakelib/lint.rake b/rakelib/lint.rake new file mode 100644 index 0000000..c5aa2c0 --- /dev/null +++ b/rakelib/lint.rake @@ -0,0 +1,39 @@ +# Used constants: +# - WORKSPACE + +namespace :lint do + desc 'Install swiftlint' + task :install do |task| + next if system('which swiftlint > /dev/null') + + url = 'https://github.com/realm/SwiftLint/releases/download/0.16.1/SwiftLint.pkg' + tmppath = '/tmp/SwiftLint.pkg' + + Utils.run([ + "curl -Lo #{tmppath} #{url}", + "sudo installer -pkg #{tmppath} -target /" + ], task) + end + + if File.directory?('Sources') + desc 'Lint the code' + task :code => :install do |task| + Utils.print_header 'Linting the code' + Utils.run(%Q(swiftlint lint --no-cache --strict --path Sources), task) + end + end + + desc 'Lint the tests' + task :tests => :install do |task| + Utils.print_header 'Linting the unit test code' + Utils.run(%Q(swiftlint lint --no-cache --strict --path "Tests/#{WORKSPACE}Tests"), task) + end + + if File.directory?('Tests/Expected') + desc 'Lint the output' + task :output => :install do |task| + Utils.print_header 'Linting the template output code' + Utils.run(%Q(swiftlint lint --no-cache --strict --path Tests/Expected), task) + end + end +end diff --git a/rakelib/pod.rake b/rakelib/pod.rake new file mode 100644 index 0000000..9a9ecac --- /dev/null +++ b/rakelib/pod.rake @@ -0,0 +1,12 @@ +# Used constants: +# - POD_NAME + +if defined?(POD_NAME) && File.file?("#{POD_NAME}.podspec") + namespace :pod do + desc 'Lint the Pod' + task :lint do |task| + Utils.print_header 'Linting the pod spec' + Utils.run(%Q(bundle exec pod lib lint "#{POD_NAME}.podspec" --quick), task) + end + end +end diff --git a/rakelib/spm.rake b/rakelib/spm.rake new file mode 100644 index 0000000..1282cea --- /dev/null +++ b/rakelib/spm.rake @@ -0,0 +1,18 @@ +# Used constants: +# none + +if File.file?('Package.swift') + namespace :spm do + desc 'Build using SPM' + task :build do |task| + Utils.print_header 'Compile using SPM' + Utils.run('swift build', task, xcrun: true) + end + + desc 'Run SPM Unit Tests' + task :test => :build do |task| + Utils.print_header 'Run the unit tests using SPM' + Utils.run('swift test', task, xcrun: true) + end + end +end diff --git a/rakelib/utils.rake b/rakelib/utils.rake new file mode 100644 index 0000000..a87ce32 --- /dev/null +++ b/rakelib/utils.rake @@ -0,0 +1,123 @@ +# Used constants: +# none + +class Utils + # formatter types + :xcpretty # pass through xcpretty and store in artifacts + :raw # store in artifacts + :to_string # run using backticks and return output + + # run a command using xcrun and xcpretty if applicable + def self.run(cmd, task, subtask = '', xcrun: false, formatter: :raw) + commands = xcrun ? [*cmd].map { |cmd| + "#{version_select} xcrun #{cmd}" + } : [*cmd] + + case formatter + when :xcpretty then xcpretty(commands, task, subtask) + when :raw then plain(commands, task, subtask) + when :to_string then `#{commands.join(' && ')}` + else raise "Unknown formatter '#{formatter}'" + end + end + + # print an info header + def self.print_header(str) + puts "== #{str.chomp} ==".format(:yellow, :bold) + end + + # print an info message + def self.print_info(str) + puts str.chomp.format(:green) + end + + # print an error message + def self.print_error(str) + puts str.chomp.format(:red) + end + + ## [ Private helper functions ] ################################################## + + # run a command, pipe output through 'xcpretty' and store the output in CI artifacts + def self.xcpretty(cmd, task, subtask) + name = (task.name + (subtask.empty? ? '' : "_#{subtask}")).gsub(/[:-]/, "_") + command = [*cmd].join(' && ') + + if ENV['CI'] + Rake.sh "set -o pipefail && (#{command}) | tee \"#{ENV['CIRCLE_ARTIFACTS']}/#{name}_raw.log\" | bundle exec xcpretty --color --report junit --output \"#{ENV['CIRCLE_TEST_REPORTS']}/xcode/#{name}.xml\"" + elsif system('which xcpretty > /dev/null') + Rake.sh "set -o pipefail && (#{command}) | bundle exec xcpretty -c" + else + Rake.sh command + end + end + private_class_method :xcpretty + + # run a command and store the output in CI artifacts + def self.plain(cmd, task, subtask) + name = (task.name + (subtask.empty? ? '' : "_#{subtask}")).gsub(/[:-]/, "_") + command = [*cmd].join(' && ') + + if ENV['CI'] + Rake.sh "set -o pipefail && (#{command}) | tee \"#{ENV['CIRCLE_ARTIFACTS']}/#{name}_raw.log\"" + else + Rake.sh command + end + end + private_class_method :plain + + # select the xcode version we want/support + def self.version_select + xcodes = `mdfind "kMDItemCFBundleIdentifier = 'com.apple.dt.Xcode' && kMDItemVersion = '8.*'"`.chomp.split("\n") + if xcodes.empty? + raise "\n[!!!] You need to have Xcode 8.x to compile SwiftGen.\n\n" + end + + # Order by version and get the latest one + vers = lambda { |path| `mdls -name kMDItemVersion -raw "#{path}"` } + latest_xcode_version = xcodes.sort { |p1, p2| vers.call(p1) <=> vers.call(p2) }.last + %Q(DEVELOPER_DIR="#{latest_xcode_version}/Contents/Developer") + end + private_class_method :version_select +end + + +class String + # colorization + FORMATTING = { + # text styling + :bold => 1, + :faint => 2, + :italic => 3, + :underline => 4, + # foreground colors + :black => 30, + :red => 31, + :green => 32, + :yellow => 33, + :blue => 34, + :magenta => 35, + :cyan => 36, + :white => 37, + # background colors + :bg_black => 40, + :bg_red => 41, + :bg_green => 42, + :bg_yellow => 43, + :bg_blue => 44, + :bg_magenta => 45, + :bg_cyan => 46, + :bg_white => 47 + } + + # only enable formatting if terminal supports it + if `tput colors`.chomp.to_i >= 8 + def format(*styles) + styles.reduce("") { |r, s| r << "\e[#{FORMATTING[s]}m" } << "#{self}\e[0m" + end + else + def format(*styles) + self + end + end +end diff --git a/rakelib/xcode.rake b/rakelib/xcode.rake new file mode 100644 index 0000000..c66f4c1 --- /dev/null +++ b/rakelib/xcode.rake @@ -0,0 +1,18 @@ +# Used constants: +# - CONFIGURATION +# - SCHEME_NAME +# - WORKSPACE + +namespace :xcode do + desc 'Build using Xcode' + task :build do |task| + Utils.print_header 'Compile using Xcode' + Utils.run(%Q(xcodebuild -workspace "#{WORKSPACE}.xcworkspace" -scheme "#{SCHEME_NAME}" -configuration "#{CONFIGURATION}" build-for-testing), task, xcrun: true, formatter: :xcpretty) + end + + desc 'Run Xcode Unit Tests' + task :test => :build do |task| + Utils.print_header 'Run the unit tests using Xcode' + Utils.run(%Q(xcodebuild -workspace "#{WORKSPACE}.xcworkspace" -scheme "#{SCHEME_NAME}" -configuration "#{CONFIGURATION}" test-without-building), task, xcrun: true, formatter: :xcpretty) + end +end