├── .gitignore ├── .gitmodules ├── .travis.yml ├── CuckooGenerator.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── CuckooGenerator.xcscmblueprint └── xcshareddata │ └── xcschemes │ ├── CuckooGenerator.xcscheme │ └── CuckooGeneratorFramework.xcscheme ├── LICENSE ├── README.md ├── Source ├── CuckooGeneratorError.swift ├── CuckooGeneratorFramework │ ├── CodeBuilder.swift │ ├── FileHeaderHandler.swift │ ├── Generator.swift │ ├── Supporting Files │ │ ├── CuckooGeneratorFramework.h │ │ └── Info.plist │ ├── Tokenizer.swift │ ├── Tokens │ │ ├── Accessibility.swift │ │ ├── Attributes.swift │ │ ├── ClassDeclaration.swift │ │ ├── ClassMethod.swift │ │ ├── ContainerToken.swift │ │ ├── ExtensionDeclaration.swift │ │ ├── FileRepresentation.swift │ │ ├── Import.swift │ │ ├── Initializer.swift │ │ ├── InstanceVariable.swift │ │ ├── Key.swift │ │ ├── Kinds.swift │ │ ├── Method.swift │ │ ├── MethodParameter.swift │ │ ├── ProtocolDeclaration.swift │ │ ├── ProtocolMethod.swift │ │ └── Token.swift │ └── Utils.swift ├── GenerateMocksCommand.swift ├── Supporting Files │ ├── Components.plist │ └── Info.plist ├── VersionCommand.swift └── main.swift ├── Tests ├── Gemfile ├── SourceFiles │ ├── ClassWithAttributes.swift │ ├── EmptyClass.swift │ ├── Expected │ │ ├── ClassWithAttributes.swift │ │ ├── GeneratedMocks.swift │ │ ├── Imports.swift │ │ ├── MultipleClasses.swift │ │ ├── NoHeader.swift │ │ ├── Struct.swift │ │ └── TestableFrameworks.swift │ ├── Imports.swift │ ├── MultipleClasses.swift │ ├── Struct.swift │ ├── TestedClass.swift │ └── TestedProtocol.swift ├── bin │ └── runcuckoo └── features │ ├── generate_command.feature │ └── support │ ├── aruba.rb │ └── env.rb ├── makefile └── run_tests.sh /.gitignore: -------------------------------------------------------------------------------- 1 | Build/ 2 | 3 | # Xcode 4 | # 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata 15 | *.xccheckout 16 | *.moved-aside 17 | DerivedData 18 | *.hmap 19 | *.ipa 20 | *.xcuserstate 21 | 22 | # Mac OS X 23 | .DS_Store 24 | 25 | # CocoaPods 26 | # 27 | # We recommend against adding the Pods directory to your .gitignore. However 28 | # you should judge for yourself, the pros and cons are mentioned at: 29 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 30 | # 31 | # Pods/ 32 | 33 | # Carthage 34 | Carthage/ 35 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Dependencies/SourceKitten"] 2 | path = Dependencies/SourceKitten 3 | url = https://github.com/jpsim/SourceKitten 4 | [submodule "Dependencies/FileKit"] 5 | path = Dependencies/FileKit 6 | url = https://github.com/nvzqz/FileKit 7 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | osx_image: xcode7.3 3 | before_script: 4 | - gem install cucumber 5 | - gem install aruba 6 | script: 7 | - bash run_tests.sh 8 | - sleep 5 9 | -------------------------------------------------------------------------------- /CuckooGenerator.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1808B1AB1C4581070036E924 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1808B1AA1C4581070036E924 /* main.swift */; }; 11 | 18E16D691C45D8280084EF54 /* CuckooGeneratorFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = 18E16D681C45D8280084EF54 /* CuckooGeneratorFramework.h */; settings = {ATTRIBUTES = (Public, ); }; }; 12 | 18E16D831C45D8B30084EF54 /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18E16D511C45A6890084EF54 /* Utils.swift */; }; 13 | 18E16D841C45D8B30084EF54 /* Tokenizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18E16D531C45A6AF0084EF54 /* Tokenizer.swift */; }; 14 | 18E16D871C45D8B30084EF54 /* FileHeaderHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18E16D591C45A85E0084EF54 /* FileHeaderHandler.swift */; }; 15 | 18E16D991C45DF7F0084EF54 /* Components.plist in Resources */ = {isa = PBXBuildFile; fileRef = 18E16D981C45DF7F0084EF54 /* Components.plist */; }; 16 | 18F2BC1D1C46E8E30015A95F /* Generator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18F2BC1B1C46E8760015A95F /* Generator.swift */; }; 17 | DC4094301D13F91F006FB137 /* Import.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC40942E1D13F8FA006FB137 /* Import.swift */; }; 18 | DC4094861D140184006FB137 /* ExtensionDeclaration.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC4094651D140180006FB137 /* ExtensionDeclaration.swift */; }; 19 | DC5176351D2EE8F700E922F2 /* CodeBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC5176331D2EE4D300E922F2 /* CodeBuilder.swift */; }; 20 | DC5C26E61D0E9DA200630D49 /* VersionCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC5C26E51D0E9DA200630D49 /* VersionCommand.swift */; }; 21 | DC5E8FD71D0DA57E00EFCA76 /* FileKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DC1AB5DB1D0D9F0C00867895 /* FileKit.framework */; }; 22 | DC5E8FD91D0DA57E00EFCA76 /* SourceKittenFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DC1AB5ED1D0D9F1600867895 /* SourceKittenFramework.framework */; }; 23 | DC5E8FDA1D0DA57E00EFCA76 /* SWXMLHash.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DC1AB61A1D0D9F8600867895 /* SWXMLHash.framework */; }; 24 | DC5E8FDB1D0DA57E00EFCA76 /* Yaml.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DC1AB62D1D0D9FE500867895 /* Yaml.framework */; }; 25 | DC5E8FDD1D0DA5D900EFCA76 /* SWXMLHash.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = DC1AB61A1D0D9F8600867895 /* SWXMLHash.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 26 | DC5E8FDF1D0DA5D900EFCA76 /* SourceKittenFramework.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = DC1AB5ED1D0D9F1600867895 /* SourceKittenFramework.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 27 | DC5E8FE31D0DA60500EFCA76 /* FileKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = DC1AB5DB1D0D9F0C00867895 /* FileKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 28 | DC5E8FE61D0DA61B00EFCA76 /* Yaml.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = DC1AB62D1D0D9FE500867895 /* Yaml.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 29 | DC8C4EE01CF9AF1C005213F8 /* CuckooGeneratorFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18E16D661C45D8280084EF54 /* CuckooGeneratorFramework.framework */; }; 30 | DC8C4EE11CF9AF1C005213F8 /* CuckooGeneratorFramework.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 18E16D661C45D8280084EF54 /* CuckooGeneratorFramework.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 31 | DC9EFA721CFC4F4D0034DFE5 /* Key.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC9EFA581CFC4F420034DFE5 /* Key.swift */; }; 32 | DC9EFA731CFC4F4D0034DFE5 /* Kinds.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC9EFA591CFC4F420034DFE5 /* Kinds.swift */; }; 33 | DC9EFA741CFC4F4D0034DFE5 /* Accessibility.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC9EFA5A1CFC4F420034DFE5 /* Accessibility.swift */; }; 34 | DC9EFA751CFC4F4D0034DFE5 /* Attributes.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC9EFA5B1CFC4F420034DFE5 /* Attributes.swift */; }; 35 | DC9EFA761CFC4F4D0034DFE5 /* FileRepresentation.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC9EFA5C1CFC4F420034DFE5 /* FileRepresentation.swift */; }; 36 | DC9EFA771CFC4F4D0034DFE5 /* Token.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC9EFA5D1CFC4F420034DFE5 /* Token.swift */; }; 37 | DC9EFA781CFC4F4D0034DFE5 /* ContainerToken.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC9EFA5E1CFC4F420034DFE5 /* ContainerToken.swift */; }; 38 | DC9EFA791CFC4F4D0034DFE5 /* ProtocolDeclaration.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC9EFA5F1CFC4F420034DFE5 /* ProtocolDeclaration.swift */; }; 39 | DC9EFA7A1CFC4F4D0034DFE5 /* ClassDeclaration.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC9EFA601CFC4F420034DFE5 /* ClassDeclaration.swift */; }; 40 | DC9EFA7B1CFC4F4D0034DFE5 /* Method.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC9EFA611CFC4F420034DFE5 /* Method.swift */; }; 41 | DC9EFA7C1CFC4F4D0034DFE5 /* ProtocolMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC9EFA621CFC4F420034DFE5 /* ProtocolMethod.swift */; }; 42 | DC9EFA7D1CFC4F4D0034DFE5 /* Initializer.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC9EFA631CFC4F420034DFE5 /* Initializer.swift */; }; 43 | DC9EFA7E1CFC4F4D0034DFE5 /* MethodParameter.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC9EFA641CFC4F420034DFE5 /* MethodParameter.swift */; }; 44 | DC9EFA901CFC50070034DFE5 /* ClassMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC9EFA7F1CFC4FCF0034DFE5 /* ClassMethod.swift */; }; 45 | DC9EFA911CFC50070034DFE5 /* InstanceVariable.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC9EFA801CFC4FCF0034DFE5 /* InstanceVariable.swift */; }; 46 | DCAD1EA51D0DA9CB0091EECE /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DCAD1E961D0DA9B70091EECE /* Result.framework */; }; 47 | DCAD1EBA1D0DB2B90091EECE /* Result.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = DCAD1E961D0DA9B70091EECE /* Result.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 48 | DCAD1F131D0DB64E0091EECE /* Commandant.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DCAD1ECC1D0DB3640091EECE /* Commandant.framework */; }; 49 | DCAD1F141D0DB6540091EECE /* Commandant.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = DCAD1ECC1D0DB3640091EECE /* Commandant.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 50 | DCDEE5141CFF124E007F18BC /* CuckooGeneratorError.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCDEE5101CFF124E007F18BC /* CuckooGeneratorError.swift */; }; 51 | DCDEE5151CFF124E007F18BC /* GenerateMocksCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCDEE5111CFF124E007F18BC /* GenerateMocksCommand.swift */; }; 52 | /* End PBXBuildFile section */ 53 | 54 | /* Begin PBXContainerItemProxy section */ 55 | DC1AB5DA1D0D9F0C00867895 /* PBXContainerItemProxy */ = { 56 | isa = PBXContainerItemProxy; 57 | containerPortal = DC1AB5D21D0D9F0B00867895 /* FileKit.xcodeproj */; 58 | proxyType = 2; 59 | remoteGlobalIDString = 5204B84B1B96B83800AA473F; 60 | remoteInfo = "FileKit-OSX"; 61 | }; 62 | DC1AB5DC1D0D9F0C00867895 /* PBXContainerItemProxy */ = { 63 | isa = PBXContainerItemProxy; 64 | containerPortal = DC1AB5D21D0D9F0B00867895 /* FileKit.xcodeproj */; 65 | proxyType = 2; 66 | remoteGlobalIDString = 5204B8581B96B85E00AA473F; 67 | remoteInfo = "FileKit-iOS"; 68 | }; 69 | DC1AB5DE1D0D9F0C00867895 /* PBXContainerItemProxy */ = { 70 | isa = PBXContainerItemProxy; 71 | containerPortal = DC1AB5D21D0D9F0B00867895 /* FileKit.xcodeproj */; 72 | proxyType = 2; 73 | remoteGlobalIDString = 527612421BAEA3EE00503D0A; 74 | remoteInfo = "FileKit-watchOS"; 75 | }; 76 | DC1AB5E01D0D9F0C00867895 /* PBXContainerItemProxy */ = { 77 | isa = PBXContainerItemProxy; 78 | containerPortal = DC1AB5D21D0D9F0B00867895 /* FileKit.xcodeproj */; 79 | proxyType = 2; 80 | remoteGlobalIDString = 52B938B31BF3C3E5001B7AEB; 81 | remoteInfo = "FileKit-tvOS"; 82 | }; 83 | DC1AB5E21D0D9F0C00867895 /* PBXContainerItemProxy */ = { 84 | isa = PBXContainerItemProxy; 85 | containerPortal = DC1AB5D21D0D9F0B00867895 /* FileKit.xcodeproj */; 86 | proxyType = 2; 87 | remoteGlobalIDString = 5263A9041B96BA3D00635A93; 88 | remoteInfo = FileKitTests; 89 | }; 90 | DC1AB5EA1D0D9F1600867895 /* PBXContainerItemProxy */ = { 91 | isa = PBXContainerItemProxy; 92 | containerPortal = DC1AB5E41D0D9F1600867895 /* sourcekitten.xcodeproj */; 93 | proxyType = 2; 94 | remoteGlobalIDString = D0E7B63219E9C64500EDBA4D; 95 | remoteInfo = sourcekitten; 96 | }; 97 | DC1AB5EC1D0D9F1600867895 /* PBXContainerItemProxy */ = { 98 | isa = PBXContainerItemProxy; 99 | containerPortal = DC1AB5E41D0D9F1600867895 /* sourcekitten.xcodeproj */; 100 | proxyType = 2; 101 | remoteGlobalIDString = D0D1216D19E87B05005E4BAA; 102 | remoteInfo = SourceKittenFramework; 103 | }; 104 | DC1AB5EE1D0D9F1600867895 /* PBXContainerItemProxy */ = { 105 | isa = PBXContainerItemProxy; 106 | containerPortal = DC1AB5E41D0D9F1600867895 /* sourcekitten.xcodeproj */; 107 | proxyType = 2; 108 | remoteGlobalIDString = D0D1217719E87B05005E4BAA; 109 | remoteInfo = SourceKittenFrameworkTests; 110 | }; 111 | DC1AB6151D0D9F8600867895 /* PBXContainerItemProxy */ = { 112 | isa = PBXContainerItemProxy; 113 | containerPortal = DC1AB60B1D0D9F8600867895 /* SWXMLHash.xcodeproj */; 114 | proxyType = 2; 115 | remoteGlobalIDString = CD6083EF196CA106000B4F8D; 116 | remoteInfo = "SWXMLHash iOS"; 117 | }; 118 | DC1AB6171D0D9F8600867895 /* PBXContainerItemProxy */ = { 119 | isa = PBXContainerItemProxy; 120 | containerPortal = DC1AB60B1D0D9F8600867895 /* SWXMLHash.xcodeproj */; 121 | proxyType = 2; 122 | remoteGlobalIDString = CD6083FA196CA106000B4F8D; 123 | remoteInfo = "SWXMLHash iOS Tests"; 124 | }; 125 | DC1AB6191D0D9F8600867895 /* PBXContainerItemProxy */ = { 126 | isa = PBXContainerItemProxy; 127 | containerPortal = DC1AB60B1D0D9F8600867895 /* SWXMLHash.xcodeproj */; 128 | proxyType = 2; 129 | remoteGlobalIDString = CD9D052C1A757D8B003CCB21; 130 | remoteInfo = "SWXMLHash OSX"; 131 | }; 132 | DC1AB61B1D0D9F8600867895 /* PBXContainerItemProxy */ = { 133 | isa = PBXContainerItemProxy; 134 | containerPortal = DC1AB60B1D0D9F8600867895 /* SWXMLHash.xcodeproj */; 135 | proxyType = 2; 136 | remoteGlobalIDString = CD9D05361A757D8B003CCB21; 137 | remoteInfo = "SWXMLHash OSX Tests"; 138 | }; 139 | DC1AB61D1D0D9F8600867895 /* PBXContainerItemProxy */ = { 140 | isa = PBXContainerItemProxy; 141 | containerPortal = DC1AB60B1D0D9F8600867895 /* SWXMLHash.xcodeproj */; 142 | proxyType = 2; 143 | remoteGlobalIDString = CDDEC74C1BF6311A00AB138B; 144 | remoteInfo = "SWXMLHash tvOS"; 145 | }; 146 | DC1AB61F1D0D9F8600867895 /* PBXContainerItemProxy */ = { 147 | isa = PBXContainerItemProxy; 148 | containerPortal = DC1AB60B1D0D9F8600867895 /* SWXMLHash.xcodeproj */; 149 | proxyType = 2; 150 | remoteGlobalIDString = CDDEC7551BF6311B00AB138B; 151 | remoteInfo = "SWXMLHash tvOS Tests"; 152 | }; 153 | DC1AB6211D0D9F8600867895 /* PBXContainerItemProxy */ = { 154 | isa = PBXContainerItemProxy; 155 | containerPortal = DC1AB60B1D0D9F8600867895 /* SWXMLHash.xcodeproj */; 156 | proxyType = 2; 157 | remoteGlobalIDString = CDDEC7681BF6316C00AB138B; 158 | remoteInfo = "SWXMLHash watchOS"; 159 | }; 160 | DC1AB62C1D0D9FE500867895 /* PBXContainerItemProxy */ = { 161 | isa = PBXContainerItemProxy; 162 | containerPortal = DC1AB6231D0D9FE500867895 /* Yaml.xcodeproj */; 163 | proxyType = 2; 164 | remoteGlobalIDString = 8E1D76211B258FEE0022C013; 165 | remoteInfo = "Yaml OSX"; 166 | }; 167 | DC1AB62E1D0D9FE500867895 /* PBXContainerItemProxy */ = { 168 | isa = PBXContainerItemProxy; 169 | containerPortal = DC1AB6231D0D9FE500867895 /* Yaml.xcodeproj */; 170 | proxyType = 2; 171 | remoteGlobalIDString = 8E1D762C1B258FEE0022C013; 172 | remoteInfo = "Tests OSX"; 173 | }; 174 | DC1AB6301D0D9FE500867895 /* PBXContainerItemProxy */ = { 175 | isa = PBXContainerItemProxy; 176 | containerPortal = DC1AB6231D0D9FE500867895 /* Yaml.xcodeproj */; 177 | proxyType = 2; 178 | remoteGlobalIDString = F32DF2581B73054C0011046A; 179 | remoteInfo = "Yaml iOS"; 180 | }; 181 | DC1AB6321D0D9FE500867895 /* PBXContainerItemProxy */ = { 182 | isa = PBXContainerItemProxy; 183 | containerPortal = DC1AB6231D0D9FE500867895 /* Yaml.xcodeproj */; 184 | proxyType = 2; 185 | remoteGlobalIDString = F32DF2611B73054C0011046A; 186 | remoteInfo = "Tests iOS"; 187 | }; 188 | DC1AB6341D0D9FE500867895 /* PBXContainerItemProxy */ = { 189 | isa = PBXContainerItemProxy; 190 | containerPortal = DC1AB6231D0D9FE500867895 /* Yaml.xcodeproj */; 191 | proxyType = 2; 192 | remoteGlobalIDString = 8313C4291C8DC2CB00DEF215; 193 | remoteInfo = "Yaml tvOS"; 194 | }; 195 | DC1AB6361D0D9FE500867895 /* PBXContainerItemProxy */ = { 196 | isa = PBXContainerItemProxy; 197 | containerPortal = DC1AB6231D0D9FE500867895 /* Yaml.xcodeproj */; 198 | proxyType = 2; 199 | remoteGlobalIDString = 8313C4321C8DC2CB00DEF215; 200 | remoteInfo = "Tests tvOS"; 201 | }; 202 | DC8C4EE21CF9AF1C005213F8 /* PBXContainerItemProxy */ = { 203 | isa = PBXContainerItemProxy; 204 | containerPortal = 1808B1581C4575AA0036E924 /* Project object */; 205 | proxyType = 1; 206 | remoteGlobalIDString = 18E16D651C45D8280084EF54; 207 | remoteInfo = CuckooGeneratorFramework; 208 | }; 209 | DCAD1E951D0DA9B70091EECE /* PBXContainerItemProxy */ = { 210 | isa = PBXContainerItemProxy; 211 | containerPortal = DCAD1E8A1D0DA9B60091EECE /* Result.xcodeproj */; 212 | proxyType = 2; 213 | remoteGlobalIDString = D45480571A9572F5009D7229; 214 | remoteInfo = "Result-Mac"; 215 | }; 216 | DCAD1E971D0DA9B70091EECE /* PBXContainerItemProxy */ = { 217 | isa = PBXContainerItemProxy; 218 | containerPortal = DCAD1E8A1D0DA9B60091EECE /* Result.xcodeproj */; 219 | proxyType = 2; 220 | remoteGlobalIDString = D45480671A9572F5009D7229; 221 | remoteInfo = "Result-MacTests"; 222 | }; 223 | DCAD1E991D0DA9B70091EECE /* PBXContainerItemProxy */ = { 224 | isa = PBXContainerItemProxy; 225 | containerPortal = DCAD1E8A1D0DA9B60091EECE /* Result.xcodeproj */; 226 | proxyType = 2; 227 | remoteGlobalIDString = D454807D1A957361009D7229; 228 | remoteInfo = "Result-iOS"; 229 | }; 230 | DCAD1E9B1D0DA9B70091EECE /* PBXContainerItemProxy */ = { 231 | isa = PBXContainerItemProxy; 232 | containerPortal = DCAD1E8A1D0DA9B60091EECE /* Result.xcodeproj */; 233 | proxyType = 2; 234 | remoteGlobalIDString = D45480871A957362009D7229; 235 | remoteInfo = "Result-iOSTests"; 236 | }; 237 | DCAD1E9D1D0DA9B70091EECE /* PBXContainerItemProxy */ = { 238 | isa = PBXContainerItemProxy; 239 | containerPortal = DCAD1E8A1D0DA9B60091EECE /* Result.xcodeproj */; 240 | proxyType = 2; 241 | remoteGlobalIDString = 57FCDE471BA280DC00130C48; 242 | remoteInfo = "Result-tvOS"; 243 | }; 244 | DCAD1E9F1D0DA9B70091EECE /* PBXContainerItemProxy */ = { 245 | isa = PBXContainerItemProxy; 246 | containerPortal = DCAD1E8A1D0DA9B60091EECE /* Result.xcodeproj */; 247 | proxyType = 2; 248 | remoteGlobalIDString = 57FCDE541BA280E000130C48; 249 | remoteInfo = "Result-tvOSTests"; 250 | }; 251 | DCAD1EA11D0DA9B70091EECE /* PBXContainerItemProxy */ = { 252 | isa = PBXContainerItemProxy; 253 | containerPortal = DCAD1E8A1D0DA9B60091EECE /* Result.xcodeproj */; 254 | proxyType = 2; 255 | remoteGlobalIDString = D03579A31B2B788F005D26AE; 256 | remoteInfo = "Result-watchOS"; 257 | }; 258 | DCAD1EA31D0DA9B70091EECE /* PBXContainerItemProxy */ = { 259 | isa = PBXContainerItemProxy; 260 | containerPortal = DCAD1E8A1D0DA9B60091EECE /* Result.xcodeproj */; 261 | proxyType = 2; 262 | remoteGlobalIDString = D03579B01B2B78A1005D26AE; 263 | remoteInfo = "Result-watchOSTests"; 264 | }; 265 | DCAD1ECB1D0DB3640091EECE /* PBXContainerItemProxy */ = { 266 | isa = PBXContainerItemProxy; 267 | containerPortal = DCAD1EC61D0DB3640091EECE /* Commandant.xcodeproj */; 268 | proxyType = 2; 269 | remoteGlobalIDString = D00CCDD91A20717400109F8C; 270 | remoteInfo = Commandant; 271 | }; 272 | DCAD1ECD1D0DB3640091EECE /* PBXContainerItemProxy */ = { 273 | isa = PBXContainerItemProxy; 274 | containerPortal = DCAD1EC61D0DB3640091EECE /* Commandant.xcodeproj */; 275 | proxyType = 2; 276 | remoteGlobalIDString = D00CCDE41A20717400109F8C; 277 | remoteInfo = Tests; 278 | }; 279 | /* End PBXContainerItemProxy section */ 280 | 281 | /* Begin PBXCopyFilesBuildPhase section */ 282 | 18E16D901C45D9A40084EF54 /* Embed Frameworks */ = { 283 | isa = PBXCopyFilesBuildPhase; 284 | buildActionMask = 2147483647; 285 | dstPath = ""; 286 | dstSubfolderSpec = 10; 287 | files = ( 288 | DCAD1F141D0DB6540091EECE /* Commandant.framework in Embed Frameworks */, 289 | DCAD1EBA1D0DB2B90091EECE /* Result.framework in Embed Frameworks */, 290 | DC5E8FE61D0DA61B00EFCA76 /* Yaml.framework in Embed Frameworks */, 291 | DC5E8FDD1D0DA5D900EFCA76 /* SWXMLHash.framework in Embed Frameworks */, 292 | DC5E8FE31D0DA60500EFCA76 /* FileKit.framework in Embed Frameworks */, 293 | DC5E8FDF1D0DA5D900EFCA76 /* SourceKittenFramework.framework in Embed Frameworks */, 294 | ); 295 | name = "Embed Frameworks"; 296 | runOnlyForDeploymentPostprocessing = 0; 297 | }; 298 | DC8C4EE41CF9AF1C005213F8 /* Embed Frameworks */ = { 299 | isa = PBXCopyFilesBuildPhase; 300 | buildActionMask = 2147483647; 301 | dstPath = ""; 302 | dstSubfolderSpec = 10; 303 | files = ( 304 | DC8C4EE11CF9AF1C005213F8 /* CuckooGeneratorFramework.framework in Embed Frameworks */, 305 | ); 306 | name = "Embed Frameworks"; 307 | runOnlyForDeploymentPostprocessing = 0; 308 | }; 309 | /* End PBXCopyFilesBuildPhase section */ 310 | 311 | /* Begin PBXFileReference section */ 312 | 1808B1601C4575AA0036E924 /* cuckoo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = cuckoo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 313 | 1808B16A1C4575AA0036E924 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 314 | 1808B1AA1C4581070036E924 /* main.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; 315 | 18E16D511C45A6890084EF54 /* Utils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = Utils.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; 316 | 18E16D531C45A6AF0084EF54 /* Tokenizer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = Tokenizer.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; 317 | 18E16D591C45A85E0084EF54 /* FileHeaderHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = FileHeaderHandler.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; 318 | 18E16D661C45D8280084EF54 /* CuckooGeneratorFramework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CuckooGeneratorFramework.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 319 | 18E16D681C45D8280084EF54 /* CuckooGeneratorFramework.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CuckooGeneratorFramework.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 320 | 18E16D6A1C45D8280084EF54 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 321 | 18E16D981C45DF7F0084EF54 /* Components.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Components.plist; sourceTree = ""; }; 322 | 18F2BC1B1C46E8760015A95F /* Generator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = Generator.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; 323 | DC1AB5D21D0D9F0B00867895 /* FileKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = FileKit.xcodeproj; path = Dependencies/FileKit/FileKit.xcodeproj; sourceTree = ""; }; 324 | DC1AB5E41D0D9F1600867895 /* sourcekitten.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = sourcekitten.xcodeproj; path = Dependencies/SourceKitten/sourcekitten.xcodeproj; sourceTree = ""; }; 325 | DC1AB60B1D0D9F8600867895 /* SWXMLHash.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SWXMLHash.xcodeproj; path = Dependencies/SourceKitten/Carthage/Checkouts/SWXMLHash/SWXMLHash.xcodeproj; sourceTree = ""; }; 326 | DC1AB6231D0D9FE500867895 /* Yaml.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Yaml.xcodeproj; path = Dependencies/SourceKitten/Carthage/Checkouts/YamlSwift/Yaml.xcodeproj; sourceTree = ""; }; 327 | DC40942E1D13F8FA006FB137 /* Import.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Import.swift; path = Tokens/Import.swift; sourceTree = ""; }; 328 | DC4094651D140180006FB137 /* ExtensionDeclaration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ExtensionDeclaration.swift; path = Tokens/ExtensionDeclaration.swift; sourceTree = ""; }; 329 | DC5176331D2EE4D300E922F2 /* CodeBuilder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CodeBuilder.swift; sourceTree = ""; }; 330 | DC5C26E51D0E9DA200630D49 /* VersionCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VersionCommand.swift; sourceTree = ""; }; 331 | DC8C4EA91CF9A272005213F8 /* CuckooGenerator.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = CuckooGenerator.xcodeproj; sourceTree = ""; }; 332 | DC9EFA581CFC4F420034DFE5 /* Key.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Key.swift; path = Tokens/Key.swift; sourceTree = ""; }; 333 | DC9EFA591CFC4F420034DFE5 /* Kinds.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Kinds.swift; path = Tokens/Kinds.swift; sourceTree = ""; }; 334 | DC9EFA5A1CFC4F420034DFE5 /* Accessibility.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Accessibility.swift; path = Tokens/Accessibility.swift; sourceTree = ""; }; 335 | DC9EFA5B1CFC4F420034DFE5 /* Attributes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Attributes.swift; path = Tokens/Attributes.swift; sourceTree = ""; }; 336 | DC9EFA5C1CFC4F420034DFE5 /* FileRepresentation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FileRepresentation.swift; path = Tokens/FileRepresentation.swift; sourceTree = ""; }; 337 | DC9EFA5D1CFC4F420034DFE5 /* Token.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Token.swift; path = Tokens/Token.swift; sourceTree = ""; }; 338 | DC9EFA5E1CFC4F420034DFE5 /* ContainerToken.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ContainerToken.swift; path = Tokens/ContainerToken.swift; sourceTree = ""; }; 339 | DC9EFA5F1CFC4F420034DFE5 /* ProtocolDeclaration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ProtocolDeclaration.swift; path = Tokens/ProtocolDeclaration.swift; sourceTree = ""; }; 340 | DC9EFA601CFC4F420034DFE5 /* ClassDeclaration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ClassDeclaration.swift; path = Tokens/ClassDeclaration.swift; sourceTree = ""; }; 341 | DC9EFA611CFC4F420034DFE5 /* Method.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Method.swift; path = Tokens/Method.swift; sourceTree = ""; }; 342 | DC9EFA621CFC4F420034DFE5 /* ProtocolMethod.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ProtocolMethod.swift; path = Tokens/ProtocolMethod.swift; sourceTree = ""; }; 343 | DC9EFA631CFC4F420034DFE5 /* Initializer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Initializer.swift; path = Tokens/Initializer.swift; sourceTree = ""; }; 344 | DC9EFA641CFC4F420034DFE5 /* MethodParameter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MethodParameter.swift; path = Tokens/MethodParameter.swift; sourceTree = ""; }; 345 | DC9EFA7F1CFC4FCF0034DFE5 /* ClassMethod.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ClassMethod.swift; path = Tokens/ClassMethod.swift; sourceTree = ""; }; 346 | DC9EFA801CFC4FCF0034DFE5 /* InstanceVariable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = InstanceVariable.swift; path = Tokens/InstanceVariable.swift; sourceTree = ""; }; 347 | DCAD1E8A1D0DA9B60091EECE /* Result.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Result.xcodeproj; path = Dependencies/SourceKitten/Carthage/Checkouts/Commandant/Carthage/Checkouts/Result/Result.xcodeproj; sourceTree = ""; }; 348 | DCAD1EC61D0DB3640091EECE /* Commandant.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Commandant.xcodeproj; path = Dependencies/SourceKitten/Carthage/Checkouts/Commandant/Commandant.xcodeproj; sourceTree = ""; }; 349 | DCDEE5101CFF124E007F18BC /* CuckooGeneratorError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CuckooGeneratorError.swift; sourceTree = ""; }; 350 | DCDEE5111CFF124E007F18BC /* GenerateMocksCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GenerateMocksCommand.swift; sourceTree = ""; }; 351 | /* End PBXFileReference section */ 352 | 353 | /* Begin PBXFrameworksBuildPhase section */ 354 | 1808B15D1C4575AA0036E924 /* Frameworks */ = { 355 | isa = PBXFrameworksBuildPhase; 356 | buildActionMask = 2147483647; 357 | files = ( 358 | DC8C4EE01CF9AF1C005213F8 /* CuckooGeneratorFramework.framework in Frameworks */, 359 | ); 360 | runOnlyForDeploymentPostprocessing = 0; 361 | }; 362 | 18E16D621C45D8280084EF54 /* Frameworks */ = { 363 | isa = PBXFrameworksBuildPhase; 364 | buildActionMask = 2147483647; 365 | files = ( 366 | DCAD1F131D0DB64E0091EECE /* Commandant.framework in Frameworks */, 367 | DCAD1EA51D0DA9CB0091EECE /* Result.framework in Frameworks */, 368 | DC5E8FD71D0DA57E00EFCA76 /* FileKit.framework in Frameworks */, 369 | DC5E8FD91D0DA57E00EFCA76 /* SourceKittenFramework.framework in Frameworks */, 370 | DC5E8FDA1D0DA57E00EFCA76 /* SWXMLHash.framework in Frameworks */, 371 | DC5E8FDB1D0DA57E00EFCA76 /* Yaml.framework in Frameworks */, 372 | ); 373 | runOnlyForDeploymentPostprocessing = 0; 374 | }; 375 | /* End PBXFrameworksBuildPhase section */ 376 | 377 | /* Begin PBXGroup section */ 378 | 1808B1571C4575AA0036E924 = { 379 | isa = PBXGroup; 380 | children = ( 381 | 1808B1A21C457B160036E924 /* Frameworks */, 382 | 1808B1621C4575AA0036E924 /* Source */, 383 | 1808B1611C4575AA0036E924 /* Products */, 384 | ); 385 | sourceTree = ""; 386 | }; 387 | 1808B1611C4575AA0036E924 /* Products */ = { 388 | isa = PBXGroup; 389 | children = ( 390 | 1808B1601C4575AA0036E924 /* cuckoo.app */, 391 | 18E16D661C45D8280084EF54 /* CuckooGeneratorFramework.framework */, 392 | ); 393 | name = Products; 394 | sourceTree = ""; 395 | }; 396 | 1808B1621C4575AA0036E924 /* Source */ = { 397 | isa = PBXGroup; 398 | children = ( 399 | DCDEE5101CFF124E007F18BC /* CuckooGeneratorError.swift */, 400 | DCDEE5111CFF124E007F18BC /* GenerateMocksCommand.swift */, 401 | 1808B1AA1C4581070036E924 /* main.swift */, 402 | DC5C26E51D0E9DA200630D49 /* VersionCommand.swift */, 403 | 18E16D671C45D8280084EF54 /* CuckooGeneratorFramework */, 404 | 18E16D971C45DF600084EF54 /* Supporting Files */, 405 | ); 406 | path = Source; 407 | sourceTree = ""; 408 | }; 409 | 1808B1A21C457B160036E924 /* Frameworks */ = { 410 | isa = PBXGroup; 411 | children = ( 412 | DCAD1EC61D0DB3640091EECE /* Commandant.xcodeproj */, 413 | DCAD1E8A1D0DA9B60091EECE /* Result.xcodeproj */, 414 | DC1AB6231D0D9FE500867895 /* Yaml.xcodeproj */, 415 | DC1AB60B1D0D9F8600867895 /* SWXMLHash.xcodeproj */, 416 | DC1AB5E41D0D9F1600867895 /* sourcekitten.xcodeproj */, 417 | DC1AB5D21D0D9F0B00867895 /* FileKit.xcodeproj */, 418 | DC8C4EA91CF9A272005213F8 /* CuckooGenerator.xcodeproj */, 419 | ); 420 | name = Frameworks; 421 | sourceTree = ""; 422 | }; 423 | 18601E8A1C46FA7400693A66 /* Supporting Files */ = { 424 | isa = PBXGroup; 425 | children = ( 426 | 18E16D681C45D8280084EF54 /* CuckooGeneratorFramework.h */, 427 | 18E16D6A1C45D8280084EF54 /* Info.plist */, 428 | ); 429 | path = "Supporting Files"; 430 | sourceTree = ""; 431 | }; 432 | 18E16D671C45D8280084EF54 /* CuckooGeneratorFramework */ = { 433 | isa = PBXGroup; 434 | children = ( 435 | DC5176331D2EE4D300E922F2 /* CodeBuilder.swift */, 436 | 18E16D591C45A85E0084EF54 /* FileHeaderHandler.swift */, 437 | 18F2BC1B1C46E8760015A95F /* Generator.swift */, 438 | 18E16D531C45A6AF0084EF54 /* Tokenizer.swift */, 439 | 18E16D511C45A6890084EF54 /* Utils.swift */, 440 | 18601E8A1C46FA7400693A66 /* Supporting Files */, 441 | DC9EFA551CFC4EC10034DFE5 /* Tokens */, 442 | ); 443 | name = CuckooGeneratorFramework; 444 | path = Source/CuckooGeneratorFramework; 445 | sourceTree = SOURCE_ROOT; 446 | }; 447 | 18E16D971C45DF600084EF54 /* Supporting Files */ = { 448 | isa = PBXGroup; 449 | children = ( 450 | 1808B16A1C4575AA0036E924 /* Info.plist */, 451 | 18E16D981C45DF7F0084EF54 /* Components.plist */, 452 | ); 453 | path = "Supporting Files"; 454 | sourceTree = ""; 455 | }; 456 | DC1AB5D31D0D9F0B00867895 /* Products */ = { 457 | isa = PBXGroup; 458 | children = ( 459 | DC1AB5DB1D0D9F0C00867895 /* FileKit.framework */, 460 | DC1AB5DD1D0D9F0C00867895 /* FileKit.framework */, 461 | DC1AB5DF1D0D9F0C00867895 /* FileKit.framework */, 462 | DC1AB5E11D0D9F0C00867895 /* FileKit.framework */, 463 | DC1AB5E31D0D9F0C00867895 /* FileKitTests.xctest */, 464 | ); 465 | name = Products; 466 | sourceTree = ""; 467 | }; 468 | DC1AB5E51D0D9F1600867895 /* Products */ = { 469 | isa = PBXGroup; 470 | children = ( 471 | DC1AB5EB1D0D9F1600867895 /* sourcekitten.app */, 472 | DC1AB5ED1D0D9F1600867895 /* SourceKittenFramework.framework */, 473 | DC1AB5EF1D0D9F1600867895 /* SourceKittenFrameworkTests.xctest */, 474 | ); 475 | name = Products; 476 | sourceTree = ""; 477 | }; 478 | DC1AB60C1D0D9F8600867895 /* Products */ = { 479 | isa = PBXGroup; 480 | children = ( 481 | DC1AB6161D0D9F8600867895 /* SWXMLHash.framework */, 482 | DC1AB6181D0D9F8600867895 /* SWXMLHash iOS Tests.xctest */, 483 | DC1AB61A1D0D9F8600867895 /* SWXMLHash.framework */, 484 | DC1AB61C1D0D9F8600867895 /* SWXMLHash OSX Tests.xctest */, 485 | DC1AB61E1D0D9F8600867895 /* SWXMLHash.framework */, 486 | DC1AB6201D0D9F8600867895 /* SWXMLHash tvOS Tests.xctest */, 487 | DC1AB6221D0D9F8600867895 /* SWXMLHash.framework */, 488 | ); 489 | name = Products; 490 | sourceTree = ""; 491 | }; 492 | DC1AB6241D0D9FE500867895 /* Products */ = { 493 | isa = PBXGroup; 494 | children = ( 495 | DC1AB62D1D0D9FE500867895 /* Yaml.framework */, 496 | DC1AB62F1D0D9FE500867895 /* Tests.xctest */, 497 | DC1AB6311D0D9FE500867895 /* Yaml.framework */, 498 | DC1AB6331D0D9FE500867895 /* Tests.xctest */, 499 | DC1AB6351D0D9FE500867895 /* Yaml.framework */, 500 | DC1AB6371D0D9FE500867895 /* Tests.xctest */, 501 | ); 502 | name = Products; 503 | sourceTree = ""; 504 | }; 505 | DC8C4EAA1CF9A272005213F8 /* Products */ = { 506 | isa = PBXGroup; 507 | name = Products; 508 | sourceTree = ""; 509 | }; 510 | DC9EFA551CFC4EC10034DFE5 /* Tokens */ = { 511 | isa = PBXGroup; 512 | children = ( 513 | DC9EFA5A1CFC4F420034DFE5 /* Accessibility.swift */, 514 | DC9EFA5B1CFC4F420034DFE5 /* Attributes.swift */, 515 | DC9EFA601CFC4F420034DFE5 /* ClassDeclaration.swift */, 516 | DC9EFA7F1CFC4FCF0034DFE5 /* ClassMethod.swift */, 517 | DC9EFA5E1CFC4F420034DFE5 /* ContainerToken.swift */, 518 | DC4094651D140180006FB137 /* ExtensionDeclaration.swift */, 519 | DC9EFA5C1CFC4F420034DFE5 /* FileRepresentation.swift */, 520 | DC40942E1D13F8FA006FB137 /* Import.swift */, 521 | DC9EFA631CFC4F420034DFE5 /* Initializer.swift */, 522 | DC9EFA801CFC4FCF0034DFE5 /* InstanceVariable.swift */, 523 | DC9EFA581CFC4F420034DFE5 /* Key.swift */, 524 | DC9EFA591CFC4F420034DFE5 /* Kinds.swift */, 525 | DC9EFA611CFC4F420034DFE5 /* Method.swift */, 526 | DC9EFA641CFC4F420034DFE5 /* MethodParameter.swift */, 527 | DC9EFA5F1CFC4F420034DFE5 /* ProtocolDeclaration.swift */, 528 | DC9EFA621CFC4F420034DFE5 /* ProtocolMethod.swift */, 529 | DC9EFA5D1CFC4F420034DFE5 /* Token.swift */, 530 | ); 531 | name = Tokens; 532 | sourceTree = ""; 533 | }; 534 | DCAD1E8B1D0DA9B60091EECE /* Products */ = { 535 | isa = PBXGroup; 536 | children = ( 537 | DCAD1E961D0DA9B70091EECE /* Result.framework */, 538 | DCAD1E981D0DA9B70091EECE /* Result-MacTests.xctest */, 539 | DCAD1E9A1D0DA9B70091EECE /* Result.framework */, 540 | DCAD1E9C1D0DA9B70091EECE /* Result-iOSTests.xctest */, 541 | DCAD1E9E1D0DA9B70091EECE /* Result.framework */, 542 | DCAD1EA01D0DA9B70091EECE /* Result-tvOSTests.xctest */, 543 | DCAD1EA21D0DA9B70091EECE /* Result.framework */, 544 | DCAD1EA41D0DA9B70091EECE /* Result-watchOSTests.xctest */, 545 | ); 546 | name = Products; 547 | sourceTree = ""; 548 | }; 549 | DCAD1EC71D0DB3640091EECE /* Products */ = { 550 | isa = PBXGroup; 551 | children = ( 552 | DCAD1ECC1D0DB3640091EECE /* Commandant.framework */, 553 | DCAD1ECE1D0DB3640091EECE /* Tests.xctest */, 554 | ); 555 | name = Products; 556 | sourceTree = ""; 557 | }; 558 | /* End PBXGroup section */ 559 | 560 | /* Begin PBXHeadersBuildPhase section */ 561 | 18E16D631C45D8280084EF54 /* Headers */ = { 562 | isa = PBXHeadersBuildPhase; 563 | buildActionMask = 2147483647; 564 | files = ( 565 | 18E16D691C45D8280084EF54 /* CuckooGeneratorFramework.h in Headers */, 566 | ); 567 | runOnlyForDeploymentPostprocessing = 0; 568 | }; 569 | /* End PBXHeadersBuildPhase section */ 570 | 571 | /* Begin PBXNativeTarget section */ 572 | 1808B15F1C4575AA0036E924 /* CuckooGenerator */ = { 573 | isa = PBXNativeTarget; 574 | buildConfigurationList = 1808B1781C4575AA0036E924 /* Build configuration list for PBXNativeTarget "CuckooGenerator" */; 575 | buildPhases = ( 576 | 1808B15C1C4575AA0036E924 /* Sources */, 577 | 1808B15D1C4575AA0036E924 /* Frameworks */, 578 | 1808B15E1C4575AA0036E924 /* Resources */, 579 | DC8C4EE41CF9AF1C005213F8 /* Embed Frameworks */, 580 | ); 581 | buildRules = ( 582 | ); 583 | dependencies = ( 584 | DC8C4EE31CF9AF1C005213F8 /* PBXTargetDependency */, 585 | ); 586 | name = CuckooGenerator; 587 | productName = "Mockery-Generator"; 588 | productReference = 1808B1601C4575AA0036E924 /* cuckoo.app */; 589 | productType = "com.apple.product-type.application"; 590 | }; 591 | 18E16D651C45D8280084EF54 /* CuckooGeneratorFramework */ = { 592 | isa = PBXNativeTarget; 593 | buildConfigurationList = 18E16D7D1C45D8280084EF54 /* Build configuration list for PBXNativeTarget "CuckooGeneratorFramework" */; 594 | buildPhases = ( 595 | 18E16D611C45D8280084EF54 /* Sources */, 596 | 18E16D621C45D8280084EF54 /* Frameworks */, 597 | 18E16D631C45D8280084EF54 /* Headers */, 598 | 18E16D641C45D8280084EF54 /* Resources */, 599 | 18E16D901C45D9A40084EF54 /* Embed Frameworks */, 600 | ); 601 | buildRules = ( 602 | ); 603 | dependencies = ( 604 | ); 605 | name = CuckooGeneratorFramework; 606 | productName = MockeryGeneratorFramework; 607 | productReference = 18E16D661C45D8280084EF54 /* CuckooGeneratorFramework.framework */; 608 | productType = "com.apple.product-type.framework"; 609 | }; 610 | /* End PBXNativeTarget section */ 611 | 612 | /* Begin PBXProject section */ 613 | 1808B1581C4575AA0036E924 /* Project object */ = { 614 | isa = PBXProject; 615 | attributes = { 616 | LastSwiftUpdateCheck = 0730; 617 | LastUpgradeCheck = 0720; 618 | ORGANIZATIONNAME = Brightify; 619 | TargetAttributes = { 620 | 1808B15F1C4575AA0036E924 = { 621 | CreatedOnToolsVersion = 7.2; 622 | }; 623 | 18E16D651C45D8280084EF54 = { 624 | CreatedOnToolsVersion = 7.2; 625 | }; 626 | }; 627 | }; 628 | buildConfigurationList = 1808B15B1C4575AA0036E924 /* Build configuration list for PBXProject "CuckooGenerator" */; 629 | compatibilityVersion = "Xcode 3.2"; 630 | developmentRegion = English; 631 | hasScannedForEncodings = 0; 632 | knownRegions = ( 633 | en, 634 | Base, 635 | ); 636 | mainGroup = 1808B1571C4575AA0036E924; 637 | productRefGroup = 1808B1611C4575AA0036E924 /* Products */; 638 | projectDirPath = ""; 639 | projectReferences = ( 640 | { 641 | ProductGroup = DCAD1EC71D0DB3640091EECE /* Products */; 642 | ProjectRef = DCAD1EC61D0DB3640091EECE /* Commandant.xcodeproj */; 643 | }, 644 | { 645 | ProductGroup = DC8C4EAA1CF9A272005213F8 /* Products */; 646 | ProjectRef = DC8C4EA91CF9A272005213F8 /* CuckooGenerator.xcodeproj */; 647 | }, 648 | { 649 | ProductGroup = DC1AB5D31D0D9F0B00867895 /* Products */; 650 | ProjectRef = DC1AB5D21D0D9F0B00867895 /* FileKit.xcodeproj */; 651 | }, 652 | { 653 | ProductGroup = DCAD1E8B1D0DA9B60091EECE /* Products */; 654 | ProjectRef = DCAD1E8A1D0DA9B60091EECE /* Result.xcodeproj */; 655 | }, 656 | { 657 | ProductGroup = DC1AB5E51D0D9F1600867895 /* Products */; 658 | ProjectRef = DC1AB5E41D0D9F1600867895 /* sourcekitten.xcodeproj */; 659 | }, 660 | { 661 | ProductGroup = DC1AB60C1D0D9F8600867895 /* Products */; 662 | ProjectRef = DC1AB60B1D0D9F8600867895 /* SWXMLHash.xcodeproj */; 663 | }, 664 | { 665 | ProductGroup = DC1AB6241D0D9FE500867895 /* Products */; 666 | ProjectRef = DC1AB6231D0D9FE500867895 /* Yaml.xcodeproj */; 667 | }, 668 | ); 669 | projectRoot = ""; 670 | targets = ( 671 | 1808B15F1C4575AA0036E924 /* CuckooGenerator */, 672 | 18E16D651C45D8280084EF54 /* CuckooGeneratorFramework */, 673 | ); 674 | }; 675 | /* End PBXProject section */ 676 | 677 | /* Begin PBXReferenceProxy section */ 678 | DC1AB5DB1D0D9F0C00867895 /* FileKit.framework */ = { 679 | isa = PBXReferenceProxy; 680 | fileType = wrapper.framework; 681 | path = FileKit.framework; 682 | remoteRef = DC1AB5DA1D0D9F0C00867895 /* PBXContainerItemProxy */; 683 | sourceTree = BUILT_PRODUCTS_DIR; 684 | }; 685 | DC1AB5DD1D0D9F0C00867895 /* FileKit.framework */ = { 686 | isa = PBXReferenceProxy; 687 | fileType = wrapper.framework; 688 | path = FileKit.framework; 689 | remoteRef = DC1AB5DC1D0D9F0C00867895 /* PBXContainerItemProxy */; 690 | sourceTree = BUILT_PRODUCTS_DIR; 691 | }; 692 | DC1AB5DF1D0D9F0C00867895 /* FileKit.framework */ = { 693 | isa = PBXReferenceProxy; 694 | fileType = wrapper.framework; 695 | path = FileKit.framework; 696 | remoteRef = DC1AB5DE1D0D9F0C00867895 /* PBXContainerItemProxy */; 697 | sourceTree = BUILT_PRODUCTS_DIR; 698 | }; 699 | DC1AB5E11D0D9F0C00867895 /* FileKit.framework */ = { 700 | isa = PBXReferenceProxy; 701 | fileType = wrapper.framework; 702 | path = FileKit.framework; 703 | remoteRef = DC1AB5E01D0D9F0C00867895 /* PBXContainerItemProxy */; 704 | sourceTree = BUILT_PRODUCTS_DIR; 705 | }; 706 | DC1AB5E31D0D9F0C00867895 /* FileKitTests.xctest */ = { 707 | isa = PBXReferenceProxy; 708 | fileType = wrapper.cfbundle; 709 | path = FileKitTests.xctest; 710 | remoteRef = DC1AB5E21D0D9F0C00867895 /* PBXContainerItemProxy */; 711 | sourceTree = BUILT_PRODUCTS_DIR; 712 | }; 713 | DC1AB5EB1D0D9F1600867895 /* sourcekitten.app */ = { 714 | isa = PBXReferenceProxy; 715 | fileType = wrapper.application; 716 | path = sourcekitten.app; 717 | remoteRef = DC1AB5EA1D0D9F1600867895 /* PBXContainerItemProxy */; 718 | sourceTree = BUILT_PRODUCTS_DIR; 719 | }; 720 | DC1AB5ED1D0D9F1600867895 /* SourceKittenFramework.framework */ = { 721 | isa = PBXReferenceProxy; 722 | fileType = wrapper.framework; 723 | path = SourceKittenFramework.framework; 724 | remoteRef = DC1AB5EC1D0D9F1600867895 /* PBXContainerItemProxy */; 725 | sourceTree = BUILT_PRODUCTS_DIR; 726 | }; 727 | DC1AB5EF1D0D9F1600867895 /* SourceKittenFrameworkTests.xctest */ = { 728 | isa = PBXReferenceProxy; 729 | fileType = wrapper.cfbundle; 730 | path = SourceKittenFrameworkTests.xctest; 731 | remoteRef = DC1AB5EE1D0D9F1600867895 /* PBXContainerItemProxy */; 732 | sourceTree = BUILT_PRODUCTS_DIR; 733 | }; 734 | DC1AB6161D0D9F8600867895 /* SWXMLHash.framework */ = { 735 | isa = PBXReferenceProxy; 736 | fileType = wrapper.framework; 737 | path = SWXMLHash.framework; 738 | remoteRef = DC1AB6151D0D9F8600867895 /* PBXContainerItemProxy */; 739 | sourceTree = BUILT_PRODUCTS_DIR; 740 | }; 741 | DC1AB6181D0D9F8600867895 /* SWXMLHash iOS Tests.xctest */ = { 742 | isa = PBXReferenceProxy; 743 | fileType = wrapper.cfbundle; 744 | path = "SWXMLHash iOS Tests.xctest"; 745 | remoteRef = DC1AB6171D0D9F8600867895 /* PBXContainerItemProxy */; 746 | sourceTree = BUILT_PRODUCTS_DIR; 747 | }; 748 | DC1AB61A1D0D9F8600867895 /* SWXMLHash.framework */ = { 749 | isa = PBXReferenceProxy; 750 | fileType = wrapper.framework; 751 | path = SWXMLHash.framework; 752 | remoteRef = DC1AB6191D0D9F8600867895 /* PBXContainerItemProxy */; 753 | sourceTree = BUILT_PRODUCTS_DIR; 754 | }; 755 | DC1AB61C1D0D9F8600867895 /* SWXMLHash OSX Tests.xctest */ = { 756 | isa = PBXReferenceProxy; 757 | fileType = wrapper.cfbundle; 758 | path = "SWXMLHash OSX Tests.xctest"; 759 | remoteRef = DC1AB61B1D0D9F8600867895 /* PBXContainerItemProxy */; 760 | sourceTree = BUILT_PRODUCTS_DIR; 761 | }; 762 | DC1AB61E1D0D9F8600867895 /* SWXMLHash.framework */ = { 763 | isa = PBXReferenceProxy; 764 | fileType = wrapper.framework; 765 | path = SWXMLHash.framework; 766 | remoteRef = DC1AB61D1D0D9F8600867895 /* PBXContainerItemProxy */; 767 | sourceTree = BUILT_PRODUCTS_DIR; 768 | }; 769 | DC1AB6201D0D9F8600867895 /* SWXMLHash tvOS Tests.xctest */ = { 770 | isa = PBXReferenceProxy; 771 | fileType = wrapper.cfbundle; 772 | path = "SWXMLHash tvOS Tests.xctest"; 773 | remoteRef = DC1AB61F1D0D9F8600867895 /* PBXContainerItemProxy */; 774 | sourceTree = BUILT_PRODUCTS_DIR; 775 | }; 776 | DC1AB6221D0D9F8600867895 /* SWXMLHash.framework */ = { 777 | isa = PBXReferenceProxy; 778 | fileType = wrapper.framework; 779 | path = SWXMLHash.framework; 780 | remoteRef = DC1AB6211D0D9F8600867895 /* PBXContainerItemProxy */; 781 | sourceTree = BUILT_PRODUCTS_DIR; 782 | }; 783 | DC1AB62D1D0D9FE500867895 /* Yaml.framework */ = { 784 | isa = PBXReferenceProxy; 785 | fileType = wrapper.framework; 786 | path = Yaml.framework; 787 | remoteRef = DC1AB62C1D0D9FE500867895 /* PBXContainerItemProxy */; 788 | sourceTree = BUILT_PRODUCTS_DIR; 789 | }; 790 | DC1AB62F1D0D9FE500867895 /* Tests.xctest */ = { 791 | isa = PBXReferenceProxy; 792 | fileType = wrapper.cfbundle; 793 | path = Tests.xctest; 794 | remoteRef = DC1AB62E1D0D9FE500867895 /* PBXContainerItemProxy */; 795 | sourceTree = BUILT_PRODUCTS_DIR; 796 | }; 797 | DC1AB6311D0D9FE500867895 /* Yaml.framework */ = { 798 | isa = PBXReferenceProxy; 799 | fileType = wrapper.framework; 800 | path = Yaml.framework; 801 | remoteRef = DC1AB6301D0D9FE500867895 /* PBXContainerItemProxy */; 802 | sourceTree = BUILT_PRODUCTS_DIR; 803 | }; 804 | DC1AB6331D0D9FE500867895 /* Tests.xctest */ = { 805 | isa = PBXReferenceProxy; 806 | fileType = wrapper.cfbundle; 807 | path = Tests.xctest; 808 | remoteRef = DC1AB6321D0D9FE500867895 /* PBXContainerItemProxy */; 809 | sourceTree = BUILT_PRODUCTS_DIR; 810 | }; 811 | DC1AB6351D0D9FE500867895 /* Yaml.framework */ = { 812 | isa = PBXReferenceProxy; 813 | fileType = wrapper.framework; 814 | path = Yaml.framework; 815 | remoteRef = DC1AB6341D0D9FE500867895 /* PBXContainerItemProxy */; 816 | sourceTree = BUILT_PRODUCTS_DIR; 817 | }; 818 | DC1AB6371D0D9FE500867895 /* Tests.xctest */ = { 819 | isa = PBXReferenceProxy; 820 | fileType = wrapper.cfbundle; 821 | path = Tests.xctest; 822 | remoteRef = DC1AB6361D0D9FE500867895 /* PBXContainerItemProxy */; 823 | sourceTree = BUILT_PRODUCTS_DIR; 824 | }; 825 | DCAD1E961D0DA9B70091EECE /* Result.framework */ = { 826 | isa = PBXReferenceProxy; 827 | fileType = wrapper.framework; 828 | path = Result.framework; 829 | remoteRef = DCAD1E951D0DA9B70091EECE /* PBXContainerItemProxy */; 830 | sourceTree = BUILT_PRODUCTS_DIR; 831 | }; 832 | DCAD1E981D0DA9B70091EECE /* Result-MacTests.xctest */ = { 833 | isa = PBXReferenceProxy; 834 | fileType = wrapper.cfbundle; 835 | path = "Result-MacTests.xctest"; 836 | remoteRef = DCAD1E971D0DA9B70091EECE /* PBXContainerItemProxy */; 837 | sourceTree = BUILT_PRODUCTS_DIR; 838 | }; 839 | DCAD1E9A1D0DA9B70091EECE /* Result.framework */ = { 840 | isa = PBXReferenceProxy; 841 | fileType = wrapper.framework; 842 | path = Result.framework; 843 | remoteRef = DCAD1E991D0DA9B70091EECE /* PBXContainerItemProxy */; 844 | sourceTree = BUILT_PRODUCTS_DIR; 845 | }; 846 | DCAD1E9C1D0DA9B70091EECE /* Result-iOSTests.xctest */ = { 847 | isa = PBXReferenceProxy; 848 | fileType = wrapper.cfbundle; 849 | path = "Result-iOSTests.xctest"; 850 | remoteRef = DCAD1E9B1D0DA9B70091EECE /* PBXContainerItemProxy */; 851 | sourceTree = BUILT_PRODUCTS_DIR; 852 | }; 853 | DCAD1E9E1D0DA9B70091EECE /* Result.framework */ = { 854 | isa = PBXReferenceProxy; 855 | fileType = wrapper.framework; 856 | path = Result.framework; 857 | remoteRef = DCAD1E9D1D0DA9B70091EECE /* PBXContainerItemProxy */; 858 | sourceTree = BUILT_PRODUCTS_DIR; 859 | }; 860 | DCAD1EA01D0DA9B70091EECE /* Result-tvOSTests.xctest */ = { 861 | isa = PBXReferenceProxy; 862 | fileType = wrapper.cfbundle; 863 | path = "Result-tvOSTests.xctest"; 864 | remoteRef = DCAD1E9F1D0DA9B70091EECE /* PBXContainerItemProxy */; 865 | sourceTree = BUILT_PRODUCTS_DIR; 866 | }; 867 | DCAD1EA21D0DA9B70091EECE /* Result.framework */ = { 868 | isa = PBXReferenceProxy; 869 | fileType = wrapper.framework; 870 | path = Result.framework; 871 | remoteRef = DCAD1EA11D0DA9B70091EECE /* PBXContainerItemProxy */; 872 | sourceTree = BUILT_PRODUCTS_DIR; 873 | }; 874 | DCAD1EA41D0DA9B70091EECE /* Result-watchOSTests.xctest */ = { 875 | isa = PBXReferenceProxy; 876 | fileType = wrapper.cfbundle; 877 | path = "Result-watchOSTests.xctest"; 878 | remoteRef = DCAD1EA31D0DA9B70091EECE /* PBXContainerItemProxy */; 879 | sourceTree = BUILT_PRODUCTS_DIR; 880 | }; 881 | DCAD1ECC1D0DB3640091EECE /* Commandant.framework */ = { 882 | isa = PBXReferenceProxy; 883 | fileType = wrapper.framework; 884 | path = Commandant.framework; 885 | remoteRef = DCAD1ECB1D0DB3640091EECE /* PBXContainerItemProxy */; 886 | sourceTree = BUILT_PRODUCTS_DIR; 887 | }; 888 | DCAD1ECE1D0DB3640091EECE /* Tests.xctest */ = { 889 | isa = PBXReferenceProxy; 890 | fileType = wrapper.cfbundle; 891 | path = Tests.xctest; 892 | remoteRef = DCAD1ECD1D0DB3640091EECE /* PBXContainerItemProxy */; 893 | sourceTree = BUILT_PRODUCTS_DIR; 894 | }; 895 | /* End PBXReferenceProxy section */ 896 | 897 | /* Begin PBXResourcesBuildPhase section */ 898 | 1808B15E1C4575AA0036E924 /* Resources */ = { 899 | isa = PBXResourcesBuildPhase; 900 | buildActionMask = 2147483647; 901 | files = ( 902 | 18E16D991C45DF7F0084EF54 /* Components.plist in Resources */, 903 | ); 904 | runOnlyForDeploymentPostprocessing = 0; 905 | }; 906 | 18E16D641C45D8280084EF54 /* Resources */ = { 907 | isa = PBXResourcesBuildPhase; 908 | buildActionMask = 2147483647; 909 | files = ( 910 | ); 911 | runOnlyForDeploymentPostprocessing = 0; 912 | }; 913 | /* End PBXResourcesBuildPhase section */ 914 | 915 | /* Begin PBXSourcesBuildPhase section */ 916 | 1808B15C1C4575AA0036E924 /* Sources */ = { 917 | isa = PBXSourcesBuildPhase; 918 | buildActionMask = 2147483647; 919 | files = ( 920 | DC5C26E61D0E9DA200630D49 /* VersionCommand.swift in Sources */, 921 | DCDEE5141CFF124E007F18BC /* CuckooGeneratorError.swift in Sources */, 922 | DCDEE5151CFF124E007F18BC /* GenerateMocksCommand.swift in Sources */, 923 | 1808B1AB1C4581070036E924 /* main.swift in Sources */, 924 | ); 925 | runOnlyForDeploymentPostprocessing = 0; 926 | }; 927 | 18E16D611C45D8280084EF54 /* Sources */ = { 928 | isa = PBXSourcesBuildPhase; 929 | buildActionMask = 2147483647; 930 | files = ( 931 | 18E16D841C45D8B30084EF54 /* Tokenizer.swift in Sources */, 932 | DC9EFA911CFC50070034DFE5 /* InstanceVariable.swift in Sources */, 933 | DC9EFA7C1CFC4F4D0034DFE5 /* ProtocolMethod.swift in Sources */, 934 | DC9EFA751CFC4F4D0034DFE5 /* Attributes.swift in Sources */, 935 | DC9EFA731CFC4F4D0034DFE5 /* Kinds.swift in Sources */, 936 | DC9EFA761CFC4F4D0034DFE5 /* FileRepresentation.swift in Sources */, 937 | DC9EFA7E1CFC4F4D0034DFE5 /* MethodParameter.swift in Sources */, 938 | DC9EFA7D1CFC4F4D0034DFE5 /* Initializer.swift in Sources */, 939 | DC9EFA791CFC4F4D0034DFE5 /* ProtocolDeclaration.swift in Sources */, 940 | DC9EFA721CFC4F4D0034DFE5 /* Key.swift in Sources */, 941 | DC5176351D2EE8F700E922F2 /* CodeBuilder.swift in Sources */, 942 | 18F2BC1D1C46E8E30015A95F /* Generator.swift in Sources */, 943 | DC9EFA901CFC50070034DFE5 /* ClassMethod.swift in Sources */, 944 | DC9EFA7A1CFC4F4D0034DFE5 /* ClassDeclaration.swift in Sources */, 945 | DC9EFA771CFC4F4D0034DFE5 /* Token.swift in Sources */, 946 | DC4094301D13F91F006FB137 /* Import.swift in Sources */, 947 | 18E16D831C45D8B30084EF54 /* Utils.swift in Sources */, 948 | DC9EFA7B1CFC4F4D0034DFE5 /* Method.swift in Sources */, 949 | DC4094861D140184006FB137 /* ExtensionDeclaration.swift in Sources */, 950 | DC9EFA741CFC4F4D0034DFE5 /* Accessibility.swift in Sources */, 951 | DC9EFA781CFC4F4D0034DFE5 /* ContainerToken.swift in Sources */, 952 | 18E16D871C45D8B30084EF54 /* FileHeaderHandler.swift in Sources */, 953 | ); 954 | runOnlyForDeploymentPostprocessing = 0; 955 | }; 956 | /* End PBXSourcesBuildPhase section */ 957 | 958 | /* Begin PBXTargetDependency section */ 959 | DC8C4EE31CF9AF1C005213F8 /* PBXTargetDependency */ = { 960 | isa = PBXTargetDependency; 961 | target = 18E16D651C45D8280084EF54 /* CuckooGeneratorFramework */; 962 | targetProxy = DC8C4EE21CF9AF1C005213F8 /* PBXContainerItemProxy */; 963 | }; 964 | /* End PBXTargetDependency section */ 965 | 966 | /* Begin XCBuildConfiguration section */ 967 | 1808B1761C4575AA0036E924 /* Debug */ = { 968 | isa = XCBuildConfiguration; 969 | buildSettings = { 970 | ALWAYS_SEARCH_USER_PATHS = NO; 971 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 972 | CLANG_CXX_LIBRARY = "libc++"; 973 | CLANG_ENABLE_MODULES = YES; 974 | CLANG_ENABLE_OBJC_ARC = YES; 975 | CLANG_WARN_BOOL_CONVERSION = YES; 976 | CLANG_WARN_CONSTANT_CONVERSION = YES; 977 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 978 | CLANG_WARN_EMPTY_BODY = YES; 979 | CLANG_WARN_ENUM_CONVERSION = YES; 980 | CLANG_WARN_INT_CONVERSION = YES; 981 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 982 | CLANG_WARN_UNREACHABLE_CODE = YES; 983 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 984 | CODE_SIGN_IDENTITY = "-"; 985 | COPY_PHASE_STRIP = NO; 986 | DEBUG_INFORMATION_FORMAT = dwarf; 987 | ENABLE_STRICT_OBJC_MSGSEND = YES; 988 | ENABLE_TESTABILITY = YES; 989 | GCC_C_LANGUAGE_STANDARD = gnu99; 990 | GCC_DYNAMIC_NO_PIC = NO; 991 | GCC_NO_COMMON_BLOCKS = YES; 992 | GCC_OPTIMIZATION_LEVEL = 0; 993 | GCC_PREPROCESSOR_DEFINITIONS = ( 994 | "DEBUG=1", 995 | "$(inherited)", 996 | ); 997 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 998 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 999 | GCC_WARN_UNDECLARED_SELECTOR = YES; 1000 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 1001 | GCC_WARN_UNUSED_FUNCTION = YES; 1002 | GCC_WARN_UNUSED_VARIABLE = YES; 1003 | LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks"; 1004 | MACOSX_DEPLOYMENT_TARGET = 10.11; 1005 | MTL_ENABLE_DEBUG_INFO = YES; 1006 | ONLY_ACTIVE_ARCH = YES; 1007 | OTHER_CODE_SIGN_FLAGS = "--deep"; 1008 | SDKROOT = macosx; 1009 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 1010 | }; 1011 | name = Debug; 1012 | }; 1013 | 1808B1771C4575AA0036E924 /* Release */ = { 1014 | isa = XCBuildConfiguration; 1015 | buildSettings = { 1016 | ALWAYS_SEARCH_USER_PATHS = NO; 1017 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 1018 | CLANG_CXX_LIBRARY = "libc++"; 1019 | CLANG_ENABLE_MODULES = YES; 1020 | CLANG_ENABLE_OBJC_ARC = YES; 1021 | CLANG_WARN_BOOL_CONVERSION = YES; 1022 | CLANG_WARN_CONSTANT_CONVERSION = YES; 1023 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 1024 | CLANG_WARN_EMPTY_BODY = YES; 1025 | CLANG_WARN_ENUM_CONVERSION = YES; 1026 | CLANG_WARN_INT_CONVERSION = YES; 1027 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 1028 | CLANG_WARN_UNREACHABLE_CODE = YES; 1029 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 1030 | CODE_SIGN_IDENTITY = "-"; 1031 | COPY_PHASE_STRIP = NO; 1032 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 1033 | ENABLE_NS_ASSERTIONS = NO; 1034 | ENABLE_STRICT_OBJC_MSGSEND = YES; 1035 | GCC_C_LANGUAGE_STANDARD = gnu99; 1036 | GCC_NO_COMMON_BLOCKS = YES; 1037 | GCC_PREPROCESSOR_DEFINITIONS = ""; 1038 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 1039 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 1040 | GCC_WARN_UNDECLARED_SELECTOR = YES; 1041 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 1042 | GCC_WARN_UNUSED_FUNCTION = YES; 1043 | GCC_WARN_UNUSED_VARIABLE = YES; 1044 | LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks"; 1045 | MACOSX_DEPLOYMENT_TARGET = 10.11; 1046 | MTL_ENABLE_DEBUG_INFO = NO; 1047 | OTHER_CODE_SIGN_FLAGS = "--deep"; 1048 | SDKROOT = macosx; 1049 | }; 1050 | name = Release; 1051 | }; 1052 | 1808B1791C4575AA0036E924 /* Debug */ = { 1053 | isa = XCBuildConfiguration; 1054 | buildSettings = { 1055 | CLANG_ENABLE_MODULES = YES; 1056 | COMBINE_HIDPI_IMAGES = YES; 1057 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; 1058 | FRAMEWORK_SEARCH_PATHS = ( 1059 | "$(inherit)", 1060 | "$(SRCROOT)", 1061 | ); 1062 | INFOPLIST_FILE = "Source/Supporting Files/Info.plist"; 1063 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks/CuckooGeneratorFramework.framework/Versions/Current/Frameworks @executable_path/../Frameworks"; 1064 | PRODUCT_BUNDLE_IDENTIFIER = org.brightify.CuckooGenerator; 1065 | PRODUCT_NAME = cuckoo; 1066 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 1067 | }; 1068 | name = Debug; 1069 | }; 1070 | 1808B17A1C4575AA0036E924 /* Release */ = { 1071 | isa = XCBuildConfiguration; 1072 | buildSettings = { 1073 | CLANG_ENABLE_MODULES = YES; 1074 | COMBINE_HIDPI_IMAGES = YES; 1075 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; 1076 | FRAMEWORK_SEARCH_PATHS = ( 1077 | "$(inherit)", 1078 | "$(SRCROOT)", 1079 | ); 1080 | INFOPLIST_FILE = "Source/Supporting Files/Info.plist"; 1081 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks/CuckooGeneratorFramework.framework/Versions/Current/Frameworks @executable_path/../Frameworks"; 1082 | PRODUCT_BUNDLE_IDENTIFIER = org.brightify.CuckooGenerator; 1083 | PRODUCT_NAME = cuckoo; 1084 | }; 1085 | name = Release; 1086 | }; 1087 | 18E16D7E1C45D8280084EF54 /* Debug */ = { 1088 | isa = XCBuildConfiguration; 1089 | buildSettings = { 1090 | COMBINE_HIDPI_IMAGES = YES; 1091 | CURRENT_PROJECT_VERSION = 1; 1092 | DEFINES_MODULE = YES; 1093 | DYLIB_COMPATIBILITY_VERSION = 1; 1094 | DYLIB_CURRENT_VERSION = 1; 1095 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 1096 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; 1097 | FRAMEWORK_SEARCH_PATHS = "$(inherited)"; 1098 | FRAMEWORK_VERSION = A; 1099 | INFOPLIST_FILE = "Source/CuckooGeneratorFramework/Supporting Files/Info.plist"; 1100 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 1101 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 1102 | PRODUCT_BUNDLE_IDENTIFIER = org.brightify.CuckooGeneratorFramework; 1103 | PRODUCT_NAME = CuckooGeneratorFramework; 1104 | SKIP_INSTALL = YES; 1105 | VERSIONING_SYSTEM = "apple-generic"; 1106 | VERSION_INFO_PREFIX = ""; 1107 | }; 1108 | name = Debug; 1109 | }; 1110 | 18E16D7F1C45D8280084EF54 /* Release */ = { 1111 | isa = XCBuildConfiguration; 1112 | buildSettings = { 1113 | COMBINE_HIDPI_IMAGES = YES; 1114 | CURRENT_PROJECT_VERSION = 1; 1115 | DEFINES_MODULE = YES; 1116 | DYLIB_COMPATIBILITY_VERSION = 1; 1117 | DYLIB_CURRENT_VERSION = 1; 1118 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 1119 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; 1120 | FRAMEWORK_SEARCH_PATHS = "$(inherited)"; 1121 | FRAMEWORK_VERSION = A; 1122 | INFOPLIST_FILE = "Source/CuckooGeneratorFramework/Supporting Files/Info.plist"; 1123 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 1124 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 1125 | PRODUCT_BUNDLE_IDENTIFIER = org.brightify.CuckooGeneratorFramework; 1126 | PRODUCT_NAME = CuckooGeneratorFramework; 1127 | SKIP_INSTALL = YES; 1128 | VERSIONING_SYSTEM = "apple-generic"; 1129 | VERSION_INFO_PREFIX = ""; 1130 | }; 1131 | name = Release; 1132 | }; 1133 | /* End XCBuildConfiguration section */ 1134 | 1135 | /* Begin XCConfigurationList section */ 1136 | 1808B15B1C4575AA0036E924 /* Build configuration list for PBXProject "CuckooGenerator" */ = { 1137 | isa = XCConfigurationList; 1138 | buildConfigurations = ( 1139 | 1808B1761C4575AA0036E924 /* Debug */, 1140 | 1808B1771C4575AA0036E924 /* Release */, 1141 | ); 1142 | defaultConfigurationIsVisible = 0; 1143 | defaultConfigurationName = Release; 1144 | }; 1145 | 1808B1781C4575AA0036E924 /* Build configuration list for PBXNativeTarget "CuckooGenerator" */ = { 1146 | isa = XCConfigurationList; 1147 | buildConfigurations = ( 1148 | 1808B1791C4575AA0036E924 /* Debug */, 1149 | 1808B17A1C4575AA0036E924 /* Release */, 1150 | ); 1151 | defaultConfigurationIsVisible = 0; 1152 | defaultConfigurationName = Release; 1153 | }; 1154 | 18E16D7D1C45D8280084EF54 /* Build configuration list for PBXNativeTarget "CuckooGeneratorFramework" */ = { 1155 | isa = XCConfigurationList; 1156 | buildConfigurations = ( 1157 | 18E16D7E1C45D8280084EF54 /* Debug */, 1158 | 18E16D7F1C45D8280084EF54 /* Release */, 1159 | ); 1160 | defaultConfigurationIsVisible = 0; 1161 | defaultConfigurationName = Release; 1162 | }; 1163 | /* End XCConfigurationList section */ 1164 | }; 1165 | rootObject = 1808B1581C4575AA0036E924 /* Project object */; 1166 | } 1167 | -------------------------------------------------------------------------------- /CuckooGenerator.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CuckooGenerator.xcodeproj/project.xcworkspace/xcshareddata/CuckooGenerator.xcscmblueprint: -------------------------------------------------------------------------------- 1 | { 2 | "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "8C7D0042C66E869BF59148B34297150D4FBCD754", 3 | "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { 4 | 5 | }, 6 | "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { 7 | "D0725CAC6FF2D66F2C83C2C48DC12106D42DAA64" : 0, 8 | "956D2B21DD155C49504BB67697A67F7C5351A353" : 0, 9 | "E111B14063EC98ABE518A93E1C4498F4167C2DEE" : 0, 10 | "8C7D0042C66E869BF59148B34297150D4FBCD754" : 0, 11 | "D23C0CEAADB77074FDA4459000068A7940EB7AD0" : 0, 12 | "64ACE19A884E8C30BC53E2E0CE86010ECED70B5A" : 0, 13 | "95438028B10BBB846574013D29F154A00556A9D1" : 0, 14 | "FD7DA18210A2C280E9107E37D7344F243FEE5F75" : 0, 15 | "EB2210CFD48672E403BED699D5D7F01B844069CF" : 0, 16 | "E084C86B03F81D63323C9E7510697EA528A758C7" : 0 17 | }, 18 | "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "89C40CF6-2BE4-4290-9B22-6C1C16D03073", 19 | "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { 20 | "D0725CAC6FF2D66F2C83C2C48DC12106D42DAA64" : "CuckooGenerator\/Dependencies\/SourceKitten\/Carthage\/Checkouts\/Commandant\/Carthage\/Checkouts\/Quick\/", 21 | "956D2B21DD155C49504BB67697A67F7C5351A353" : "CuckooGenerator\/Dependencies\/Commandant\/Carthage\/Checkouts\/Result\/", 22 | "E111B14063EC98ABE518A93E1C4498F4167C2DEE" : "CuckooGenerator\/Dependencies\/SourceKitten\/Carthage\/Checkouts\/YamlSwift\/", 23 | "8C7D0042C66E869BF59148B34297150D4FBCD754" : "CuckooGenerator\/", 24 | "D23C0CEAADB77074FDA4459000068A7940EB7AD0" : "CuckooGenerator\/Dependencies\/Commandant\/", 25 | "64ACE19A884E8C30BC53E2E0CE86010ECED70B5A" : "CuckooGenerator\/Dependencies\/FileKit\/", 26 | "95438028B10BBB846574013D29F154A00556A9D1" : "CuckooGenerator\/Dependencies\/SourceKitten\/Carthage\/Checkouts\/Commandant\/Carthage\/Checkouts\/Nimble\/", 27 | "FD7DA18210A2C280E9107E37D7344F243FEE5F75" : "CuckooGenerator\/Dependencies\/SourceKitten\/", 28 | "EB2210CFD48672E403BED699D5D7F01B844069CF" : "CuckooGenerator\/Dependencies\/SourceKitten\/Carthage\/Checkouts\/SWXMLHash\/", 29 | "E084C86B03F81D63323C9E7510697EA528A758C7" : "CuckooGenerator\/Dependencies\/Commandant\/Carthage\/Checkouts\/xcconfigs\/" 30 | }, 31 | "DVTSourceControlWorkspaceBlueprintNameKey" : "CuckooGenerator", 32 | "DVTSourceControlWorkspaceBlueprintVersion" : 204, 33 | "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "CuckooGenerator.xcodeproj", 34 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ 35 | { 36 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/nvzqz\/FileKit", 37 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 38 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "64ACE19A884E8C30BC53E2E0CE86010ECED70B5A" 39 | }, 40 | { 41 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/SwiftKit\/CuckooGenerator.git", 42 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 43 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "8C7D0042C66E869BF59148B34297150D4FBCD754" 44 | }, 45 | { 46 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/Quick\/Nimble.git", 47 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 48 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "95438028B10BBB846574013D29F154A00556A9D1" 49 | }, 50 | { 51 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/antitypical\/Result.git", 52 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 53 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "956D2B21DD155C49504BB67697A67F7C5351A353" 54 | }, 55 | { 56 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/Quick\/Quick.git", 57 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 58 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "D0725CAC6FF2D66F2C83C2C48DC12106D42DAA64" 59 | }, 60 | { 61 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/Carthage\/Commandant", 62 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 63 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "D23C0CEAADB77074FDA4459000068A7940EB7AD0" 64 | }, 65 | { 66 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/jspahrsummers\/xcconfigs.git", 67 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 68 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "E084C86B03F81D63323C9E7510697EA528A758C7" 69 | }, 70 | { 71 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/behrang\/YamlSwift.git", 72 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 73 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "E111B14063EC98ABE518A93E1C4498F4167C2DEE" 74 | }, 75 | { 76 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/drmohundro\/SWXMLHash.git", 77 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 78 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "EB2210CFD48672E403BED699D5D7F01B844069CF" 79 | }, 80 | { 81 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/jpsim\/SourceKitten", 82 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 83 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "FD7DA18210A2C280E9107E37D7344F243FEE5F75" 84 | } 85 | ] 86 | } -------------------------------------------------------------------------------- /CuckooGenerator.xcodeproj/xcshareddata/xcschemes/CuckooGenerator.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /CuckooGenerator.xcodeproj/xcshareddata/xcschemes/CuckooGeneratorFramework.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Tadeas Kriz 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Cuckoo generator 2 | Generator of Mocks for [Cuckoo](https://github.com/SwiftKit/Cuckoo). 3 | 4 | Please report all issues in [Cuckoo](https://github.com/SwiftKit/Cuckoo) repository. Also documentation can be found there too. 5 | -------------------------------------------------------------------------------- /Source/CuckooGeneratorError.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MockeryGeneratorError.swift 3 | // CuckooGenerator 4 | // 5 | // Created by Tadeas Kriz on 13/01/16. 6 | // Copyright © 2016 Brightify. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import FileKit 11 | 12 | public enum CuckooGeneratorError: ErrorType { 13 | case IOError(FileKitError) 14 | case UnknownError(ErrorType) 15 | 16 | public var description: String { 17 | switch self { 18 | case .IOError(let error): 19 | return error.description 20 | case .UnknownError(let error): 21 | return "\(error)" 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Source/CuckooGeneratorFramework/CodeBuilder.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CodeBuilder.swift 3 | // CuckooGenerator 4 | // 5 | // Created by Filip Dolnik on 06.07.16. 6 | // Copyright © 2016 Brightify. All rights reserved. 7 | // 8 | 9 | public class CodeBuilder { 10 | private static let Tab = " " 11 | 12 | public private(set) var code = "" 13 | 14 | private var nesting = 0 15 | 16 | public func clear() { 17 | code = "" 18 | } 19 | 20 | public func nest(@noescape closure: () -> ()) { 21 | nesting += 1 22 | closure() 23 | nesting -= 1 24 | } 25 | 26 | public func nest(line: String) { 27 | nest { self += line } 28 | } 29 | } 30 | 31 | public func +=(left: CodeBuilder, right: String) { 32 | (0.. String { 14 | let path: String 15 | if let absolutePath = file.sourceFile.path { 16 | path = getRelativePath(absolutePath) 17 | } else { 18 | path = "unknown" 19 | } 20 | let generationInfo = "// MARK: - Mocks generated from file: \(path)" + (timestamp ? " at \(NSDate())\n" : "") 21 | let header = getHeader(file) 22 | return generationInfo + "\n" + header + "\n" 23 | } 24 | 25 | public static func getImports(file: FileRepresentation, testableFrameworks: [String]) -> String { 26 | var frameworks = testableFrameworks.map { "@testable import \($0)\n" }.joinWithSeparator("") 27 | let imports = Array(Set(file.declarations.only(Import).map { "import " + $0.library + "\n" })).sort().joinWithSeparator("") 28 | if imports.isEmpty == false { 29 | frameworks += "\n" 30 | } 31 | return "import Cuckoo\n" + frameworks + imports 32 | } 33 | 34 | private static func getRelativePath(absolutePath: String) -> String { 35 | let path = Path(absolutePath) 36 | let base = path.commonAncestor(Path.Current) 37 | let components = path.components.suffixFrom(base.components.endIndex) 38 | let result = components.map { $0.rawValue }.joinWithSeparator(Path.separator) 39 | let difference = Path.Current.components.endIndex - base.components.endIndex 40 | return (0.. String { 44 | let possibleHeaderEnd = getPossibleHeaderEnd(file.sourceFile.contents.unicodeScalars.count, declarations: file.declarations) 45 | let possibleHeader = String(file.sourceFile.contents.utf8.prefix(possibleHeaderEnd)) ?? "" 46 | let singleLine = getPrefixToLastSingleLineComment(possibleHeader) 47 | let multiLine = getPrefixToLastMultiLineComment(possibleHeader) 48 | return singleLine.characters.count > multiLine.characters.count ? singleLine : multiLine 49 | } 50 | 51 | private static func getPossibleHeaderEnd(currentValue: Int, declarations: [Token]) -> Int { 52 | return declarations.reduce(currentValue) { minimum, declaration in 53 | let declarationMinimum: Int 54 | switch declaration { 55 | case let containerToken as ContainerToken: 56 | declarationMinimum = containerToken.range.startIndex 57 | case let method as Method: 58 | declarationMinimum = method.range.startIndex 59 | case let importToken as Import: 60 | declarationMinimum = importToken.range.startIndex 61 | default: 62 | declarationMinimum = minimum 63 | } 64 | return min(declarationMinimum, minimum) 65 | } 66 | } 67 | 68 | private static func getPrefixToLastSingleLineComment(text: String) -> String { 69 | if let range = text.rangeOfString("//", options: .BackwardsSearch) { 70 | let lastLine = text.lineRangeForRange(range) 71 | return text.substringToIndex(lastLine.endIndex) 72 | } else { 73 | return "" 74 | } 75 | } 76 | 77 | private static func getPrefixToLastMultiLineComment(text: String) -> String { 78 | if let range = text.rangeOfString("*/", options: .BackwardsSearch) { 79 | return text.substringToIndex(range.endIndex) + "\n" 80 | } else { 81 | return "" 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /Source/CuckooGeneratorFramework/Generator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generator.swift 3 | // CuckooGenerator 4 | // 5 | // Created by Tadeas Kriz on 13/01/16. 6 | // Copyright © 2016 Brightify. All rights reserved. 7 | // 8 | 9 | public struct Generator { 10 | 11 | private let declarations: [Token] 12 | private let code = CodeBuilder() 13 | 14 | public init(file: FileRepresentation) { 15 | declarations = file.declarations 16 | } 17 | 18 | public func generate() -> String { 19 | code.clear() 20 | declarations.forEach { generate($0) } 21 | return code.code 22 | } 23 | 24 | private func generate(token: Token) { 25 | switch token { 26 | case let containerToken as ContainerToken: 27 | generateMockingClass(containerToken) 28 | case let property as InstanceVariable: 29 | generateMockingProperty(property) 30 | case let method as Method: 31 | generateMockingMethod(method) 32 | default: 33 | break 34 | } 35 | } 36 | 37 | private func generateMockingClass(token: ContainerToken) { 38 | guard token.accessibility != .Private else { return } 39 | 40 | code += "" 41 | code += "\(token.accessibility.sourceName)class \(mockClassName(token.name)): \(token.name), Cuckoo.Mock {" 42 | code.nest { 43 | code += "\(token.accessibility.sourceName)typealias Stubbing = \(stubbingProxyName(token.name))" 44 | code += "\(token.accessibility.sourceName)typealias Verification = \(verificationProxyName(token.name))" 45 | code += "\(token.accessibility.sourceName)let manager = Cuckoo.MockManager()" 46 | code += "" 47 | code += "private var observed: \(token.name)?" 48 | code += "" 49 | code += "\(token.accessibility.sourceName)required\(token.implementation ? " override" : "") init() {" 50 | code += "}" 51 | code += "" 52 | code += "\(token.accessibility.sourceName)required init(spyOn victim: \(token.name)) {" 53 | code.nest("observed = victim") 54 | code += "}" 55 | token.children.forEach { generate($0) } 56 | code += "" 57 | generateStubbing(token) 58 | code += "" 59 | generateVerification(token) 60 | } 61 | code += "}" 62 | } 63 | 64 | private func generateMockingProperty(token: InstanceVariable) { 65 | guard token.accessibility != .Private else { return } 66 | 67 | code += "" 68 | code += "\(token.accessibility.sourceName)\(token.overriding ? "override " : "")var \(token.name): \(token.type) {" 69 | code.nest { 70 | code += "get {" 71 | code.nest("return manager.getter(\"\(token.name)\", original: observed.map { o in return { () -> \(token.type) in o.\(token.name) } })") 72 | code += "}" 73 | if token.readOnly == false { 74 | code += "set {" 75 | code.nest("manager.setter(\"\(token.name)\", value: newValue, original: observed != nil ? { self.observed?.\(token.name) = $0 } : nil)") 76 | code += "}" 77 | } 78 | } 79 | code += "}" 80 | } 81 | 82 | private func generateMockingMethod(token: Method) { 83 | guard token.accessibility != .Private else { return } 84 | 85 | let override = token is ClassMethod ? "override " : "" 86 | let parametersSignature = token.parameters.enumerate().map { "\($1.attributes.sourceRepresentation)\($1.labelAndNameAtPosition($0)): \($1.type)" }.joinWithSeparator(", ") 87 | 88 | var managerCall: String 89 | let tryIfThrowing: String 90 | if token.isThrowing { 91 | managerCall = "try manager.callThrows(\"\(token.fullyQualifiedName)\"" 92 | tryIfThrowing = "try " 93 | } else { 94 | managerCall = "manager.call(\"\(token.fullyQualifiedName)\"" 95 | tryIfThrowing = "" 96 | } 97 | let escapingParameters = token.parameters.map { 98 | if $0.attributes.contains(Attributes.noescape) || ($0.attributes.contains(Attributes.autoclosure) && !$0.attributes.contains(Attributes.escaping)) { 99 | return "Cuckoo.markerFunction()" 100 | } else { 101 | return $0.name 102 | } 103 | }.joinWithSeparator(", ") 104 | managerCall += ", parameters: (\(escapingParameters))" 105 | let methodCall = token.parameters.enumerate().map { ($1.labelOrNameAtPosition($0), $1.name ) }.map { $0.isEmpty ? $1 : "\($0): \($1)" }.joinWithSeparator(", ") 106 | managerCall += ", original: observed.map { o in return { (\(parametersSignature))\(token.returnSignature) in \(tryIfThrowing)o.\(token.rawName)(\(methodCall)) } })" 107 | 108 | code += "" 109 | code += "\(token.accessibility.sourceName)\(override)\(token.isInit ? "" : "func " )\(token.rawName)(\(parametersSignature))\(token.returnSignature) {" 110 | code.nest("return \(managerCall)") 111 | code += "}" 112 | } 113 | 114 | private func generateStubbing(token: Token) { 115 | switch token { 116 | case let containerToken as ContainerToken: 117 | generateStubbingClass(containerToken) 118 | case let property as InstanceVariable: 119 | generateStubbingProperty(property) 120 | case let method as Method: 121 | generateStubbingMethod(method) 122 | default: 123 | break 124 | } 125 | } 126 | 127 | private func generateStubbingClass(token: ContainerToken) { 128 | guard token.accessibility != .Private else { return } 129 | 130 | code += "\(token.accessibility.sourceName)struct \(stubbingProxyName(token.name)): Cuckoo.StubbingProxy {" 131 | code.nest { 132 | code += "private let manager: Cuckoo.MockManager" 133 | code += "" 134 | code += "\(token.accessibility.sourceName)init(manager: Cuckoo.MockManager) {" 135 | code.nest("self.manager = manager") 136 | code += "}" 137 | token.children.forEach { generateStubbing($0) } 138 | } 139 | code += "}" 140 | } 141 | 142 | private func generateStubbingProperty(token: InstanceVariable) { 143 | guard token.accessibility != .Private else { return } 144 | 145 | let propertyType = token.readOnly ? "Cuckoo.ToBeStubbedReadOnlyProperty" : "Cuckoo.ToBeStubbedProperty" 146 | 147 | code += "" 148 | code += "var \(token.name): \(propertyType)<\(token.type)> {" 149 | code.nest("return \(propertyType)(manager: manager, name: \"\(token.name)\")") 150 | code += "}" 151 | } 152 | 153 | private func generateStubbingMethod(token: Method) { 154 | guard token.accessibility != .Private else { return } 155 | 156 | let stubFunction: String 157 | if token.isThrowing { 158 | if token.returnType == "Void" { 159 | stubFunction = "Cuckoo.StubNoReturnThrowingFunction" 160 | } else { 161 | stubFunction = "Cuckoo.StubThrowingFunction" 162 | } 163 | } else { 164 | if token.returnType == "Void" { 165 | stubFunction = "Cuckoo.StubNoReturnFunction" 166 | } else { 167 | stubFunction = "Cuckoo.StubFunction" 168 | } 169 | } 170 | 171 | let inputTypes = token.parameters.map { $0.type }.joinWithSeparator(", ") 172 | var returnType = "\(stubFunction)<(\(inputTypes))" 173 | if token.returnType != "Void" { 174 | returnType += ", " 175 | returnType += token.returnType 176 | } 177 | returnType += ">" 178 | 179 | code += "" 180 | code += "@warn_unused_result" 181 | code += ("\(token.accessibility.sourceName)func \(token.rawName)\(matchableGenerics(token.parameters))" + 182 | "(\(matchableParameterSignature(token.parameters))) -> \(returnType) {") 183 | let matchers: String 184 | if token.parameters.isEmpty { 185 | matchers = "[]" 186 | } else { 187 | code.nest(parameterMatchers(token.parameters)) 188 | matchers = "matchers" 189 | } 190 | code.nest("return \(stubFunction)(stub: manager.createStub(\"\(token.fullyQualifiedName)\", parameterMatchers: \(matchers)))") 191 | code += "}" 192 | } 193 | 194 | private func generateVerification(token: Token) { 195 | switch token { 196 | case let containerToken as ContainerToken: 197 | generateVerificationClass(containerToken) 198 | case let property as InstanceVariable: 199 | generateVerificationProperty(property) 200 | case let method as Method: 201 | generateVerificationMethod(method) 202 | default: 203 | break 204 | } 205 | } 206 | 207 | private func generateVerificationClass(token: ContainerToken) { 208 | guard token.accessibility != .Private else { return } 209 | 210 | code += "\(token.accessibility.sourceName)struct \(verificationProxyName(token.name)): Cuckoo.VerificationProxy {" 211 | code.nest { 212 | code += "private let manager: Cuckoo.MockManager" 213 | code += "private let callMatcher: Cuckoo.CallMatcher" 214 | code += "private let sourceLocation: Cuckoo.SourceLocation" 215 | code += "" 216 | code += "\(token.accessibility.sourceName)init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) {" 217 | code.nest { 218 | code += "self.manager = manager" 219 | code += "self.callMatcher = callMatcher" 220 | code += "self.sourceLocation = sourceLocation" 221 | } 222 | code += "}" 223 | token.children.forEach { generateVerification($0) } 224 | } 225 | code += "}" 226 | } 227 | 228 | private func generateVerificationProperty(token: InstanceVariable) { 229 | guard token.accessibility != .Private else { return } 230 | 231 | let propertyType = token.readOnly ? "Cuckoo.VerifyReadOnlyProperty" : "Cuckoo.VerifyProperty" 232 | 233 | code += "" 234 | code += "var \(token.name): \(propertyType)<\(token.type)> {" 235 | code.nest("return \(propertyType)(manager: manager, name: \"\(token.name)\", callMatcher: callMatcher, sourceLocation: sourceLocation)") 236 | code += "}" 237 | } 238 | 239 | private func generateVerificationMethod(token: Method) { 240 | guard token.accessibility != .Private else { return } 241 | 242 | code += "" 243 | code += ("\(token.accessibility.sourceName)func \(token.rawName)\(matchableGenerics(token.parameters))" + 244 | "(\(matchableParameterSignature(token.parameters))) -> Cuckoo.__DoNotUse<\(token.returnType)> {") 245 | let matchers: String 246 | if token.parameters.isEmpty { 247 | matchers = "[] as [Cuckoo.ParameterMatcher]" 248 | } else { 249 | code.nest(parameterMatchers(token.parameters)) 250 | matchers = "matchers" 251 | } 252 | code.nest("return manager.verify(\"\(token.fullyQualifiedName)\", callMatcher: callMatcher, parameterMatchers: \(matchers), sourceLocation: sourceLocation)") 253 | code += "}" 254 | } 255 | 256 | private func mockClassName(originalName: String) -> String { 257 | return "Mock" + originalName 258 | } 259 | 260 | private func stubbingProxyName(originalName: String) -> String { 261 | return "__StubbingProxy_" + originalName 262 | } 263 | 264 | private func verificationProxyName(originalName: String) -> String { 265 | return "__VerificationProxy_" + originalName 266 | } 267 | 268 | private func matchableGenerics(parameters: [MethodParameter]) -> String { 269 | guard parameters.isEmpty == false else { return "" } 270 | 271 | let genericParameters = (1...parameters.count).map { "M\($0): Cuckoo.Matchable" }.joinWithSeparator(", ") 272 | let whereClause = parameters.enumerate().map { "M\($0 + 1).MatchedType == \($1.type)" }.joinWithSeparator(", ") 273 | return "<\(genericParameters) where \(whereClause)>" 274 | } 275 | 276 | private func matchableParameterSignature(parameters: [MethodParameter]) -> String { 277 | guard parameters.isEmpty == false else { return "" } 278 | 279 | return parameters.enumerate().map { "\($1.labelAndNameAtPosition($0)): M\($0 + 1)" }.joinWithSeparator(", ") 280 | } 281 | 282 | private func parameterMatchers(parameters: [MethodParameter]) -> String { 283 | guard parameters.isEmpty == false else { return "" } 284 | 285 | let tupleType = parameters.map { $0.type }.joinWithSeparator(", ") 286 | let matchers = parameters.enumerate().map { "wrapMatchable(\($1.name)) { $0\(parameters.count > 1 ? ".\($0)" : "") }" }.joinWithSeparator(", ") 287 | return "let matchers: [Cuckoo.ParameterMatcher<(\(tupleType))>] = [\(matchers)]" 288 | } 289 | } 290 | -------------------------------------------------------------------------------- /Source/CuckooGeneratorFramework/Supporting Files/CuckooGeneratorFramework.h: -------------------------------------------------------------------------------- 1 | // 2 | // CuckooGeneratorFramework.h 3 | // CuckooGeneratorFramework 4 | // 5 | // Created by Tadeas Kriz on 13/01/16. 6 | // Copyright © 2016 Brightify. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for CuckooGeneratorFramework. 12 | FOUNDATION_EXPORT double CuckooGeneratorFrameworkVersionNumber; 13 | 14 | //! Project version string for CuckooGeneratorFramework. 15 | FOUNDATION_EXPORT const unsigned char CuckooGeneratorFrameworkVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | -------------------------------------------------------------------------------- /Source/CuckooGeneratorFramework/Supporting Files/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 0.6.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSHumanReadableCopyright 24 | Copyright © 2016 Brightify. All rights reserved. 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Source/CuckooGeneratorFramework/Tokenizer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Tokenizer.swift 3 | // CuckooGenerator 4 | // 5 | // Created by Tadeas Kriz on 12/01/16. 6 | // Copyright © 2016 Brightify. All rights reserved. 7 | // 8 | 9 | import SourceKittenFramework 10 | 11 | public struct Tokenizer { 12 | private let file: File 13 | private let source: String 14 | 15 | public init(sourceFile: File) { 16 | self.file = sourceFile 17 | 18 | source = sourceFile.contents 19 | } 20 | 21 | public func tokenize() -> FileRepresentation { 22 | let structure = Structure(file: file) 23 | 24 | let declarations = tokenize(structure.dictionary[Key.Substructure.rawValue] as? [SourceKitRepresentable] ?? []) 25 | let imports = tokenizeImports(declarations) 26 | 27 | return FileRepresentation(sourceFile: file, declarations: declarations + imports) 28 | } 29 | 30 | private func tokenize(representables: [SourceKitRepresentable]) -> [Token] { 31 | return representables.flatMap(tokenize) 32 | } 33 | 34 | private func tokenize(representable: SourceKitRepresentable) -> Token? { 35 | guard let dictionary = representable as? [String: SourceKitRepresentable] else { return nil } 36 | 37 | // Common fields 38 | let name = dictionary[Key.Name.rawValue] as? String ?? "name not set" 39 | let kind = dictionary[Key.Kind.rawValue] as? String ?? dictionary[Key.Attribute.rawValue] as? String ?? "unknown type" 40 | 41 | // Optional fields 42 | let range = extractRange(dictionary, offsetKey: .Offset, lengthKey: .Length) 43 | let nameRange = extractRange(dictionary, offsetKey: .NameOffset, lengthKey: .NameLength) 44 | let bodyRange = extractRange(dictionary, offsetKey: .BodyOffset, lengthKey: .BodyLength) 45 | 46 | let accessibility = (dictionary[Key.Accessibility.rawValue] as? String).flatMap { Accessibility(rawValue: $0) } 47 | let type = dictionary[Key.TypeName.rawValue] as? String 48 | 49 | switch kind { 50 | case Kinds.ProtocolDeclaration.rawValue: 51 | let subtokens = tokenize(dictionary[Key.Substructure.rawValue] as? [SourceKitRepresentable] ?? []) 52 | let initializers = subtokens.only(Initializer) 53 | let children = subtokens.noneOf(Initializer) 54 | 55 | return ProtocolDeclaration( 56 | name: name, 57 | accessibility: accessibility!, 58 | range: range!, 59 | nameRange: nameRange!, 60 | bodyRange: bodyRange!, 61 | initializers: initializers, 62 | children: children) 63 | 64 | case Kinds.ClassDeclaration.rawValue: 65 | let subtokens = tokenize(dictionary[Key.Substructure.rawValue] as? [SourceKitRepresentable] ?? []) 66 | let initializers = subtokens.only(Initializer) 67 | let children = subtokens.noneOf(Initializer).map { child -> Token in 68 | if var property = child as? InstanceVariable { 69 | property.overriding = true 70 | return property 71 | } else { 72 | return child 73 | } 74 | } 75 | 76 | return ClassDeclaration( 77 | name: name, 78 | accessibility: accessibility!, 79 | range: range!, 80 | nameRange: nameRange!, 81 | bodyRange: bodyRange!, 82 | initializers: initializers, 83 | children: children) 84 | 85 | case Kinds.ExtensionDeclaration.rawValue: 86 | return ExtensionDeclaration(range: range!) 87 | 88 | case Kinds.InstanceVariable.rawValue: 89 | let setterAccessibility = (dictionary[Key.SetterAccessibility.rawValue] as? String).flatMap(Accessibility.init) 90 | 91 | if String(source.utf8.dropFirst(range!.startIndex)).takeUntilStringOccurs(name)?.trimmed.hasPrefix("let") == true { 92 | return nil 93 | } 94 | 95 | return InstanceVariable( 96 | name: name, 97 | type: type!, 98 | accessibility: accessibility!, 99 | setterAccessibility: setterAccessibility, 100 | range: range!, 101 | nameRange: nameRange!, 102 | overriding: false) 103 | 104 | case Kinds.InstanceMethod.rawValue: 105 | let parameters = tokenizeMethodParameters(name, dictionary[Key.Substructure.rawValue] as? [SourceKitRepresentable] ?? []) 106 | 107 | var returnSignature: String 108 | if let bodyRange = bodyRange { 109 | returnSignature = source[nameRange!.endIndex.. [MethodParameter] { 156 | // Takes the string between `(` and `)` 157 | let parameters = methodName.componentsSeparatedByString("(").last?.characters.dropLast(1).map { "\($0)" }.joinWithSeparator("") 158 | let parameterLabels: [String?] = parameters?.componentsSeparatedByString(":").map { $0 != "_" ? $0 : nil } ?? [] 159 | 160 | return zip(parameterLabels, representables).flatMap(tokenizeMethodParameter) 161 | } 162 | 163 | private func tokenizeMethodParameter(label: String?, _ representable: SourceKitRepresentable) -> MethodParameter? { 164 | guard let dictionary = representable as? [String: SourceKitRepresentable] else { return nil } 165 | 166 | let name = dictionary[Key.Name.rawValue] as? String ?? "name not set" 167 | let kind = dictionary[Key.Kind.rawValue] as? String ?? dictionary[Key.Attribute.rawValue] as? String ?? "unknown type" 168 | let range = extractRange(dictionary, offsetKey: .Offset, lengthKey: .Length) 169 | let nameRange = extractRange(dictionary, offsetKey: .NameOffset, lengthKey: .NameLength) 170 | let type = dictionary[Key.TypeName.rawValue] as? String 171 | 172 | switch kind { 173 | case Kinds.MethodParameter.rawValue: 174 | let attributes = tokenizeAttributes(dictionary[Key.Attributes.rawValue] as? [SourceKitRepresentable] ?? []) 175 | return MethodParameter(label: label, name: name, type: type!, range: range!, nameRange: nameRange!, attributes: attributes) 176 | 177 | default: 178 | fputs("Unknown method parameter kind: \(kind)", stderr) 179 | return nil 180 | } 181 | } 182 | 183 | private func tokenizeAttributes(representables: [SourceKitRepresentable]) -> Attributes { 184 | return representables.map(tokenizeAttribute).reduce(Attributes.none) { $0.union($1) } 185 | } 186 | 187 | private func tokenizeAttribute(representable: SourceKitRepresentable) -> Attributes { 188 | guard let dictionary = representable as? [String: SourceKitRepresentable] else { return Attributes.none } 189 | 190 | let kind = dictionary[Key.Kind.rawValue] as? String ?? dictionary[Key.Attribute.rawValue] as? String ?? "unknown type" 191 | let range = extractRange(dictionary, offsetKey: .Offset, lengthKey: .Length) 192 | 193 | switch kind { 194 | case Kinds.AutoclosureAttribute.rawValue: 195 | let autoclosure = "@autoclosure" + source[0.. [Token] { 210 | let rangesToIgnore: [Range] = otherTokens.flatMap { token in 211 | switch token { 212 | case let container as ContainerToken: 213 | return container.range 214 | case let extensionToken as ExtensionDeclaration: 215 | return extensionToken.range 216 | default: 217 | return nil 218 | } 219 | } 220 | do { 221 | let regex = try NSRegularExpression(pattern: "(?:\\b|;)import(?:\\s|(?:\\/\\/.*\\n)|(?:\\/\\*.*\\*\\/))+([^\\s;\\/]+)", options: []) 222 | let results = regex.matchesInString(source, options: [], range: NSMakeRange(0, source.characters.count)) 223 | return results.filter { result in 224 | rangesToIgnore.filter { $0 ~= result.range.location }.isEmpty 225 | }.map { 226 | // This NSRange is always a valid Range 227 | let range = $0.range.toRange()! 228 | let library = (source as NSString).substringWithRange($0.rangeAtIndex(1)) 229 | return Import(range: range, library: library) 230 | } 231 | } catch let error as NSError { 232 | fatalError("Invalid regex:" + error.description) 233 | } 234 | } 235 | } 236 | -------------------------------------------------------------------------------- /Source/CuckooGeneratorFramework/Tokens/Accessibility.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Accessibility.swift 3 | // CuckooGenerator 4 | // 5 | // Created by Filip Dolnik on 30.05.16. 6 | // Copyright © 2016 Brightify. All rights reserved. 7 | // 8 | 9 | public enum Accessibility: String { 10 | case Public = "source.lang.swift.accessibility.public" 11 | case Internal = "source.lang.swift.accessibility.internal" 12 | case Private = "source.lang.swift.accessibility.private" 13 | 14 | public var sourceName: String { 15 | switch self { 16 | case .Public: 17 | return "public " 18 | case .Internal: 19 | return "" 20 | case .Private: 21 | return "private " 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Source/CuckooGeneratorFramework/Tokens/Attributes.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Attributes.swift 3 | // CuckooGenerator 4 | // 5 | // Created by Filip Dolnik on 30.05.16. 6 | // Copyright © 2016 Brightify. All rights reserved. 7 | // 8 | 9 | public struct Attributes: OptionSetType { 10 | public static let none = Attributes(rawValue: 0) 11 | public static let noescape = Attributes(rawValue: 1 << 0) 12 | public static let autoclosure = Attributes(rawValue: 1 << 1) 13 | public static let escaping = Attributes(rawValue: 1 << 2) 14 | 15 | public static let escapingAutoclosure: Attributes = [autoclosure, escaping] 16 | 17 | public let rawValue : Int 18 | 19 | public init(rawValue: Int) { 20 | self.rawValue = rawValue 21 | } 22 | 23 | public var sourceRepresentation: String { 24 | return !self.isEmpty ? sourceRepresentations.joinWithSeparator(" ") + " " : "" 25 | } 26 | 27 | public var sourceRepresentations: [String] { 28 | var mutableCopy = self 29 | var representation: [String] = [] 30 | 31 | if let _ = mutableCopy.remove(Attributes.escapingAutoclosure) { 32 | representation.append("@autoclosure(escaping)") 33 | } 34 | 35 | if let _ = mutableCopy.remove(Attributes.autoclosure) { 36 | representation.append("@autoclosure") 37 | } 38 | 39 | if let _ = mutableCopy.remove(Attributes.noescape) { 40 | representation.append("@noescape") 41 | } 42 | 43 | if !mutableCopy.isEmpty { 44 | fputs("Unknown attributes: \(mutableCopy.rawValue)\n", stderr) 45 | } 46 | 47 | return representation 48 | } 49 | } -------------------------------------------------------------------------------- /Source/CuckooGeneratorFramework/Tokens/ClassDeclaration.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ClassDeclaration.swift 3 | // CuckooGenerator 4 | // 5 | // Created by Filip Dolnik on 30.05.16. 6 | // Copyright © 2016 Brightify. All rights reserved. 7 | // 8 | 9 | public struct ClassDeclaration: ContainerToken { 10 | public let name: String 11 | public let accessibility: Accessibility 12 | public let range: Range 13 | public let nameRange: Range 14 | public let bodyRange: Range 15 | public let initializers: [Initializer] 16 | public let children: [Token] 17 | public let implementation: Bool = true 18 | 19 | public var hasNoArgInit: Bool { 20 | return initializers.filter { $0.parameters.isEmpty }.isEmpty 21 | } 22 | } -------------------------------------------------------------------------------- /Source/CuckooGeneratorFramework/Tokens/ClassMethod.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ClassMethod.swift 3 | // CuckooGenerator 4 | // 5 | // Created by Filip Dolnik on 30.05.16. 6 | // Copyright © 2016 Brightify. All rights reserved. 7 | // 8 | 9 | public struct ClassMethod: Method { 10 | public let name: String 11 | public let accessibility: Accessibility 12 | public let returnSignature: String 13 | public let range: Range 14 | public let nameRange: Range 15 | public let parameters: [MethodParameter] 16 | 17 | public let bodyRange: Range 18 | } -------------------------------------------------------------------------------- /Source/CuckooGeneratorFramework/Tokens/ContainerToken.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContainerToken.swift 3 | // CuckooGenerator 4 | // 5 | // Created by Filip Dolnik on 30.05.16. 6 | // Copyright © 2016 Brightify. All rights reserved. 7 | // 8 | 9 | public protocol ContainerToken: Token { 10 | var name: String { get } 11 | var accessibility: Accessibility { get } 12 | var range: Range { get } 13 | var nameRange: Range { get } 14 | var bodyRange: Range { get } 15 | var initializers: [Initializer] { get } 16 | var children: [Token] { get } 17 | var implementation: Bool { get } 18 | } 19 | -------------------------------------------------------------------------------- /Source/CuckooGeneratorFramework/Tokens/ExtensionDeclaration.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ExtensionDeclaration.swift 3 | // CuckooGenerator 4 | // 5 | // Created by Filip Dolnik on 17.06.16. 6 | // Copyright © 2016 Brightify. All rights reserved. 7 | // 8 | 9 | public struct ExtensionDeclaration: Token { 10 | // TODO Implement support for extensions 11 | public let range: Range 12 | } -------------------------------------------------------------------------------- /Source/CuckooGeneratorFramework/Tokens/FileRepresentation.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FileRepresentation.swift 3 | // CuckooGenerator 4 | // 5 | // Created by Filip Dolnik on 30.05.16. 6 | // Copyright © 2016 Brightify. All rights reserved. 7 | // 8 | 9 | import SourceKittenFramework 10 | 11 | public struct FileRepresentation { 12 | public let sourceFile: File 13 | public let declarations: [Token] 14 | } -------------------------------------------------------------------------------- /Source/CuckooGeneratorFramework/Tokens/Import.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Import.swift 3 | // CuckooGenerator 4 | // 5 | // Created by Filip Dolnik on 17.06.16. 6 | // Copyright © 2016 Brightify. All rights reserved. 7 | // 8 | 9 | public struct Import: Token { 10 | public let range: Range 11 | public let library: String 12 | } -------------------------------------------------------------------------------- /Source/CuckooGeneratorFramework/Tokens/Initializer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Initializer.swift 3 | // CuckooGenerator 4 | // 5 | // Created by Filip Dolnik on 30.05.16. 6 | // Copyright © 2016 Brightify. All rights reserved. 7 | // 8 | 9 | public struct Initializer: Method { 10 | public let name: String 11 | public let accessibility: Accessibility 12 | public let returnSignature: String 13 | public let range: Range 14 | public let nameRange: Range 15 | public let parameters: [MethodParameter] 16 | 17 | public let required: Bool 18 | } -------------------------------------------------------------------------------- /Source/CuckooGeneratorFramework/Tokens/InstanceVariable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // InstanceVariable.swift 3 | // CuckooGenerator 4 | // 5 | // Created by Filip Dolnik on 30.05.16. 6 | // Copyright © 2016 Brightify. All rights reserved. 7 | // 8 | 9 | public struct InstanceVariable: Token { 10 | public var name: String 11 | public var type: String 12 | public var accessibility: Accessibility 13 | public var setterAccessibility: Accessibility? 14 | public var range: Range 15 | public var nameRange: Range 16 | public var overriding: Bool 17 | 18 | public var readOnly: Bool { 19 | return setterAccessibility == nil 20 | } 21 | } -------------------------------------------------------------------------------- /Source/CuckooGeneratorFramework/Tokens/Key.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Key.swift 3 | // CuckooGenerator 4 | // 5 | // Created by Filip Dolnik on 30.05.16. 6 | // Copyright © 2016 Brightify. All rights reserved. 7 | // 8 | 9 | public enum Key: String { 10 | case Substructure = "key.substructure" 11 | case Kind = "key.kind" 12 | case Accessibility = "key.accessibility" 13 | case SetterAccessibility = "key.setter_accessibility" 14 | case Name = "key.name" 15 | case TypeName = "key.typename" 16 | 17 | case Length = "key.length" 18 | case Offset = "key.offset" 19 | 20 | case NameLength = "key.namelength" 21 | case NameOffset = "key.nameoffset" 22 | 23 | case BodyLength = "key.bodylength" 24 | case BodyOffset = "key.bodyoffset" 25 | 26 | case Attributes = "key.attributes" 27 | case Attribute = "key.attribute" 28 | } -------------------------------------------------------------------------------- /Source/CuckooGeneratorFramework/Tokens/Kinds.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Kinds.swift 3 | // CuckooGenerator 4 | // 5 | // Created by Filip Dolnik on 30.05.16. 6 | // Copyright © 2016 Brightify. All rights reserved. 7 | // 8 | 9 | public enum Kinds: String { 10 | case ProtocolDeclaration = "source.lang.swift.decl.protocol" 11 | case InstanceMethod = "source.lang.swift.decl.function.method.instance" 12 | case MethodParameter = "source.lang.swift.decl.var.parameter" 13 | case ClassDeclaration = "source.lang.swift.decl.class" 14 | case ExtensionDeclaration = "source.lang.swift.decl.extension" 15 | case InstanceVariable = "source.lang.swift.decl.var.instance" 16 | 17 | case NoescapeAttribute = "source.decl.attribute.noescape" 18 | case AutoclosureAttribute = "source.decl.attribute.autoclosure" 19 | 20 | case Mark = "source.lang.swift.syntaxtype.comment.mark" 21 | } 22 | -------------------------------------------------------------------------------- /Source/CuckooGeneratorFramework/Tokens/Method.swift: -------------------------------------------------------------------------------- 1 | // 2 | // .swift 3 | // CuckooGenerator 4 | // 5 | // Created by Filip Dolnik on 30.05.16. 6 | // Copyright © 2016 Brightify. All rights reserved. 7 | // 8 | 9 | public protocol Method: Token { 10 | var name: String { get } 11 | var accessibility: Accessibility { get } 12 | var returnSignature: String { get } 13 | var range: Range { get } 14 | var nameRange: Range { get } 15 | var parameters: [MethodParameter] { get } 16 | } 17 | 18 | public extension Method { 19 | var rawName: String { 20 | return name.takeUntilStringOccurs("(") ?? "" 21 | } 22 | 23 | var isInit: Bool { 24 | return rawName == "init" 25 | } 26 | 27 | var fullyQualifiedName: String { 28 | let parameterTypes = parameters.map { $0.type } 29 | let nameParts = name.componentsSeparatedByString(":") 30 | let lastNamePart = nameParts.last ?? "" 31 | 32 | return zip(nameParts.dropLast(), parameterTypes) 33 | .map { $0 + ": " + $1 } 34 | .joinWithSeparator(", ") + lastNamePart + returnSignature 35 | } 36 | 37 | var isThrowing: Bool { 38 | return returnSignature.trimmed.hasPrefix("throws") 39 | } 40 | 41 | var returnType: String { 42 | if let range = returnSignature.rangeOfString("->") { 43 | return returnSignature.substringFromIndex(range.endIndex).trimmed 44 | } else { 45 | return "Void" 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /Source/CuckooGeneratorFramework/Tokens/MethodParameter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MethodParameter.swift 3 | // CuckooGenerator 4 | // 5 | // Created by Filip Dolnik on 30.05.16. 6 | // Copyright © 2016 Brightify. All rights reserved. 7 | // 8 | 9 | public struct MethodParameter: Token { 10 | public let label: String? 11 | public let name: String 12 | public let type: String 13 | public let range: Range 14 | public let nameRange: Range 15 | public let attributes: Attributes 16 | 17 | public func labelAndNameAtPosition(position: Int) -> String { 18 | let isFirst = position == 0 19 | if let label = label { 20 | return label != name || isFirst ? "\(label) \(name)" : name 21 | } else { 22 | return isFirst ? name : "_ \(name)" 23 | } 24 | } 25 | 26 | public func labelOrNameAtPosition(position: Int) -> String { 27 | let isFirst = position == 0 28 | if let label = label { 29 | return label 30 | } else if isFirst { 31 | return "" 32 | } else { 33 | return name 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /Source/CuckooGeneratorFramework/Tokens/ProtocolDeclaration.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ProtocolDeclaration.swift 3 | // CuckooGenerator 4 | // 5 | // Created by Filip Dolnik on 30.05.16. 6 | // Copyright © 2016 Brightify. All rights reserved. 7 | // 8 | 9 | public struct ProtocolDeclaration: ContainerToken { 10 | public let name: String 11 | public let accessibility: Accessibility 12 | public let range: Range 13 | public let nameRange: Range 14 | public let bodyRange: Range 15 | public let initializers: [Initializer] 16 | public let children: [Token] 17 | public let implementation: Bool = false 18 | } -------------------------------------------------------------------------------- /Source/CuckooGeneratorFramework/Tokens/ProtocolMethod.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ProtocolMethod.swift 3 | // CuckooGenerator 4 | // 5 | // Created by Filip Dolnik on 30.05.16. 6 | // Copyright © 2016 Brightify. All rights reserved. 7 | // 8 | 9 | public struct ProtocolMethod: Method { 10 | public let name: String 11 | public let accessibility: Accessibility 12 | public let returnSignature: String 13 | public let range: Range 14 | public let nameRange: Range 15 | public let parameters: [MethodParameter] 16 | } -------------------------------------------------------------------------------- /Source/CuckooGeneratorFramework/Tokens/Token.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Token.swift 3 | // CuckooGenerator 4 | // 5 | // Created by Filip Dolnik on 30.05.16. 6 | // Copyright © 2016 Brightify. All rights reserved. 7 | // 8 | 9 | public protocol Token { } 10 | -------------------------------------------------------------------------------- /Source/CuckooGeneratorFramework/Utils.swift: -------------------------------------------------------------------------------- 1 | // 2 | // String+Utility.swift 3 | // CuckooGenerator 4 | // 5 | // Created by Tadeas Kriz on 12/01/16. 6 | // Copyright © 2016 Brightify. All rights reserved. 7 | // 8 | 9 | import SourceKittenFramework 10 | 11 | extension String { 12 | var trimmed: String { 13 | return self.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()) 14 | } 15 | 16 | func takeUntilStringOccurs(occurence: String) -> String? { 17 | return self.componentsSeparatedByString(occurence).first 18 | } 19 | 20 | subscript(range: Range) -> String { 21 | let stringRange = startIndex.advancedBy(range.startIndex)..(type: T.Type) -> [T] { 29 | return flatMap { $0 as? T } 30 | } 31 | 32 | func noneOf(type: T.Type) -> [Generator.Element] { 33 | return filter { !($0 is T) } 34 | } 35 | } 36 | 37 | internal func extractRange(dictionary: [String: SourceKitRepresentable], offsetKey: Key, lengthKey: Key) -> Range? { 38 | guard let 39 | offset = (dictionary[offsetKey.rawValue] as? Int64).map({ Int($0) }), 40 | length = (dictionary[lengthKey.rawValue] as? Int64).map({ Int($0) }) 41 | else { return nil } 42 | 43 | return offset.. Result { 21 | let parsedFiles = options.files.map { File(path: $0) }.flatMap { $0 }.map { Tokenizer(sourceFile: $0).tokenize() } 22 | 23 | let headers = parsedFiles.map { options.noHeader ? "" : FileHeaderHandler.getHeader($0, withTimestamp: !options.noTimestamp) } 24 | let imports = parsedFiles.map { FileHeaderHandler.getImports($0, testableFrameworks: options.testableFrameworks) } 25 | let mocks = parsedFiles.map { Generator(file: $0).generate() } 26 | 27 | let mergedFiles = zip(zip(headers, imports), mocks).map { $0.0 + $0.1 + $1 } 28 | let outputPath = Path(options.output) 29 | 30 | do { 31 | if outputPath.isDirectory { 32 | let inputPaths = options.files.map { Path($0) } 33 | for (inputPath, outputText) in zip(inputPaths, mergedFiles) { 34 | let fileName = options.filePrefix + inputPath.fileName 35 | let outputFile = TextFile(path: outputPath + fileName) 36 | try outputText |> outputFile 37 | } 38 | } else { 39 | let outputFile = TextFile(path: outputPath) 40 | try mergedFiles.joinWithSeparator("\n") |> outputFile 41 | } 42 | } catch let error as FileKitError { 43 | return .Failure(.IOError(error)) 44 | } catch let error { 45 | return .Failure(.UnknownError(error)) 46 | } 47 | return .Success() 48 | } 49 | 50 | public struct Options: OptionsType { 51 | let files: [String] 52 | let output: String 53 | let noHeader: Bool 54 | let noTimestamp: Bool 55 | let testableFrameworks: [String] 56 | let filePrefix: String 57 | 58 | public static func create(output: String)(testableFrameworks: String)(noHeader: Bool)(noTimestamp: Bool)(filePrefix: String)(files: [String]) -> Options { 59 | return Options(files: files, output: output, noHeader: noHeader, noTimestamp: noTimestamp, testableFrameworks: testableFrameworks.componentsSeparatedByString(",").filter { !$0.isEmpty }, filePrefix: filePrefix) 60 | } 61 | 62 | public static func evaluate(m: CommandMode) -> Result> { 63 | return create 64 | <*> m <| Option(key: "output", defaultValue: "GeneratedMocks.swift", usage: "Where to put the generated mocks.\nIf a path to a directory is supplied, each input file will have a respective output file with mocks.\nIf a path to a Swift file is supplied, all mocks will be in a single file.\nDefault value is `GeneratedMocks.swift`.") 65 | <*> m <| Option(key: "testable", defaultValue: "", usage: "A comma separated list of frameworks that should be imported as @testable in the mock files.") 66 | <*> m <| Option(key: "no-header", defaultValue: false, usage: "Do not generate file headers.") 67 | <*> m <| Option(key: "no-timestamp", defaultValue: false, usage: "Do not generate timestamp.") 68 | <*> m <| Option(key: "file-prefix", defaultValue: "", usage: "Names of generated files in directory will start with this prefix. Only works when output path is directory.") 69 | <*> m <| Argument(usage: "Files to parse and generate mocks for.") 70 | } 71 | } 72 | } -------------------------------------------------------------------------------- /Source/Supporting Files/Components.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | BundleIsVersionChecked 7 | 8 | BundleOverwriteAction 9 | upgrade 10 | ChildBundles 11 | 12 | 13 | BundleOverwriteAction 14 | 15 | RootRelativeBundlePath 16 | /usr/local/Frameworks/CuckooGeneratorFramework.framework/Versions/A/Frameworks/FileKit.framework 17 | 18 | 19 | BundleOverwriteAction 20 | 21 | RootRelativeBundlePath 22 | /usr/local/Frameworks/CuckooGeneratorFramework.framework/Versions/A/Frameworks/Result.framework 23 | 24 | 25 | BundleOverwriteAction 26 | 27 | RootRelativeBundlePath 28 | /usr/local/Frameworks/CuckooGeneratorFramework.framework/Versions/A/Frameworks/Commandant.framework 29 | 30 | 31 | BundleOverwriteAction 32 | 33 | RootRelativeBundlePath 34 | /usr/local/Frameworks/CuckooGeneratorFramework.framework/Versions/A/Frameworks/SWXMLHash.framework 35 | 36 | 37 | BundleOverwriteAction 38 | 39 | RootRelativeBundlePath 40 | /usr/local/Frameworks/CuckooGeneratorFramework.framework/Versions/A/Frameworks/SourceKittenFramework.framework 41 | 42 | 43 | RootRelativeBundlePath 44 | /usr/local/Frameworks/CuckooGeneratorFramework.framework 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Source/Supporting Files/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 0.6.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | NSHumanReadableCopyright 28 | Copyright © 2016 Brightify. All rights reserved. 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /Source/VersionCommand.swift: -------------------------------------------------------------------------------- 1 | // 2 | // VersionCommand.swift 3 | // CuckooGenerator 4 | // 5 | // Created by Tadeas Kriz on 17/01/16. 6 | // Copyright © 2016 Brightify. All rights reserved. 7 | // 8 | 9 | import Commandant 10 | import Result 11 | 12 | public struct VersionCommand: CommandType { 13 | 14 | static let appVersion = NSBundle.allFrameworks().filter { 15 | $0.bundleIdentifier == "org.brightify.CuckooGeneratorFramework" 16 | }.first?.objectForInfoDictionaryKey("CFBundleShortVersionString") as? String ?? "" 17 | 18 | public let verb = "version" 19 | public let function = "Prints the version of this generator." 20 | 21 | public func run(options: Options) -> Result { 22 | print(VersionCommand.appVersion) 23 | return .Success() 24 | } 25 | 26 | public struct Options: OptionsType { 27 | public static func evaluate(m: CommandMode) -> Result> { 28 | return .Success(Options()) 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /Source/main.swift: -------------------------------------------------------------------------------- 1 | //#!/usr/bin/swift -F Carthage/Build/Mac 2 | // 3 | // main.swift 4 | // SwiftMockGenerator 5 | // 6 | // Created by Tadeas Kriz on 12/01/16. 7 | // Copyright © 2016 Brightify. All rights reserved. 8 | // 9 | 10 | import Commandant 11 | 12 | let registry = CommandRegistry() 13 | registry.register(GenerateMocksCommand()) 14 | registry.register(VersionCommand()) 15 | 16 | let helpCommand = HelpCommand(registry: registry) 17 | registry.register(helpCommand) 18 | 19 | registry.main(defaultVerb: helpCommand.verb) { error in 20 | fputs(error.description + "\n", stderr) 21 | } -------------------------------------------------------------------------------- /Tests/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | gem 'aruba', '~> 0.14.1' 3 | -------------------------------------------------------------------------------- /Tests/SourceFiles/ClassWithAttributes.swift: -------------------------------------------------------------------------------- 1 | /* Multi 2 | line 3 | comment */ 4 | 5 | @objc 6 | public class ClassWithAttributes { 7 | } -------------------------------------------------------------------------------- /Tests/SourceFiles/EmptyClass.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EmptyClass.swift 3 | // Cuckoo 4 | // 5 | // Created by Tadeas Kriz on 09/02/16. 6 | // Copyright © 2016 Brightify. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class EmptyClass { 12 | } -------------------------------------------------------------------------------- /Tests/SourceFiles/Expected/ClassWithAttributes.swift: -------------------------------------------------------------------------------- 1 | // MARK: - Mocks generated from file: ../../Tests/SourceFiles/ClassWithAttributes.swift 2 | /* Multi 3 | line 4 | comment */ 5 | 6 | import Cuckoo 7 | 8 | public class MockClassWithAttributes: ClassWithAttributes, Cuckoo.Mock { 9 | public typealias Stubbing = __StubbingProxy_ClassWithAttributes 10 | public typealias Verification = __VerificationProxy_ClassWithAttributes 11 | public let manager = Cuckoo.MockManager() 12 | 13 | private var observed: ClassWithAttributes? 14 | 15 | public required override init() { 16 | } 17 | 18 | public required init(spyOn victim: ClassWithAttributes) { 19 | observed = victim 20 | } 21 | 22 | public struct __StubbingProxy_ClassWithAttributes: Cuckoo.StubbingProxy { 23 | private let manager: Cuckoo.MockManager 24 | 25 | public init(manager: Cuckoo.MockManager) { 26 | self.manager = manager 27 | } 28 | } 29 | 30 | public struct __VerificationProxy_ClassWithAttributes: Cuckoo.VerificationProxy { 31 | private let manager: Cuckoo.MockManager 32 | private let callMatcher: Cuckoo.CallMatcher 33 | private let sourceLocation: Cuckoo.SourceLocation 34 | 35 | public init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { 36 | self.manager = manager 37 | self.callMatcher = callMatcher 38 | self.sourceLocation = sourceLocation 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Tests/SourceFiles/Expected/GeneratedMocks.swift: -------------------------------------------------------------------------------- 1 | // MARK: - Mocks generated from file: ../../Tests/SourceFiles/TestedClass.swift 2 | // 3 | // TestedClass.swift 4 | // Cuckoo 5 | // 6 | // Created by Tadeas Kriz on 09/02/16. 7 | // Copyright © 2016 Brightify. All rights reserved. 8 | // 9 | 10 | import Cuckoo 11 | 12 | class MockTestedClass: TestedClass, Cuckoo.Mock { 13 | typealias Stubbing = __StubbingProxy_TestedClass 14 | typealias Verification = __VerificationProxy_TestedClass 15 | let manager = Cuckoo.MockManager() 16 | 17 | private var observed: TestedClass? 18 | 19 | required override init() { 20 | } 21 | 22 | required init(spyOn victim: TestedClass) { 23 | observed = victim 24 | } 25 | 26 | override var readOnlyProperty: String { 27 | get { 28 | return manager.getter("readOnlyProperty", original: observed.map { o in return { () -> String in o.readOnlyProperty } }) 29 | } 30 | } 31 | 32 | override var readWriteProperty: Int { 33 | get { 34 | return manager.getter("readWriteProperty", original: observed.map { o in return { () -> Int in o.readWriteProperty } }) 35 | } 36 | set { 37 | manager.setter("readWriteProperty", value: newValue, original: observed != nil ? { self.observed?.readWriteProperty = $0 } : nil) 38 | } 39 | } 40 | 41 | override var optionalProperty: Int? { 42 | get { 43 | return manager.getter("optionalProperty", original: observed.map { o in return { () -> Int? in o.optionalProperty } }) 44 | } 45 | set { 46 | manager.setter("optionalProperty", value: newValue, original: observed != nil ? { self.observed?.optionalProperty = $0 } : nil) 47 | } 48 | } 49 | 50 | override func noReturn() { 51 | return manager.call("noReturn()", parameters: (), original: observed.map { o in return { () in o.noReturn() } }) 52 | } 53 | 54 | override func countCharacters(test: String) -> Int { 55 | return manager.call("countCharacters(_: String) -> Int", parameters: (test), original: observed.map { o in return { (test: String) -> Int in o.countCharacters(test) } }) 56 | } 57 | 58 | override func withThrows() throws -> Int { 59 | return try manager.callThrows("withThrows() throws -> Int", parameters: (), original: observed.map { o in return { () throws -> Int in try o.withThrows() } }) 60 | } 61 | 62 | override func withNoReturnThrows() throws { 63 | return try manager.callThrows("withNoReturnThrows() throws", parameters: (), original: observed.map { o in return { () throws in try o.withNoReturnThrows() } }) 64 | } 65 | 66 | override func withClosure(closure: String -> Int) -> Int { 67 | return manager.call("withClosure(_: String -> Int) -> Int", parameters: (closure), original: observed.map { o in return { (closure: String -> Int) -> Int in o.withClosure(closure) } }) 68 | } 69 | 70 | override func withNoescape(a: String, @noescape closure: String -> Void) { 71 | return manager.call("withNoescape(_: String, closure: String -> Void)", parameters: (a, Cuckoo.markerFunction()), original: observed.map { o in return { (a: String, @noescape closure: String -> Void) in o.withNoescape(a, closure: closure) } }) 72 | } 73 | 74 | override func withOptionalClosure(a: String, closure: (String -> Void)?) { 75 | return manager.call("withOptionalClosure(_: String, closure: (String -> Void)?)", parameters: (a, closure), original: observed.map { o in return { (a: String, closure: (String -> Void)?) in o.withOptionalClosure(a, closure: closure) } }) 76 | } 77 | 78 | struct __StubbingProxy_TestedClass: Cuckoo.StubbingProxy { 79 | private let manager: Cuckoo.MockManager 80 | 81 | init(manager: Cuckoo.MockManager) { 82 | self.manager = manager 83 | } 84 | 85 | var readOnlyProperty: Cuckoo.ToBeStubbedReadOnlyProperty { 86 | return Cuckoo.ToBeStubbedReadOnlyProperty(manager: manager, name: "readOnlyProperty") 87 | } 88 | 89 | var readWriteProperty: Cuckoo.ToBeStubbedProperty { 90 | return Cuckoo.ToBeStubbedProperty(manager: manager, name: "readWriteProperty") 91 | } 92 | 93 | var optionalProperty: Cuckoo.ToBeStubbedProperty { 94 | return Cuckoo.ToBeStubbedProperty(manager: manager, name: "optionalProperty") 95 | } 96 | 97 | @warn_unused_result 98 | func noReturn() -> Cuckoo.StubNoReturnFunction<()> { 99 | return Cuckoo.StubNoReturnFunction(stub: manager.createStub("noReturn()", parameterMatchers: [])) 100 | } 101 | 102 | @warn_unused_result 103 | func countCharacters(test: M1) -> Cuckoo.StubFunction<(String), Int> { 104 | let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrapMatchable(test) { $0 }] 105 | return Cuckoo.StubFunction(stub: manager.createStub("countCharacters(_: String) -> Int", parameterMatchers: matchers)) 106 | } 107 | 108 | @warn_unused_result 109 | func withThrows() -> Cuckoo.StubThrowingFunction<(), Int> { 110 | return Cuckoo.StubThrowingFunction(stub: manager.createStub("withThrows() throws -> Int", parameterMatchers: [])) 111 | } 112 | 113 | @warn_unused_result 114 | func withNoReturnThrows() -> Cuckoo.StubNoReturnThrowingFunction<()> { 115 | return Cuckoo.StubNoReturnThrowingFunction(stub: manager.createStub("withNoReturnThrows() throws", parameterMatchers: [])) 116 | } 117 | 118 | @warn_unused_result 119 | func withClosure Int>(closure: M1) -> Cuckoo.StubFunction<(String -> Int), Int> { 120 | let matchers: [Cuckoo.ParameterMatcher<(String -> Int)>] = [wrapMatchable(closure) { $0 }] 121 | return Cuckoo.StubFunction(stub: manager.createStub("withClosure(_: String -> Int) -> Int", parameterMatchers: matchers)) 122 | } 123 | 124 | @warn_unused_result 125 | func withNoescape Void>(a: M1, closure: M2) -> Cuckoo.StubNoReturnFunction<(String, String -> Void)> { 126 | let matchers: [Cuckoo.ParameterMatcher<(String, String -> Void)>] = [wrapMatchable(a) { $0.0 }, wrapMatchable(closure) { $0.1 }] 127 | return Cuckoo.StubNoReturnFunction(stub: manager.createStub("withNoescape(_: String, closure: String -> Void)", parameterMatchers: matchers)) 128 | } 129 | 130 | @warn_unused_result 131 | func withOptionalClosure Void)?>(a: M1, closure: M2) -> Cuckoo.StubNoReturnFunction<(String, (String -> Void)?)> { 132 | let matchers: [Cuckoo.ParameterMatcher<(String, (String -> Void)?)>] = [wrapMatchable(a) { $0.0 }, wrapMatchable(closure) { $0.1 }] 133 | return Cuckoo.StubNoReturnFunction(stub: manager.createStub("withOptionalClosure(_: String, closure: (String -> Void)?)", parameterMatchers: matchers)) 134 | } 135 | } 136 | 137 | struct __VerificationProxy_TestedClass: Cuckoo.VerificationProxy { 138 | private let manager: Cuckoo.MockManager 139 | private let callMatcher: Cuckoo.CallMatcher 140 | private let sourceLocation: Cuckoo.SourceLocation 141 | 142 | init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { 143 | self.manager = manager 144 | self.callMatcher = callMatcher 145 | self.sourceLocation = sourceLocation 146 | } 147 | 148 | var readOnlyProperty: Cuckoo.VerifyReadOnlyProperty { 149 | return Cuckoo.VerifyReadOnlyProperty(manager: manager, name: "readOnlyProperty", callMatcher: callMatcher, sourceLocation: sourceLocation) 150 | } 151 | 152 | var readWriteProperty: Cuckoo.VerifyProperty { 153 | return Cuckoo.VerifyProperty(manager: manager, name: "readWriteProperty", callMatcher: callMatcher, sourceLocation: sourceLocation) 154 | } 155 | 156 | var optionalProperty: Cuckoo.VerifyProperty { 157 | return Cuckoo.VerifyProperty(manager: manager, name: "optionalProperty", callMatcher: callMatcher, sourceLocation: sourceLocation) 158 | } 159 | 160 | func noReturn() -> Cuckoo.__DoNotUse { 161 | return manager.verify("noReturn()", callMatcher: callMatcher, parameterMatchers: [] as [Cuckoo.ParameterMatcher], sourceLocation: sourceLocation) 162 | } 163 | 164 | func countCharacters(test: M1) -> Cuckoo.__DoNotUse { 165 | let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrapMatchable(test) { $0 }] 166 | return manager.verify("countCharacters(_: String) -> Int", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) 167 | } 168 | 169 | func withThrows() -> Cuckoo.__DoNotUse { 170 | return manager.verify("withThrows() throws -> Int", callMatcher: callMatcher, parameterMatchers: [] as [Cuckoo.ParameterMatcher], sourceLocation: sourceLocation) 171 | } 172 | 173 | func withNoReturnThrows() -> Cuckoo.__DoNotUse { 174 | return manager.verify("withNoReturnThrows() throws", callMatcher: callMatcher, parameterMatchers: [] as [Cuckoo.ParameterMatcher], sourceLocation: sourceLocation) 175 | } 176 | 177 | func withClosure Int>(closure: M1) -> Cuckoo.__DoNotUse { 178 | let matchers: [Cuckoo.ParameterMatcher<(String -> Int)>] = [wrapMatchable(closure) { $0 }] 179 | return manager.verify("withClosure(_: String -> Int) -> Int", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) 180 | } 181 | 182 | func withNoescape Void>(a: M1, closure: M2) -> Cuckoo.__DoNotUse { 183 | let matchers: [Cuckoo.ParameterMatcher<(String, String -> Void)>] = [wrapMatchable(a) { $0.0 }, wrapMatchable(closure) { $0.1 }] 184 | return manager.verify("withNoescape(_: String, closure: String -> Void)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) 185 | } 186 | 187 | func withOptionalClosure Void)?>(a: M1, closure: M2) -> Cuckoo.__DoNotUse { 188 | let matchers: [Cuckoo.ParameterMatcher<(String, (String -> Void)?)>] = [wrapMatchable(a) { $0.0 }, wrapMatchable(closure) { $0.1 }] 189 | return manager.verify("withOptionalClosure(_: String, closure: (String -> Void)?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) 190 | } 191 | } 192 | } 193 | 194 | // MARK: - Mocks generated from file: ../../Tests/SourceFiles/TestedProtocol.swift 195 | // 196 | // TestedProtocol.swift 197 | // Cuckoo 198 | // 199 | // Created by Tadeas Kriz on 18/01/16. 200 | // Copyright © 2016 Brightify. All rights reserved. 201 | // 202 | 203 | import Cuckoo 204 | 205 | class MockTestedProtocol: TestedProtocol, Cuckoo.Mock { 206 | typealias Stubbing = __StubbingProxy_TestedProtocol 207 | typealias Verification = __VerificationProxy_TestedProtocol 208 | let manager = Cuckoo.MockManager() 209 | 210 | private var observed: TestedProtocol? 211 | 212 | required init() { 213 | } 214 | 215 | required init(spyOn victim: TestedProtocol) { 216 | observed = victim 217 | } 218 | 219 | var readOnlyProperty: String { 220 | get { 221 | return manager.getter("readOnlyProperty", original: observed.map { o in return { () -> String in o.readOnlyProperty } }) 222 | } 223 | } 224 | 225 | var readWriteProperty: Int { 226 | get { 227 | return manager.getter("readWriteProperty", original: observed.map { o in return { () -> Int in o.readWriteProperty } }) 228 | } 229 | set { 230 | manager.setter("readWriteProperty", value: newValue, original: observed != nil ? { self.observed?.readWriteProperty = $0 } : nil) 231 | } 232 | } 233 | 234 | var optionalProperty: Int? { 235 | get { 236 | return manager.getter("optionalProperty", original: observed.map { o in return { () -> Int? in o.optionalProperty } }) 237 | } 238 | set { 239 | manager.setter("optionalProperty", value: newValue, original: observed != nil ? { self.observed?.optionalProperty = $0 } : nil) 240 | } 241 | } 242 | 243 | func noReturn() { 244 | return manager.call("noReturn()", parameters: (), original: observed.map { o in return { () in o.noReturn() } }) 245 | } 246 | 247 | func countCharacters(test: String) -> Int { 248 | return manager.call("countCharacters(_: String) -> Int", parameters: (test), original: observed.map { o in return { (test: String) -> Int in o.countCharacters(test) } }) 249 | } 250 | 251 | func withThrows() throws -> Int { 252 | return try manager.callThrows("withThrows() throws -> Int", parameters: (), original: observed.map { o in return { () throws -> Int in try o.withThrows() } }) 253 | } 254 | 255 | func withNoReturnThrows() throws { 256 | return try manager.callThrows("withNoReturnThrows() throws", parameters: (), original: observed.map { o in return { () throws in try o.withNoReturnThrows() } }) 257 | } 258 | 259 | func withClosure(closure: String -> Int) -> Int { 260 | return manager.call("withClosure(_: String -> Int) -> Int", parameters: (closure), original: observed.map { o in return { (closure: String -> Int) -> Int in o.withClosure(closure) } }) 261 | } 262 | 263 | func withNoescape(a: String, @noescape closure: String -> Void) { 264 | return manager.call("withNoescape(_: String, closure: String -> Void)", parameters: (a, Cuckoo.markerFunction()), original: observed.map { o in return { (a: String, @noescape closure: String -> Void) in o.withNoescape(a, closure: closure) } }) 265 | } 266 | 267 | func withOptionalClosure(a: String, closure: (String -> Void)?) { 268 | return manager.call("withOptionalClosure(_: String, closure: (String -> Void)?)", parameters: (a, closure), original: observed.map { o in return { (a: String, closure: (String -> Void)?) in o.withOptionalClosure(a, closure: closure) } }) 269 | } 270 | 271 | struct __StubbingProxy_TestedProtocol: Cuckoo.StubbingProxy { 272 | private let manager: Cuckoo.MockManager 273 | 274 | init(manager: Cuckoo.MockManager) { 275 | self.manager = manager 276 | } 277 | 278 | var readOnlyProperty: Cuckoo.ToBeStubbedReadOnlyProperty { 279 | return Cuckoo.ToBeStubbedReadOnlyProperty(manager: manager, name: "readOnlyProperty") 280 | } 281 | 282 | var readWriteProperty: Cuckoo.ToBeStubbedProperty { 283 | return Cuckoo.ToBeStubbedProperty(manager: manager, name: "readWriteProperty") 284 | } 285 | 286 | var optionalProperty: Cuckoo.ToBeStubbedProperty { 287 | return Cuckoo.ToBeStubbedProperty(manager: manager, name: "optionalProperty") 288 | } 289 | 290 | @warn_unused_result 291 | func noReturn() -> Cuckoo.StubNoReturnFunction<()> { 292 | return Cuckoo.StubNoReturnFunction(stub: manager.createStub("noReturn()", parameterMatchers: [])) 293 | } 294 | 295 | @warn_unused_result 296 | func countCharacters(test: M1) -> Cuckoo.StubFunction<(String), Int> { 297 | let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrapMatchable(test) { $0 }] 298 | return Cuckoo.StubFunction(stub: manager.createStub("countCharacters(_: String) -> Int", parameterMatchers: matchers)) 299 | } 300 | 301 | @warn_unused_result 302 | func withThrows() -> Cuckoo.StubThrowingFunction<(), Int> { 303 | return Cuckoo.StubThrowingFunction(stub: manager.createStub("withThrows() throws -> Int", parameterMatchers: [])) 304 | } 305 | 306 | @warn_unused_result 307 | func withNoReturnThrows() -> Cuckoo.StubNoReturnThrowingFunction<()> { 308 | return Cuckoo.StubNoReturnThrowingFunction(stub: manager.createStub("withNoReturnThrows() throws", parameterMatchers: [])) 309 | } 310 | 311 | @warn_unused_result 312 | func withClosure Int>(closure: M1) -> Cuckoo.StubFunction<(String -> Int), Int> { 313 | let matchers: [Cuckoo.ParameterMatcher<(String -> Int)>] = [wrapMatchable(closure) { $0 }] 314 | return Cuckoo.StubFunction(stub: manager.createStub("withClosure(_: String -> Int) -> Int", parameterMatchers: matchers)) 315 | } 316 | 317 | @warn_unused_result 318 | func withNoescape Void>(a: M1, closure: M2) -> Cuckoo.StubNoReturnFunction<(String, String -> Void)> { 319 | let matchers: [Cuckoo.ParameterMatcher<(String, String -> Void)>] = [wrapMatchable(a) { $0.0 }, wrapMatchable(closure) { $0.1 }] 320 | return Cuckoo.StubNoReturnFunction(stub: manager.createStub("withNoescape(_: String, closure: String -> Void)", parameterMatchers: matchers)) 321 | } 322 | 323 | @warn_unused_result 324 | func withOptionalClosure Void)?>(a: M1, closure: M2) -> Cuckoo.StubNoReturnFunction<(String, (String -> Void)?)> { 325 | let matchers: [Cuckoo.ParameterMatcher<(String, (String -> Void)?)>] = [wrapMatchable(a) { $0.0 }, wrapMatchable(closure) { $0.1 }] 326 | return Cuckoo.StubNoReturnFunction(stub: manager.createStub("withOptionalClosure(_: String, closure: (String -> Void)?)", parameterMatchers: matchers)) 327 | } 328 | } 329 | 330 | struct __VerificationProxy_TestedProtocol: Cuckoo.VerificationProxy { 331 | private let manager: Cuckoo.MockManager 332 | private let callMatcher: Cuckoo.CallMatcher 333 | private let sourceLocation: Cuckoo.SourceLocation 334 | 335 | init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { 336 | self.manager = manager 337 | self.callMatcher = callMatcher 338 | self.sourceLocation = sourceLocation 339 | } 340 | 341 | var readOnlyProperty: Cuckoo.VerifyReadOnlyProperty { 342 | return Cuckoo.VerifyReadOnlyProperty(manager: manager, name: "readOnlyProperty", callMatcher: callMatcher, sourceLocation: sourceLocation) 343 | } 344 | 345 | var readWriteProperty: Cuckoo.VerifyProperty { 346 | return Cuckoo.VerifyProperty(manager: manager, name: "readWriteProperty", callMatcher: callMatcher, sourceLocation: sourceLocation) 347 | } 348 | 349 | var optionalProperty: Cuckoo.VerifyProperty { 350 | return Cuckoo.VerifyProperty(manager: manager, name: "optionalProperty", callMatcher: callMatcher, sourceLocation: sourceLocation) 351 | } 352 | 353 | func noReturn() -> Cuckoo.__DoNotUse { 354 | return manager.verify("noReturn()", callMatcher: callMatcher, parameterMatchers: [] as [Cuckoo.ParameterMatcher], sourceLocation: sourceLocation) 355 | } 356 | 357 | func countCharacters(test: M1) -> Cuckoo.__DoNotUse { 358 | let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrapMatchable(test) { $0 }] 359 | return manager.verify("countCharacters(_: String) -> Int", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) 360 | } 361 | 362 | func withThrows() -> Cuckoo.__DoNotUse { 363 | return manager.verify("withThrows() throws -> Int", callMatcher: callMatcher, parameterMatchers: [] as [Cuckoo.ParameterMatcher], sourceLocation: sourceLocation) 364 | } 365 | 366 | func withNoReturnThrows() -> Cuckoo.__DoNotUse { 367 | return manager.verify("withNoReturnThrows() throws", callMatcher: callMatcher, parameterMatchers: [] as [Cuckoo.ParameterMatcher], sourceLocation: sourceLocation) 368 | } 369 | 370 | func withClosure Int>(closure: M1) -> Cuckoo.__DoNotUse { 371 | let matchers: [Cuckoo.ParameterMatcher<(String -> Int)>] = [wrapMatchable(closure) { $0 }] 372 | return manager.verify("withClosure(_: String -> Int) -> Int", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) 373 | } 374 | 375 | func withNoescape Void>(a: M1, closure: M2) -> Cuckoo.__DoNotUse { 376 | let matchers: [Cuckoo.ParameterMatcher<(String, String -> Void)>] = [wrapMatchable(a) { $0.0 }, wrapMatchable(closure) { $0.1 }] 377 | return manager.verify("withNoescape(_: String, closure: String -> Void)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) 378 | } 379 | 380 | func withOptionalClosure Void)?>(a: M1, closure: M2) -> Cuckoo.__DoNotUse { 381 | let matchers: [Cuckoo.ParameterMatcher<(String, (String -> Void)?)>] = [wrapMatchable(a) { $0.0 }, wrapMatchable(closure) { $0.1 }] 382 | return manager.verify("withOptionalClosure(_: String, closure: (String -> Void)?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) 383 | } 384 | } 385 | } 386 | -------------------------------------------------------------------------------- /Tests/SourceFiles/Expected/Imports.swift: -------------------------------------------------------------------------------- 1 | // MARK: - Mocks generated from file: ../../Tests/SourceFiles/Imports.swift 2 | // 3 | // Imports.swift 4 | // Cuckoo 5 | // 6 | // Created by Tadeas Kriz on 18/01/16. 7 | // Copyright © 2016 Brightify. All rights reserved. 8 | // 9 | 10 | import Cuckoo 11 | 12 | import a 13 | import b 14 | import c 15 | import d 16 | import e 17 | import f 18 | import g 19 | import h 20 | import i 21 | 22 | class MockA: A, Cuckoo.Mock { 23 | typealias Stubbing = __StubbingProxy_A 24 | typealias Verification = __VerificationProxy_A 25 | let manager = Cuckoo.MockManager() 26 | 27 | private var observed: A? 28 | 29 | required override init() { 30 | } 31 | 32 | required init(spyOn victim: A) { 33 | observed = victim 34 | } 35 | 36 | struct __StubbingProxy_A: Cuckoo.StubbingProxy { 37 | private let manager: Cuckoo.MockManager 38 | 39 | init(manager: Cuckoo.MockManager) { 40 | self.manager = manager 41 | } 42 | } 43 | 44 | struct __VerificationProxy_A: Cuckoo.VerificationProxy { 45 | private let manager: Cuckoo.MockManager 46 | private let callMatcher: Cuckoo.CallMatcher 47 | private let sourceLocation: Cuckoo.SourceLocation 48 | 49 | init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { 50 | self.manager = manager 51 | self.callMatcher = callMatcher 52 | self.sourceLocation = sourceLocation 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Tests/SourceFiles/Expected/MultipleClasses.swift: -------------------------------------------------------------------------------- 1 | // MARK: - Mocks generated from file: ../../Tests/SourceFiles/MultipleClasses.swift 2 | // 3 | // MultipleClasses.swift 4 | // Cuckoo 5 | // 6 | // Created by Tadeas Kriz on 18/01/16. 7 | // Copyright © 2016 Brightify. All rights reserved. 8 | // 9 | 10 | import Cuckoo 11 | 12 | class MockA: A, Cuckoo.Mock { 13 | typealias Stubbing = __StubbingProxy_A 14 | typealias Verification = __VerificationProxy_A 15 | let manager = Cuckoo.MockManager() 16 | 17 | private var observed: A? 18 | 19 | required override init() { 20 | } 21 | 22 | required init(spyOn victim: A) { 23 | observed = victim 24 | } 25 | 26 | struct __StubbingProxy_A: Cuckoo.StubbingProxy { 27 | private let manager: Cuckoo.MockManager 28 | 29 | init(manager: Cuckoo.MockManager) { 30 | self.manager = manager 31 | } 32 | } 33 | 34 | struct __VerificationProxy_A: Cuckoo.VerificationProxy { 35 | private let manager: Cuckoo.MockManager 36 | private let callMatcher: Cuckoo.CallMatcher 37 | private let sourceLocation: Cuckoo.SourceLocation 38 | 39 | init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { 40 | self.manager = manager 41 | self.callMatcher = callMatcher 42 | self.sourceLocation = sourceLocation 43 | } 44 | } 45 | } 46 | 47 | class MockB: B, Cuckoo.Mock { 48 | typealias Stubbing = __StubbingProxy_B 49 | typealias Verification = __VerificationProxy_B 50 | let manager = Cuckoo.MockManager() 51 | 52 | private var observed: B? 53 | 54 | required override init() { 55 | } 56 | 57 | required init(spyOn victim: B) { 58 | observed = victim 59 | } 60 | 61 | struct __StubbingProxy_B: Cuckoo.StubbingProxy { 62 | private let manager: Cuckoo.MockManager 63 | 64 | init(manager: Cuckoo.MockManager) { 65 | self.manager = manager 66 | } 67 | } 68 | 69 | struct __VerificationProxy_B: Cuckoo.VerificationProxy { 70 | private let manager: Cuckoo.MockManager 71 | private let callMatcher: Cuckoo.CallMatcher 72 | private let sourceLocation: Cuckoo.SourceLocation 73 | 74 | init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { 75 | self.manager = manager 76 | self.callMatcher = callMatcher 77 | self.sourceLocation = sourceLocation 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /Tests/SourceFiles/Expected/NoHeader.swift: -------------------------------------------------------------------------------- 1 | import Cuckoo 2 | 3 | import Foundation 4 | 5 | class MockEmptyClass: EmptyClass, Cuckoo.Mock { 6 | typealias Stubbing = __StubbingProxy_EmptyClass 7 | typealias Verification = __VerificationProxy_EmptyClass 8 | let manager = Cuckoo.MockManager() 9 | 10 | private var observed: EmptyClass? 11 | 12 | required override init() { 13 | } 14 | 15 | required init(spyOn victim: EmptyClass) { 16 | observed = victim 17 | } 18 | 19 | struct __StubbingProxy_EmptyClass: Cuckoo.StubbingProxy { 20 | private let manager: Cuckoo.MockManager 21 | 22 | init(manager: Cuckoo.MockManager) { 23 | self.manager = manager 24 | } 25 | } 26 | 27 | struct __VerificationProxy_EmptyClass: Cuckoo.VerificationProxy { 28 | private let manager: Cuckoo.MockManager 29 | private let callMatcher: Cuckoo.CallMatcher 30 | private let sourceLocation: Cuckoo.SourceLocation 31 | 32 | init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { 33 | self.manager = manager 34 | self.callMatcher = callMatcher 35 | self.sourceLocation = sourceLocation 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Tests/SourceFiles/Expected/Struct.swift: -------------------------------------------------------------------------------- 1 | // MARK: - Mocks generated from file: ../../Tests/SourceFiles/Struct.swift 2 | // 3 | // Struct.swift 4 | // Cuckoo 5 | // 6 | // Created by Tadeas Kriz on 09/02/16. 7 | // Copyright © 2016 Brightify. All rights reserved. 8 | // 9 | 10 | import Cuckoo 11 | -------------------------------------------------------------------------------- /Tests/SourceFiles/Expected/TestableFrameworks.swift: -------------------------------------------------------------------------------- 1 | // MARK: - Mocks generated from file: ../../Tests/SourceFiles/EmptyClass.swift 2 | // 3 | // EmptyClass.swift 4 | // Cuckoo 5 | // 6 | // Created by Tadeas Kriz on 09/02/16. 7 | // Copyright © 2016 Brightify. All rights reserved. 8 | // 9 | 10 | import Cuckoo 11 | @testable import Cuckoo 12 | 13 | import Foundation 14 | 15 | class MockEmptyClass: EmptyClass, Cuckoo.Mock { 16 | typealias Stubbing = __StubbingProxy_EmptyClass 17 | typealias Verification = __VerificationProxy_EmptyClass 18 | let manager = Cuckoo.MockManager() 19 | 20 | private var observed: EmptyClass? 21 | 22 | required override init() { 23 | } 24 | 25 | required init(spyOn victim: EmptyClass) { 26 | observed = victim 27 | } 28 | 29 | struct __StubbingProxy_EmptyClass: Cuckoo.StubbingProxy { 30 | private let manager: Cuckoo.MockManager 31 | 32 | init(manager: Cuckoo.MockManager) { 33 | self.manager = manager 34 | } 35 | } 36 | 37 | struct __VerificationProxy_EmptyClass: Cuckoo.VerificationProxy { 38 | private let manager: Cuckoo.MockManager 39 | private let callMatcher: Cuckoo.CallMatcher 40 | private let sourceLocation: Cuckoo.SourceLocation 41 | 42 | init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { 43 | self.manager = manager 44 | self.callMatcher = callMatcher 45 | self.sourceLocation = sourceLocation 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Tests/SourceFiles/Imports.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Imports.swift 3 | // Cuckoo 4 | // 5 | // Created by Tadeas Kriz on 18/01/16. 6 | // Copyright © 2016 Brightify. All rights reserved. 7 | // 8 | 9 | import c;import d 10 | import a; import b 11 | 12 | import e 13 | import 14 | f 15 | 16 | import //aaa 17 | g 18 | import /* aaa */h 19 | 20 | // Class A 21 | class A { 22 | let text = " import x " 23 | } 24 | 25 | import i 26 | import i 27 | 28 | extension A { 29 | var text2: String { 30 | return " import y " 31 | } 32 | } -------------------------------------------------------------------------------- /Tests/SourceFiles/MultipleClasses.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MultipleClasses.swift 3 | // Cuckoo 4 | // 5 | // Created by Tadeas Kriz on 18/01/16. 6 | // Copyright © 2016 Brightify. All rights reserved. 7 | // 8 | 9 | class A { 10 | } 11 | 12 | class B { 13 | } -------------------------------------------------------------------------------- /Tests/SourceFiles/Struct.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Struct.swift 3 | // Cuckoo 4 | // 5 | // Created by Tadeas Kriz on 09/02/16. 6 | // Copyright © 2016 Brightify. All rights reserved. 7 | // 8 | 9 | struct Struct { 10 | } -------------------------------------------------------------------------------- /Tests/SourceFiles/TestedClass.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TestedClass.swift 3 | // Cuckoo 4 | // 5 | // Created by Tadeas Kriz on 09/02/16. 6 | // Copyright © 2016 Brightify. All rights reserved. 7 | // 8 | 9 | class TestedClass { 10 | let constant: Float = 0.0 11 | 12 | var readOnlyProperty: String { 13 | return "a" 14 | } 15 | 16 | lazy var readWriteProperty: Int = 0 17 | 18 | lazy var optionalProperty: Int? = 0 19 | 20 | func noReturn() { 21 | 22 | } 23 | 24 | func countCharacters(test: String) -> Int { 25 | return test.characters.count 26 | } 27 | 28 | func withThrows() throws -> Int { 29 | return 0 30 | } 31 | 32 | func withNoReturnThrows() throws { 33 | 34 | } 35 | 36 | func withClosure(closure: String -> Int) -> Int { 37 | return closure("hello") 38 | } 39 | 40 | func withNoescape(a: String, @noescape closure: String -> Void) { 41 | closure(a) 42 | } 43 | 44 | func withOptionalClosure(a: String, closure: (String -> Void)?) { 45 | closure?(a) 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Tests/SourceFiles/TestedProtocol.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TestedProtocol.swift 3 | // Cuckoo 4 | // 5 | // Created by Tadeas Kriz on 18/01/16. 6 | // Copyright © 2016 Brightify. All rights reserved. 7 | // 8 | 9 | protocol TestedProtocol { 10 | var readOnlyProperty: String { get } 11 | 12 | var readWriteProperty: Int { get set } 13 | 14 | var optionalProperty: Int? { get set } 15 | 16 | func noReturn() 17 | 18 | func countCharacters(test: String) -> Int 19 | 20 | func withThrows() throws -> Int 21 | 22 | func withNoReturnThrows() throws 23 | 24 | func withClosure(closure: String -> Int) -> Int 25 | 26 | func withNoescape(a: String, @noescape closure: String -> Void) 27 | 28 | func withOptionalClosure(a: String, closure: (String -> Void)?) 29 | } -------------------------------------------------------------------------------- /Tests/bin/runcuckoo: -------------------------------------------------------------------------------- 1 | ../../Build/cuckoo.app/Contents/MacOS/cuckoo -------------------------------------------------------------------------------- /Tests/features/generate_command.feature: -------------------------------------------------------------------------------- 1 | Feature: Generate command 2 | Scenario: in file 3 | When I run `runcuckoo generate --no-timestamp --output Actual.swift ../SourceFiles/TestedClass.swift ../SourceFiles/TestedProtocol.swift` 4 | Then the file "../SourceFiles/Expected/GeneratedMocks.swift" should be equal to file "Actual.swift" 5 | Scenario: in directory 6 | When I run `runcuckoo generate --no-timestamp --output . ../SourceFiles/ClassWithAttributes.swift ../SourceFiles/Imports.swift` 7 | Then the file "../SourceFiles/Expected/ClassWithAttributes.swift" should be equal to file "ClassWithAttributes.swift" 8 | And the file "../SourceFiles/Expected/Imports.swift" should be equal to file "Imports.swift" 9 | Scenario: output not specified 10 | When I run `runcuckoo generate --no-timestamp ../SourceFiles/TestedClass.swift ../SourceFiles/TestedProtocol.swift` 11 | Then the file "../SourceFiles/Expected/GeneratedMocks.swift" should be equal to file "GeneratedMocks.swift" 12 | Scenario: testableFrameworks 13 | When I run `runcuckoo generate --no-timestamp --testable Cuckoo --output Actual.swift ../SourceFiles/EmptyClass.swift` 14 | Then the file "../SourceFiles/Expected/TestableFrameworks.swift" should be equal to file "Actual.swift" 15 | Scenario: non existing input file 16 | When I run `runcuckoo generate non_existing_file.swift` 17 | Then the output should contain: 18 | """ 19 | Could not read contents of `non_existing_file.swift` 20 | """ 21 | Scenario: no header 22 | When I run `runcuckoo generate --no-header --output Actual.swift ../SourceFiles/EmptyClass.swift` 23 | Then the file "../SourceFiles/Expected/NoHeader.swift" should be equal to file "Actual.swift" 24 | Scenario: multiple classes in one file 25 | When I run `runcuckoo generate --no-timestamp --output Actual.swift ../SourceFiles/MultipleClasses.swift` 26 | Then the file "../SourceFiles/Expected/MultipleClasses.swift" should be equal to file "Actual.swift" 27 | Scenario: class with attributes 28 | When I run `runcuckoo generate --no-timestamp --output Actual.swift ../SourceFiles/ClassWithAttributes.swift` 29 | Then the file "../SourceFiles/Expected/ClassWithAttributes.swift" should be equal to file "Actual.swift" 30 | Scenario: imports 31 | When I run `runcuckoo generate --no-timestamp --output Actual.swift ../SourceFiles/Imports.swift` 32 | Then the file "../SourceFiles/Expected/Imports.swift" should be equal to file "Actual.swift" 33 | Scenario: struct 34 | When I run `runcuckoo generate --no-timestamp --output Actual.swift ../SourceFiles/Struct.swift` 35 | Then the file "../SourceFiles/Expected/Struct.swift" should be equal to file "Actual.swift" 36 | Scenario: in file with file-prefix 37 | When I run `runcuckoo generate --no-timestamp --file-prefix Mock --output Actual.swift ../SourceFiles/TestedClass.swift ../SourceFiles/TestedProtocol.swift` 38 | Then the file "../SourceFiles/Expected/GeneratedMocks.swift" should be equal to file "Actual.swift" 39 | Scenario: in directory with file-prefix 40 | When I run `runcuckoo generate --no-timestamp --file-prefix Mock --output . ../SourceFiles/ClassWithAttributes.swift ../SourceFiles/Imports.swift` 41 | Then the file "../SourceFiles/Expected/ClassWithAttributes.swift" should be equal to file "MockClassWithAttributes.swift" 42 | And the file "../SourceFiles/Expected/Imports.swift" should be equal to file "MockImports.swift" -------------------------------------------------------------------------------- /Tests/features/support/aruba.rb: -------------------------------------------------------------------------------- 1 | require 'aruba/cucumber' 2 | 3 | Aruba.configure do |config| 4 | config.exit_timeout = 1000 5 | config.root_directory = '../Build' 6 | config.working_directory = 'tmp' 7 | end -------------------------------------------------------------------------------- /Tests/features/support/env.rb: -------------------------------------------------------------------------------- 1 | require 'aruba/cucumber' 2 | %x'rm -rf ../Build/log' 3 | %x'mkdir ../Build/log' 4 | 5 | After do |scenario| 6 | %x'cp -R ../Build/tmp ../Build/log/"#{scenario.name}"' 7 | end -------------------------------------------------------------------------------- /makefile: -------------------------------------------------------------------------------- 1 | TEMPORARY_FOLDER?=/tmp/CuckooGenerator.dst 2 | PREFIX?=/usr/local 3 | BUILD_TOOL?=xcodebuild 4 | 5 | XCODEFLAGS=-project 'CuckooGenerator.xcodeproj' -scheme 'CuckooGenerator' DSTROOT=$(TEMPORARY_FOLDER) 6 | 7 | BUILT_BUNDLE=$(TEMPORARY_FOLDER)/Applications/cuckoo.app 8 | CUCKOOGENERATOR_FRAMEWORK_BUNDLE=$(BUILT_BUNDLE)/Contents/Frameworks/CuckooGeneratorFramework.framework 9 | CUCKOOGENERATOR_EXECUTABLE=$(BUILT_BUNDLE)/Contents/MacOS/cuckoo 10 | 11 | FRAMEWORKS_FOLDER=$(PREFIX)/Frameworks 12 | BINARIES_FOLDER=$(PREFIX)/bin 13 | 14 | OUTPUT_PACKAGE=CuckooGenerator.pkg 15 | VERSION_STRING=$(shell agvtool what-marketing-version -terse1) 16 | COMPONENTS_PLIST=Source/Supporting Files/Components.plist 17 | 18 | .PHONY: all bootstrap clean install package test uninstall 19 | 20 | all: 21 | $(BUILD_TOOL) $(XCODEFLAGS) build 22 | 23 | test: clean bootstrap 24 | $(BUILD_TOOL) $(XCODEFLAGS) test 25 | 26 | clean: 27 | rm -f "$(OUTPUT_PACKAGE)" 28 | rm -rf "$(TEMPORARY_FOLDER)" 29 | $(BUILD_TOOL) $(XCODEFLAGS) clean 30 | 31 | install: package 32 | sudo installer -pkg CuckooGenerator.pkg -target / 33 | 34 | uninstall: 35 | rm -rf "$(FRAMEWORKS_FOLDER)/CuckooGeneratorFramework.framework" 36 | rm -f "$(BINARIES_FOLDER)/cuckoo" 37 | 38 | installables: clean bootstrap 39 | $(BUILD_TOOL) $(XCODEFLAGS) install 40 | 41 | mkdir -p "$(TEMPORARY_FOLDER)$(FRAMEWORKS_FOLDER)" "$(TEMPORARY_FOLDER)$(BINARIES_FOLDER)" 42 | mv -f "$(CUCKOOGENERATOR_FRAMEWORK_BUNDLE)" "$(TEMPORARY_FOLDER)$(FRAMEWORKS_FOLDER)/CuckooGeneratorFramework.framework" 43 | mv -f "$(CUCKOOGENERATOR_EXECUTABLE)" "$(TEMPORARY_FOLDER)$(BINARIES_FOLDER)/cuckoo" 44 | rm -rf "$(BUILT_BUNDLE)" 45 | 46 | prefix_install: installables 47 | mkdir -p "$(FRAMEWORKS_FOLDER)" "$(BINARIES_FOLDER)" 48 | cp -Rf "$(TEMPORARY_FOLDER)$(FRAMEWORKS_FOLDER)/CuckooGeneratorFramework.framework" "$(FRAMEWORKS_FOLDER)" 49 | cp -f "$(TEMPORARY_FOLDER)$(BINARIES_FOLDER)/cuckoo" "$(BINARIES_FOLDER)/" 50 | 51 | package: installables 52 | pkgbuild \ 53 | --component-plist "$(COMPONENTS_PLIST)" \ 54 | --identifier "org.brightify.CuckooGenerator" \ 55 | --install-location "/" \ 56 | --root "$(TEMPORARY_FOLDER)" \ 57 | --version "$(VERSION_STRING)" \ 58 | "$(OUTPUT_PACKAGE)" 59 | 60 | #archive: 61 | # carthage build --no-skip-current --platform mac 62 | # carthage archive CuckooGeneratorFramework 63 | # 64 | #release: package archive 65 | -------------------------------------------------------------------------------- /run_tests.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | rm -rf Build 3 | mkdir Build 4 | xcodebuild -project 'CuckooGenerator.xcodeproj' -scheme 'CuckooGenerator' -configuration 'Release' CONFIGURATION_BUILD_DIR=$(pwd)/Build clean build 5 | ln -s ../Tests/SourceFiles Build/SourceFiles 6 | cd Tests 7 | cucumber --------------------------------------------------------------------------------