diff --git a/EndToEndTests/EndToEndTests.swift b/EndToEndTests/EndToEndTests.swift index 9c7a3bc..b27300b 100644 --- a/EndToEndTests/EndToEndTests.swift +++ b/EndToEndTests/EndToEndTests.swift @@ -3,11 +3,6 @@ import XCTest class EndToEndTests: MockGeneratorBaseTestCase { - override func setUp() { - super.setUp() - Preferences().platform = "macosx" - } - func test_generatesSimpleMock() { assertMockGeneratesExpected("SimpleProtocolMock") } @@ -164,12 +159,6 @@ class EndToEndTests: MockGeneratorBaseTestCase { assertMockGeneratesExpected("AugmentedClassSubscriptMock") } - func test_returnsErrorWhenPlatformIsNil() { - let preferences = Preferences() - preferences.platform = nil - assertMockGeneratesError(fileName: "SimpleProtocolMock", "No platform has been selected. Choose one in the companion app.") - } - func test_returnsErrorWhenProjectURLDoesNotExist() { let preferences = Preferences() preferences.automaticallyDetectProjectPath = false diff --git a/MockGenerator.xcodeproj/project.pbxproj b/MockGenerator.xcodeproj/project.pbxproj index 38e98e7..209fab2 100644 --- a/MockGenerator.xcodeproj/project.pbxproj +++ b/MockGenerator.xcodeproj/project.pbxproj @@ -42,17 +42,10 @@ 142B0213216FA39E005DE573 /* libIndexer.dylib in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 1425EB8721528F8F00009D60 /* libIndexer.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 142B0214216FA39E005DE573 /* libParser.dylib in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 196F975020EEFA12009A5FD6 /* libParser.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 142B0215216FA39E005DE573 /* libResolver.dylib in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 196F975420EEFA12009A5FD6 /* libResolver.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 142B0216216FA39E005DE573 /* libSourceKittenRequests.dylib in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 196F975820EEFA12009A5FD6 /* libSourceKittenRequests.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 142B0217216FA39E005DE573 /* libSwiftLexer.dylib in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 196F975A20EEFA12009A5FD6 /* libSwiftLexer.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 142B0218216FA3A7005DE573 /* MockGenerator.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 14276C611F4F312E00EA7753 /* MockGenerator.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 142B022A21709979005DE573 /* SourceKittenFramework.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 142B02252170994B005DE573 /* SourceKittenFramework.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 142B022B21709979005DE573 /* SWXMLHash.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 142B02222170994A005DE573 /* SWXMLHash.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 142B022C21709979005DE573 /* Yams.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 142B02242170994B005DE573 /* Yams.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 142B023021709A97005DE573 /* UseCases.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 142B022F21709A85005DE573 /* UseCases.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 142B023121709AFF005DE573 /* UseCases.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 142B022F21709A85005DE573 /* UseCases.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 142B023621709AFF005DE573 /* SourceKittenFramework.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 142B02252170994B005DE573 /* SourceKittenFramework.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 142B023721709B00005DE573 /* SWXMLHash.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 142B02222170994A005DE573 /* SWXMLHash.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 142B023821709B00005DE573 /* Yams.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 142B02242170994B005DE573 /* Yams.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 142B023A21709BFB005DE573 /* libGRMustache7-MacOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 142B023921709BC5005DE573 /* libGRMustache7-MacOS.a */; }; 14354103232E4FF80019615B /* Lexer in Frameworks */ = {isa = PBXBuildFile; productRef = 14354102232E4FF80019615B /* Lexer */; }; 14354104232E4FF80019615B /* Lexer in Embed Frameworks */ = {isa = PBXBuildFile; productRef = 14354102232E4FF80019615B /* Lexer */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; @@ -73,7 +66,6 @@ 1497FE7E215E147200CD670B /* libIndexer.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1425EB8721528F8F00009D60 /* libIndexer.dylib */; }; 1497FE7F215E147200CD670B /* libParser.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 196F975020EEFA12009A5FD6 /* libParser.dylib */; }; 1497FE80215E147200CD670B /* libResolver.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 196F975420EEFA12009A5FD6 /* libResolver.dylib */; }; - 1497FE81215E147200CD670B /* libSourceKittenRequests.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 196F975820EEFA12009A5FD6 /* libSourceKittenRequests.dylib */; }; 1497FE82215E147200CD670B /* libSwiftLexer.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 196F975A20EEFA12009A5FD6 /* libSwiftLexer.dylib */; }; 1497FEC8215E200100CD670B /* libAlgorithms.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 196F974C20EEFA12009A5FD6 /* libAlgorithms.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 1497FEC9215E200100CD670B /* libAST.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 196F974020EEFA12009A5FD6 /* libAST.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; @@ -84,7 +76,6 @@ 1497FECE215E200100CD670B /* libIndexer.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 1425EB8721528F8F00009D60 /* libIndexer.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 1497FECF215E200100CD670B /* libParser.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 196F975020EEFA12009A5FD6 /* libParser.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 1497FED0215E200100CD670B /* libResolver.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 196F975420EEFA12009A5FD6 /* libResolver.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 1497FED1215E200100CD670B /* libSourceKittenRequests.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 196F975820EEFA12009A5FD6 /* libSourceKittenRequests.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 1497FED2215E200100CD670B /* libSwiftLexer.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 196F975A20EEFA12009A5FD6 /* libSwiftLexer.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 149CF7B3217B115B005892B4 /* partial.mustache in Resources */ = {isa = PBXBuildFile; fileRef = 149CF792217B115A005892B4 /* partial.mustache */; }; 149CF7B5217B1301005892B4 /* PartialSpyCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 149CF7B4217B1301005892B4 /* PartialSpyCommand.swift */; }; @@ -516,13 +507,6 @@ remoteGlobalIDString = 19821CE020EE2C260084C6C1; remoteInfo = ResolverTests; }; - 196F975720EEFA12009A5FD6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 196F972C20EEFA12009A5FD6 /* SwiftToolkit.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 19821D1E20EE2C5D0084C6C1; - remoteInfo = SourceKittenRequests; - }; 196F975920EEFA12009A5FD6 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 196F972C20EEFA12009A5FD6 /* SwiftToolkit.xcodeproj */; @@ -634,9 +618,6 @@ files = ( 14D345DF234DC20700054682 /* libCommandLine.dylib in Embed Frameworks */, 142B023021709A97005DE573 /* UseCases.framework in Embed Frameworks */, - 142B022A21709979005DE573 /* SourceKittenFramework.framework in Embed Frameworks */, - 142B022B21709979005DE573 /* SWXMLHash.framework in Embed Frameworks */, - 142B022C21709979005DE573 /* Yams.framework in Embed Frameworks */, 1497FEC8215E200100CD670B /* libAlgorithms.dylib in Embed Frameworks */, 14354104232E4FF80019615B /* Lexer in Embed Frameworks */, 1497FEC9215E200100CD670B /* libAST.dylib in Embed Frameworks */, @@ -647,7 +628,6 @@ 1497FECE215E200100CD670B /* libIndexer.dylib in Embed Frameworks */, 1497FECF215E200100CD670B /* libParser.dylib in Embed Frameworks */, 1497FED0215E200100CD670B /* libResolver.dylib in Embed Frameworks */, - 1497FED1215E200100CD670B /* libSourceKittenRequests.dylib in Embed Frameworks */, 1497FED2215E200100CD670B /* libSwiftLexer.dylib in Embed Frameworks */, 14887ABC20FB859B00D50A73 /* MockGenerator.framework in Embed Frameworks */, ); @@ -703,9 +683,6 @@ files = ( 1485244A234E5B19007F3D26 /* libCommandLine.dylib in Copy Frameworks */, 142B023121709AFF005DE573 /* UseCases.framework in Copy Frameworks */, - 142B023621709AFF005DE573 /* SourceKittenFramework.framework in Copy Frameworks */, - 142B023721709B00005DE573 /* SWXMLHash.framework in Copy Frameworks */, - 142B023821709B00005DE573 /* Yams.framework in Copy Frameworks */, 142B0218216FA3A7005DE573 /* MockGenerator.framework in Copy Frameworks */, 1435412B232E50610019615B /* Lexer in Copy Frameworks */, 142B020D216FA39E005DE573 /* libAlgorithms.dylib in Copy Frameworks */, @@ -717,7 +694,6 @@ 142B0213216FA39E005DE573 /* libIndexer.dylib in Copy Frameworks */, 142B0214216FA39E005DE573 /* libParser.dylib in Copy Frameworks */, 142B0215216FA39E005DE573 /* libResolver.dylib in Copy Frameworks */, - 142B0216216FA39E005DE573 /* libSourceKittenRequests.dylib in Copy Frameworks */, 142B0217216FA39E005DE573 /* libSwiftLexer.dylib in Copy Frameworks */, ); name = "Copy Frameworks"; @@ -885,7 +861,6 @@ 1497FE7E215E147200CD670B /* libIndexer.dylib in Frameworks */, 1497FE7F215E147200CD670B /* libParser.dylib in Frameworks */, 1497FE80215E147200CD670B /* libResolver.dylib in Frameworks */, - 1497FE81215E147200CD670B /* libSourceKittenRequests.dylib in Frameworks */, 1497FE82215E147200CD670B /* libSwiftLexer.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1227,7 +1202,6 @@ 196F975420EEFA12009A5FD6 /* libResolver.dylib */, 196F975620EEFA12009A5FD6 /* ResolverTests.xctest */, 1425EB8D21528F8F00009D60 /* ResolverPerfTests.xctest */, - 196F975820EEFA12009A5FD6 /* libSourceKittenRequests.dylib */, 196F975A20EEFA12009A5FD6 /* libSwiftLexer.dylib */, 196F975C20EEFA12009A5FD6 /* SwiftLexerTests.xctest */, 196F975E20EEFA12009A5FD6 /* libTestHelper.dylib */, @@ -1887,13 +1861,6 @@ remoteRef = 196F975520EEFA12009A5FD6 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 196F975820EEFA12009A5FD6 /* libSourceKittenRequests.dylib */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libSourceKittenRequests.dylib; - remoteRef = 196F975720EEFA12009A5FD6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; 196F975A20EEFA12009A5FD6 /* libSwiftLexer.dylib */ = { isa = PBXReferenceProxy; fileType = archive.ar; diff --git a/MockGeneratorTests/MemberTransformingVisitorTests.swift b/MockGeneratorTests/MemberTransformingVisitorTests.swift index 11578c5..c1d998a 100644 --- a/MockGeneratorTests/MemberTransformingVisitorTests.swift +++ b/MockGeneratorTests/MemberTransformingVisitorTests.swift @@ -13,7 +13,7 @@ class MemberTransformingVisitorTests: XCTestCase { override func setUp() { super.setUp() - resolver = ResolverFactory.createResolver(filePaths: [], platform: "macosx") + resolver = ResolverFactory.createResolver(filePaths: []) visitor = MemberTransformingVisitor(resolver: resolver) } diff --git a/MockGeneratorTests/MockGeneratorTests.swift b/MockGeneratorTests/MockGeneratorTests.swift index bbd9636..f5f04ec 100644 --- a/MockGeneratorTests/MockGeneratorTests.swift +++ b/MockGeneratorTests/MockGeneratorTests.swift @@ -227,7 +227,7 @@ class MockGeneratorTests: XCTestCase { } while contentsLineColumn.lineColumn != nil XCTAssertGreaterThan(caretLineColumns.count, 0) caretLineColumns.forEach { lineColumn in - let (lines, error) = Generator(fromFileContents: contentsLineColumn.contents, projectURL: URL(fileURLWithPath: testProject), platform: "macosx", line: lineColumn.line, column: lineColumn.column, templateName: "spy", useTabsForIndentation: false, indentationWidth: 4).generateMock() + let (lines, error) = Generator(fromFileContents: contentsLineColumn.contents, projectURL: URL(fileURLWithPath: testProject), line: lineColumn.line, column: lineColumn.column, templateName: "spy", useTabsForIndentation: false, indentationWidth: 4).generateMock() XCTAssertNotNil(error, "Should not be generating a mock from caret at line: \(lineColumn.line) column: \(lineColumn.column)") XCTAssertNil(lines) } @@ -276,7 +276,6 @@ class MockGeneratorTests: XCTestCase { let result = CaretTestHelper.findCaretLineColumn(mock) let (instructions, error) = Generator(fromFileContents: result.contents, projectURL: URL(fileURLWithPath: testProject), - platform: "macosx", line: result.lineColumn!.line, column: result.lineColumn!.column, templateName: templateName, diff --git a/MockGeneratorTests/TypeDeclarationTransformingVisitorTests.swift b/MockGeneratorTests/TypeDeclarationTransformingVisitorTests.swift index 528609c..3c22932 100644 --- a/MockGeneratorTests/TypeDeclarationTransformingVisitorTests.swift +++ b/MockGeneratorTests/TypeDeclarationTransformingVisitorTests.swift @@ -12,7 +12,7 @@ class TypeDeclarationTransformingVisitorTests: XCTestCase { override func setUp() { super.setUp() - resolver = ResolverFactory.createResolver(filePaths: [], platform: "macosx") + resolver = ResolverFactory.createResolver(filePaths: []) } override func tearDown() { diff --git a/MockGeneratorTests/VariableTypeResolverTests.swift b/MockGeneratorTests/VariableTypeResolverTests.swift index 037de87..59954a7 100644 --- a/MockGeneratorTests/VariableTypeResolverTests.swift +++ b/MockGeneratorTests/VariableTypeResolverTests.swift @@ -143,7 +143,7 @@ class VariableTypeResolverTests: XCTestCase { struct StructType {} enum EnumType {} """ - return VariableTypeResolver.resolve(try parse(fullText), resolver: ResolverFactory.createResolver(filePaths: [], platform: "macosx")) + return VariableTypeResolver.resolve(try parse(fullText), resolver: ResolverFactory.createResolver(filePaths: [])) } private func parse(_ text: String) throws -> Element { diff --git a/MockGeneratorXPC/MockGeneratorXPC.swift b/MockGeneratorXPC/MockGeneratorXPC.swift index 721379f..8f324ab 100644 --- a/MockGeneratorXPC/MockGeneratorXPC.swift +++ b/MockGeneratorXPC/MockGeneratorXPC.swift @@ -20,10 +20,4 @@ import MockGenerator } reply(transformed, error) } - - #if DEBUG - func crash() { - fatalError() - } - #endif } diff --git a/MockGeneratorXPC/MockGeneratorXPCProtocol.h b/MockGeneratorXPC/MockGeneratorXPCProtocol.h index a713454..b590778 100644 --- a/MockGeneratorXPC/MockGeneratorXPCProtocol.h +++ b/MockGeneratorXPC/MockGeneratorXPCProtocol.h @@ -9,12 +9,6 @@ NS_ASSUME_NONNULL_BEGIN - (void)generateMockFrom:(XPCMockGeneratorModel *)model withReply:(void (^)(XPCBufferInstructions *_Nullable, NSError *_Nullable))reply; -#ifdef DEBUG - -- (void)crash; - -#endif - NS_ASSUME_NONNULL_END @end diff --git a/config/Debug.xcconfig b/config/Debug.xcconfig index 0f31992..117b6f9 100644 --- a/config/Debug.xcconfig +++ b/config/Debug.xcconfig @@ -1,7 +1,7 @@ #include "../SwiftToolkit/config/Debug.xcconfig" #include "Shared.xcconfig" -FRAMEWORK_SEARCH_PATHS = $DEVELOPER_FRAMEWORKS_DIR $PROJECT_DIR/SwiftToolkit/Frameworks/Debug $PROJECT_DIR/lib/Debug +FRAMEWORK_SEARCH_PATHS = $DEVELOPER_FRAMEWORKS_DIR $PROJECT_DIR/lib/Debug HEADER_SEARCH_PATHS = $PROJECT_DIR/lib/Debug/include/GRMustache LIBRARY_SEARCH_PATHS = $PROJECT_DIR/lib/Debug OTHER_SWIFT_FLAGS = -Xcc -fmodule-map-file=$PROJECT_DIR/lib/Debug/include/GRMustache/module.modulemap diff --git a/config/Profile.xcconfig b/config/Profile.xcconfig index 131ec41..ac500c5 100644 --- a/config/Profile.xcconfig +++ b/config/Profile.xcconfig @@ -1,7 +1,7 @@ #include "../SwiftToolkit/config/Profile.xcconfig" #include "Shared.xcconfig" -FRAMEWORK_SEARCH_PATHS = $DEVELOPER_FRAMEWORKS_DIR $PROJECT_DIR/SwiftToolkit/Frameworks/Release $PROJECT_DIR/lib/Release +FRAMEWORK_SEARCH_PATHS = $DEVELOPER_FRAMEWORKS_DIR $PROJECT_DIR/lib/Release HEADER_SEARCH_PATHS = $PROJECT_DIR/lib/Release/include/GRMustache LIBRARY_SEARCH_PATHS = $PROJECT_DIR/lib/Release OTHER_SWIFT_FLAGS = -Xcc -fmodule-map-file=$PROJECT_DIR/lib/Release/include/GRMustache/module.modulemap diff --git a/config/Release.xcconfig b/config/Release.xcconfig index 2ffc18c..eca1352 100644 --- a/config/Release.xcconfig +++ b/config/Release.xcconfig @@ -1,7 +1,7 @@ #include "../SwiftToolkit/config/Release.xcconfig" #include "Shared.xcconfig" -FRAMEWORK_SEARCH_PATHS = $DEVELOPER_FRAMEWORKS_DIR $PROJECT_DIR/SwiftToolkit/Frameworks/Release $PROJECT_DIR/lib/Release +FRAMEWORK_SEARCH_PATHS = $DEVELOPER_FRAMEWORKS_DIR $PROJECT_DIR/lib/Release HEADER_SEARCH_PATHS = $PROJECT_DIR/lib/Release/include/GRMustache LIBRARY_SEARCH_PATHS = $PROJECT_DIR/lib/Release OTHER_SWIFT_FLAGS = -Xcc -fmodule-map-file=$PROJECT_DIR/lib/Release/include/GRMustache/module.modulemap