Skip to content

Commit

Permalink
Removes unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Henry committed Oct 21, 2019
1 parent c8b7002 commit f57cd2d
Show file tree
Hide file tree
Showing 11 changed files with 7 additions and 64 deletions.
11 changes: 0 additions & 11 deletions EndToEndTests/EndToEndTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ import XCTest

class EndToEndTests: MockGeneratorBaseTestCase {

override func setUp() {
super.setUp()
Preferences().platform = "macosx"
}

func test_generatesSimpleMock() {
assertMockGeneratesExpected("SimpleProtocolMock")
}
Expand Down Expand Up @@ -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
Expand Down
33 changes: 0 additions & 33 deletions MockGenerator.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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, ); }; };
Expand All @@ -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, ); }; };
Expand All @@ -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 */; };
Expand Down Expand Up @@ -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 */;
Expand Down Expand Up @@ -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 */,
Expand All @@ -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 */,
);
Expand Down Expand Up @@ -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 */,
Expand All @@ -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";
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 */,
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion MockGeneratorTests/MemberTransformingVisitorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
3 changes: 1 addition & 2 deletions MockGeneratorTests/MockGeneratorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion MockGeneratorTests/VariableTypeResolverTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 0 additions & 6 deletions MockGeneratorXPC/MockGeneratorXPC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,4 @@ import MockGenerator
}
reply(transformed, error)
}

#if DEBUG
func crash() {
fatalError()
}
#endif
}
6 changes: 0 additions & 6 deletions MockGeneratorXPC/MockGeneratorXPCProtocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion config/Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion config/Profile.xcconfig
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion config/Release.xcconfig
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit f57cd2d

Please sign in to comment.