From 66ddd20382c00df88590476f16612b2db40b4e18 Mon Sep 17 00:00:00 2001 From: Dave Gallagher Date: Thu, 16 Aug 2018 10:06:18 -0700 Subject: [PATCH 1/9] Fixed a typo. --- QuizTrain/Network/API.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/QuizTrain/Network/API.swift b/QuizTrain/Network/API.swift index 4d23ca3..8cceb67 100644 --- a/QuizTrain/Network/API.swift +++ b/QuizTrain/Network/API.swift @@ -91,7 +91,7 @@ final public class API { return request } - // MARL: - Errors + // MARK: - Errors public enum RequestError: Error { case error(request: URLRequest, error: Error) From ebee9961f141c2cc6cc6c20c3314f4b97ab523b4 Mon Sep 17 00:00:00 2001 From: Dave Gallagher Date: Thu, 16 Aug 2018 10:08:27 -0700 Subject: [PATCH 2/9] Fixed swiftlint 0.27.0 warnings. --- QuizTrainTests/Network/ObjectAPITests.swift | 114 ++++++++++---------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/QuizTrainTests/Network/ObjectAPITests.swift b/QuizTrainTests/Network/ObjectAPITests.swift index 0625e2a..e946929 100644 --- a/QuizTrainTests/Network/ObjectAPITests.swift +++ b/QuizTrainTests/Network/ObjectAPITests.swift @@ -2326,7 +2326,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Add Case") - var `case`: Case? = nil + var `case`: Case? objectAPI.addCase(newCase, to: section) { (outcome) in `case` = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -2371,7 +2371,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Get Case") - var `case`: Case? = nil + var `case`: Case? objectAPI.getCase(caseId) { (outcome) in `case` = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -2392,7 +2392,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Get Cases") - var cases: [Case]? = nil + var cases: [Case]? objectAPI.getCases(in: project, in: suite, in: section, filteredBy: filters) { (outcome) in cases = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -2416,7 +2416,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Update Case") - var updatedCase: Case? = nil + var updatedCase: Case? objectAPI.updateCase(`case`) { (outcome) in updatedCase = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -2449,7 +2449,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Get Case Fields") - var caseFields: [CaseField]? = nil + var caseFields: [CaseField]? objectAPI.getCaseFields { (outcome) in caseFields = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -2468,7 +2468,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Get Case Types") - var caseTypes: [CaseType]? = nil + var caseTypes: [CaseType]? objectAPI.getCaseTypes { (outcome) in caseTypes = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -2487,7 +2487,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Add Configuration") - var configuration: Configuration? = nil + var configuration: Configuration? objectAPI.addConfiguration(newConfiguration, to: configurationGroup) { (outcome) in configuration = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -2521,7 +2521,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Update Configuration") - var updatedConfiguration: Configuration? = nil + var updatedConfiguration: Configuration? objectAPI.updateConfiguration(configuration) { (outcome) in updatedConfiguration = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -2547,7 +2547,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Add Configuration Group") - var configurationGroup: ConfigurationGroup? = nil + var configurationGroup: ConfigurationGroup? objectAPI.addConfigurationGroup(newConfigurationGroup, to: project) { (outcome) in configurationGroup = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -2581,7 +2581,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Get Configuration Groups") - var configurationGroups: [ConfigurationGroup]? = nil + var configurationGroups: [ConfigurationGroup]? objectAPI.getConfigurationGroups { (outcome) in configurationGroups = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -2598,7 +2598,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Get Configuration Groups In Project") - var configurationGroups: [ConfigurationGroup]? = nil + var configurationGroups: [ConfigurationGroup]? objectAPI.getConfigurationGroups(in: project) { (outcome) in configurationGroups = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -2621,7 +2621,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Update Configuration Group") - var updatedConfigurationGroup: ConfigurationGroup? = nil + var updatedConfigurationGroup: ConfigurationGroup? objectAPI.updateConfigurationGroup(configurationGroup) { (outcome) in updatedConfigurationGroup = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -2647,7 +2647,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Add Milestone") - var milestone: Milestone? = nil + var milestone: Milestone? objectAPI.addMilestone(newMilestone, to: project) { (outcome) in milestone = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -2688,7 +2688,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Get Milestone") - var milestone: Milestone? = nil + var milestone: Milestone? objectAPI.getMilestone(milestoneId) { (outcome) in milestone = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -2709,7 +2709,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Get Milestones") - var milestones: [Milestone]? = nil + var milestones: [Milestone]? objectAPI.getMilestones(in: project, filteredBy: filters) { (outcome) in milestones = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -2732,7 +2732,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Update Milestone") - var updatedMilestone: Milestone? = nil + var updatedMilestone: Milestone? objectAPI.updateMilestone(milestone) { (outcome) in updatedMilestone = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -2764,7 +2764,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Add Plan") - var plan: Plan? = nil + var plan: Plan? objectAPI.addPlan(newPlan, to: project) { (outcome) in plan = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -2792,7 +2792,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Close Plan") - var closedPlan: Plan? = nil + var closedPlan: Plan? objectAPI.closePlan(plan) { (outcome) in closedPlan = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -2826,7 +2826,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Get Plan") - var plan: Plan? = nil + var plan: Plan? objectAPI.getPlan(planId) { (outcome) in plan = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -2847,7 +2847,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Get Plans") - var plans: [Plan]? = nil + var plans: [Plan]? objectAPI.getPlans(in: project, filteredBy: filters) { (outcome) in plans = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -2870,7 +2870,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Update Plan") - var updatedPlan: Plan? = nil + var updatedPlan: Plan? objectAPI.updatePlan(plan) { (outcome) in updatedPlan = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -2898,7 +2898,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Add Plan Entry") - var planEntry: Plan.Entry? = nil + var planEntry: Plan.Entry? objectAPI.addPlanEntry(newPlanEntry, to: plan) { (outcome) in planEntry = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -2944,7 +2944,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Update Plan Entry") - var updatedPlanEntry: Plan.Entry? = nil + var updatedPlanEntry: Plan.Entry? objectAPI.updatePlanEntry(planEntry, in: plan, with: planEntryRuns) { (outcome) in updatedPlanEntry = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -2972,7 +2972,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Get Priorities") - var priorities: [Priority]? = nil + var priorities: [Priority]? objectAPI.getPriorities { (outcome) in priorities = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -2991,7 +2991,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Add Project") - var project: Project? = nil + var project: Project? objectAPI.addProject(newProject) { (outcome) in project = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3030,7 +3030,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Get Project") - var project: Project? = nil + var project: Project? objectAPI.getProject(projectId) { (outcome) in project = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3051,7 +3051,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Get Projects") - var projects: [Project]? = nil + var projects: [Project]? objectAPI.getProjects { (outcome) in projects = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3068,7 +3068,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Update Projects") - var updatedProject: Project? = nil + var updatedProject: Project? objectAPI.updateProject(project) { (outcome) in updatedProject = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3098,7 +3098,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Add Result") - var result: Result? = nil + var result: Result? objectAPI.addResult(newResult, to: test) { (outcome) in result = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3130,7 +3130,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Add Result For Case") - var result: Result? = nil + var result: Result? objectAPI.addResultForCase(newResult, to: run, to: `case`) { (outcome) in result = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3161,7 +3161,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Add Results") - var results: [Result]? = nil + var results: [Result]? objectAPI.addResults(newTestResults, to: run) { (outcome) in results = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3182,7 +3182,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Add Results For Cases") - var results: [Result]? = nil + var results: [Result]? objectAPI.addResultsForCases(newCaseResults, to: run) { (outcome) in results = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3203,7 +3203,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Get Results For Test") - var results: [Result]? = nil + var results: [Result]? objectAPI.getResultsForTest(test, filteredBy: filters) { (outcome) in results = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3220,7 +3220,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Get Results For Case") - var results: [Result]? = nil + var results: [Result]? objectAPI.getResultsForCase(`case`, in: run, filteredBy: filters) { (outcome) in results = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3237,7 +3237,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Get Results For Run") - var results: [Result]? = nil + var results: [Result]? objectAPI.getResultsForRun(run, filteredBy: filters) { (outcome) in results = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3256,7 +3256,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Get ResultFields") - var resultFields: [ResultField]? = nil + var resultFields: [ResultField]? objectAPI.getResultFields { (outcome) in resultFields = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3275,7 +3275,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Add Run") - var run: Run? = nil + var run: Run? objectAPI.addRun(newRun, to: project) { (outcome) in run = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3305,7 +3305,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Close Run") - var closedRun: Run? = nil + var closedRun: Run? objectAPI.closeRun(run) { (outcome) in closedRun = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3340,7 +3340,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Get Run") - var run: Run? = nil + var run: Run? objectAPI.getRun(runId) { (outcome) in run = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3361,7 +3361,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Get Runs") - var runs: [Run]? = nil + var runs: [Run]? objectAPI.getRuns(in: project, filteredBy: filters) { (outcome) in runs = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3384,7 +3384,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Update Run") - var updatedRun: Run? = nil + var updatedRun: Run? objectAPI.updateRun(run) { (outcome) in updatedRun = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3413,7 +3413,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Add Section") - var section: Section? = nil + var section: Section? objectAPI.addSection(newSection, to: project) { (outcome) in section = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3458,7 +3458,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Get Section") - var section: Section? = nil + var section: Section? objectAPI.getSection(sectionId) { (outcome) in section = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3479,7 +3479,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Get Sections") - var sections: [Section]? = nil + var sections: [Section]? objectAPI.getSections(in: project, in: suite) { (outcome) in sections = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3502,7 +3502,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Update Section") - var updatedSection: Section? = nil + var updatedSection: Section? objectAPI.updateSection(section) { (outcome) in updatedSection = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3529,7 +3529,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Get Statuses") - var statuses: [Status]? = nil + var statuses: [Status]? objectAPI.getStatuses { (outcome) in statuses = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3548,7 +3548,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Add Suite") - var suite: Suite? = nil + var suite: Suite? objectAPI.addSuite(newSuite, to: project) { (outcome) in suite = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3586,7 +3586,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Get Suite") - var suite: Suite? = nil + var suite: Suite? objectAPI.getSuite(suiteId) { (outcome) in suite = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3607,7 +3607,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Get Suites") - var suites: [Suite]? = nil + var suites: [Suite]? objectAPI.getSuites(in: project) { (outcome) in suites = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3630,7 +3630,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Update Suite") - var updatedSuite: Suite? = nil + var updatedSuite: Suite? objectAPI.updateSuite(suite) { (outcome) in updatedSuite = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3657,7 +3657,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Get Templates") - var templates: [Template]? = nil + var templates: [Template]? objectAPI.getTemplates { (outcome) in templates = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3674,7 +3674,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Get Templates In Project") - var templates: [Template]? = nil + var templates: [Template]? objectAPI.getTemplates(in: project) { (outcome) in templates = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3693,7 +3693,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Get Test") - var test: Test? = nil + var test: Test? objectAPI.getTest(testId) { (outcome) in test = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3714,7 +3714,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Get Tests") - var tests: [Test]? = nil + var tests: [Test]? objectAPI.getTests(in: run, filteredBy: filters) { (outcome) in tests = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3739,7 +3739,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Get User") - var user: User? = nil + var user: User? objectAPI.getUser(userId) { (outcome) in user = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3760,7 +3760,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Get User by Email") - var user: User? = nil + var user: User? objectAPI.getUserByEmail(email) { (outcome) in user = self.assertOutcomeSucceeded(outcome) expectation.fulfill() @@ -3781,7 +3781,7 @@ extension ObjectAPITests { let expectation = XCTestExpectation(description: "Get Users") - var users: [User]? = nil + var users: [User]? objectAPI.getUsers { (outcome) in users = self.assertOutcomeSucceeded(outcome) expectation.fulfill() From 5ec5a96c9e06f65965fb3738e1d176e282c2d870 Mon Sep 17 00:00:00 2001 From: Dave Gallagher Date: Thu, 16 Aug 2018 10:10:30 -0700 Subject: [PATCH 3/9] Set the project and all targets to use Swift 4.2. --- QuizTrain.xcodeproj/project.pbxproj | 30 +++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/QuizTrain.xcodeproj/project.pbxproj b/QuizTrain.xcodeproj/project.pbxproj index 98f3b8f..480f7e5 100644 --- a/QuizTrain.xcodeproj/project.pbxproj +++ b/QuizTrain.xcodeproj/project.pbxproj @@ -2421,6 +2421,7 @@ SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.2; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -2474,6 +2475,7 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 4.2; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -2498,7 +2500,7 @@ PRODUCT_NAME = QuizTrain; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -2520,7 +2522,7 @@ PRODUCT_BUNDLE_IDENTIFIER = venmo.QuizTrain; PRODUCT_NAME = QuizTrain; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -2534,7 +2536,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = venmo.QuizTrainTests; PRODUCT_NAME = QuizTrainTests; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -2548,7 +2550,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = venmo.QuizTrainTests; PRODUCT_NAME = QuizTrainTests; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -2570,7 +2572,7 @@ PRODUCT_NAME = QuizTrain; SDKROOT = watchos; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 4; WATCHOS_DEPLOYMENT_TARGET = 3.0; }; @@ -2593,7 +2595,7 @@ PRODUCT_NAME = QuizTrain; SDKROOT = watchos; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 4; WATCHOS_DEPLOYMENT_TARGET = 3.0; }; @@ -2615,7 +2617,7 @@ PRODUCT_NAME = QuizTrain; SDKROOT = appletvos; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 10.0; }; @@ -2637,7 +2639,7 @@ PRODUCT_NAME = QuizTrain; SDKROOT = appletvos; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 10.0; }; @@ -2653,7 +2655,7 @@ PRODUCT_BUNDLE_IDENTIFIER = venmo.QuizTrainTests; PRODUCT_NAME = QuizTrainTests; SDKROOT = appletvos; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 11.2; }; @@ -2669,7 +2671,7 @@ PRODUCT_BUNDLE_IDENTIFIER = venmo.QuizTrainTests; PRODUCT_NAME = QuizTrainTests; SDKROOT = appletvos; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 11.2; }; @@ -2694,7 +2696,7 @@ PRODUCT_NAME = QuizTrain; SDKROOT = macosx; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -2717,7 +2719,7 @@ PRODUCT_NAME = QuizTrain; SDKROOT = macosx; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Release; }; @@ -2734,7 +2736,7 @@ PRODUCT_BUNDLE_IDENTIFIER = venmo.QuizTrainTests; PRODUCT_NAME = QuizTrainTests; SDKROOT = macosx; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -2751,7 +2753,7 @@ PRODUCT_BUNDLE_IDENTIFIER = venmo.QuizTrainTests; PRODUCT_NAME = QuizTrainTests; SDKROOT = macosx; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Release; }; From b7311a94d815add98b092928df2aa22eb5e7f396 Mon Sep 17 00:00:00 2001 From: Dave Gallagher Date: Fri, 31 Aug 2018 10:08:14 -0700 Subject: [PATCH 4/9] Set SWIFT_VERSION at project level. Targets inherit it now. --- QuizTrain.xcodeproj/project.pbxproj | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/QuizTrain.xcodeproj/project.pbxproj b/QuizTrain.xcodeproj/project.pbxproj index 480f7e5..988ce7b 100644 --- a/QuizTrain.xcodeproj/project.pbxproj +++ b/QuizTrain.xcodeproj/project.pbxproj @@ -2500,7 +2500,6 @@ PRODUCT_NAME = QuizTrain; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -2522,7 +2521,6 @@ PRODUCT_BUNDLE_IDENTIFIER = venmo.QuizTrain; PRODUCT_NAME = QuizTrain; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -2536,7 +2534,6 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = venmo.QuizTrainTests; PRODUCT_NAME = QuizTrainTests; - SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -2550,7 +2547,6 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = venmo.QuizTrainTests; PRODUCT_NAME = QuizTrainTests; - SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -2572,7 +2568,6 @@ PRODUCT_NAME = QuizTrain; SDKROOT = watchos; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 4; WATCHOS_DEPLOYMENT_TARGET = 3.0; }; @@ -2595,7 +2590,6 @@ PRODUCT_NAME = QuizTrain; SDKROOT = watchos; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 4; WATCHOS_DEPLOYMENT_TARGET = 3.0; }; @@ -2617,7 +2611,6 @@ PRODUCT_NAME = QuizTrain; SDKROOT = appletvos; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 10.0; }; @@ -2639,7 +2632,6 @@ PRODUCT_NAME = QuizTrain; SDKROOT = appletvos; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 10.0; }; @@ -2655,7 +2647,6 @@ PRODUCT_BUNDLE_IDENTIFIER = venmo.QuizTrainTests; PRODUCT_NAME = QuizTrainTests; SDKROOT = appletvos; - SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 11.2; }; @@ -2671,7 +2662,6 @@ PRODUCT_BUNDLE_IDENTIFIER = venmo.QuizTrainTests; PRODUCT_NAME = QuizTrainTests; SDKROOT = appletvos; - SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 11.2; }; @@ -2696,7 +2686,6 @@ PRODUCT_NAME = QuizTrain; SDKROOT = macosx; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -2719,7 +2708,6 @@ PRODUCT_NAME = QuizTrain; SDKROOT = macosx; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.2; }; name = Release; }; @@ -2736,7 +2724,6 @@ PRODUCT_BUNDLE_IDENTIFIER = venmo.QuizTrainTests; PRODUCT_NAME = QuizTrainTests; SDKROOT = macosx; - SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -2753,7 +2740,6 @@ PRODUCT_BUNDLE_IDENTIFIER = venmo.QuizTrainTests; PRODUCT_NAME = QuizTrainTests; SDKROOT = macosx; - SWIFT_VERSION = 4.2; }; name = Release; }; From 651fd52753633e23498a6ad59ca072a120c69234 Mon Sep 17 00:00:00 2001 From: Dave Gallagher Date: Fri, 31 Aug 2018 10:11:18 -0700 Subject: [PATCH 5/9] Example project bumped to Swift 4.2. Fixed Swift 4.2 error in AppDelegate. --- Example/Example.xcodeproj/project.pbxproj | 8 ++------ Example/Example/AppDelegate.swift | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj index 298d466..e584ca2 100644 --- a/Example/Example.xcodeproj/project.pbxproj +++ b/Example/Example.xcodeproj/project.pbxproj @@ -573,6 +573,7 @@ SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -626,6 +627,7 @@ SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_VERSION = 4.2; VALIDATE_PRODUCT = YES; }; name = Release; @@ -642,7 +644,6 @@ ); PRODUCT_BUNDLE_IDENTIFIER = QuizTrain.Example; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -659,7 +660,6 @@ ); PRODUCT_BUNDLE_IDENTIFIER = QuizTrain.Example; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -678,7 +678,6 @@ ); PRODUCT_BUNDLE_IDENTIFIER = QuizTrain.ExampleTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Example.app/Example"; }; @@ -698,7 +697,6 @@ ); PRODUCT_BUNDLE_IDENTIFIER = QuizTrain.ExampleTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Example.app/Example"; }; @@ -717,7 +715,6 @@ ); PRODUCT_BUNDLE_IDENTIFIER = QuizTrain.ExampleUITests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; TEST_TARGET_NAME = Example; }; @@ -736,7 +733,6 @@ ); PRODUCT_BUNDLE_IDENTIFIER = QuizTrain.ExampleUITests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; TEST_TARGET_NAME = Example; }; diff --git a/Example/Example/AppDelegate.swift b/Example/Example/AppDelegate.swift index fce3d36..a3b7ab8 100644 --- a/Example/Example/AppDelegate.swift +++ b/Example/Example/AppDelegate.swift @@ -34,7 +34,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + private func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { return true } From cf7fc586c223c388e19c17dbf357a291cd6864ee Mon Sep 17 00:00:00 2001 From: Dave Gallagher Date: Thu, 13 Sep 2018 13:42:57 -0700 Subject: [PATCH 6/9] Updated Readme. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cb82dcf..a770782 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ QuizTrain is open source software released under the MIT License. See the [LICEN [Carthage](https://github.com/Carthage/Carthage) is the recommended way to install QuizTrain. Add the following to your `Cartfile` or `Cartfile.private` file: - github "venmo/QuizTrain" ~> 1.1.1 + github "venmo/QuizTrain" ~> 1.2.0 See [Adding frameworks to an application](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application) for further instructions. Once complete `import QuizTrain` in any Swift files you wish to use QuizTrain in. From 059847d1858013e9212cc6863b0be4bb0d71d2e8 Mon Sep 17 00:00:00 2001 From: Dave Gallagher Date: Thu, 13 Sep 2018 13:43:48 -0700 Subject: [PATCH 7/9] Implemented #error macros in Example project. --- Example/ExampleTests/ExampleTests.swift | 15 ++++++++++----- Example/ExampleUITests/ExampleUITests.swift | 15 ++++++++++----- Example/README.md | 2 +- Example/Shared/TestManager.swift | 6 ++++-- 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/Example/ExampleTests/ExampleTests.swift b/Example/ExampleTests/ExampleTests.swift index 4661a4c..5a700cc 100644 --- a/Example/ExampleTests/ExampleTests.swift +++ b/Example/ExampleTests/ExampleTests.swift @@ -4,29 +4,34 @@ import XCTest class ExampleTests: XCTestCase { func testWhichPasses() { - XCTContext.runActivity(testing: 10011) { activity in // TODO: Replace this placeholder caseId with one from your project. + #error("Replace the placeholder caseId below with one from your project. Then comment out this macro.") + XCTContext.runActivity(testing: 10011) { activity in XCTAssertTrue(true, "The value is not true.") } } func testWhichFails() { - XCTContext.runActivity(testing: 10022) { activity in // TODO: Replace this placeholder caseId with one from your project. + #error("Replace the placeholder caseId below with one from your project. Then comment out this macro.") + XCTContext.runActivity(testing: 10022) { activity in XCTAssertTrue(false, "The value is not true.") } } func testWithPassingAndFailingAssertions() { - XCTContext.runActivity(testing: 10033) { activity in // TODO: Replace this placeholder caseId with one from your project. + #error("Replace the placeholder caseId below with one from your project. Then comment out this macro.") + XCTContext.runActivity(testing: 10033) { activity in XCTAssertTrue(true, "The value is not true.") - XCTContext.runActivity(testing: [10044, 10055]) { activity in // TODO: Replace these placeholder caseIds with some from your project. + #error("Replace the placeholder caseIds below with ones from your project. Then comment out this macro.") + XCTContext.runActivity(testing: [10044, 10055]) { activity in XCTAssertTrue(false, "The value is not true.") XCTAssertFalse(false, "The value is not false.") } - XCTContext.runActivity(testing: [10066, 10077, 10088]) { activity in // TODO: Replace these placeholder with some from your project. + #error("Replace the placeholder caseIds below with ones from your project. Then comment out this macro.") + XCTContext.runActivity(testing: [10066, 10077, 10088]) { activity in XCTAssertTrue(true, "The value is not true.") } } diff --git a/Example/ExampleUITests/ExampleUITests.swift b/Example/ExampleUITests/ExampleUITests.swift index 023c6be..50255ae 100644 --- a/Example/ExampleUITests/ExampleUITests.swift +++ b/Example/ExampleUITests/ExampleUITests.swift @@ -10,14 +10,16 @@ class ExampleUITests: XCTestCase { } func testWhichPasses() { - XCTContext.runActivity(testing: 20011) { activity in // TODO: Replace this placeholder caseId with one from your project. + #error("Replace the placeholder caseId below with one from your project. Then comment out this macro.") + XCTContext.runActivity(testing: 20011) { activity in let query = app.staticTexts["exampleLabel"] XCTAssertTrue(query.exists, query.debugDescription) } } func testWhichFails() { - XCTContext.runActivity(testing: 20022) { activity in // TODO: Replace this placeholder caseId with one from your project. + #error("Replace the placeholder caseId below with one from your project. Then comment out this macro.") + XCTContext.runActivity(testing: 20022) { activity in let query = app.staticTexts["non-existant accessibility identifier"] XCTAssertTrue(query.exists, query.debugDescription) } @@ -25,18 +27,21 @@ class ExampleUITests: XCTestCase { func testWithPassingAndFailingAssertions() { - XCTContext.runActivity(testing: 20033) { activity in // TODO: Replace this placeholder caseId with one from your project. + #error("Replace the placeholder caseId below with one from your project. Then comment out this macro.") + XCTContext.runActivity(testing: 20033) { activity in let queryA = app.staticTexts["exampleLabel"] XCTAssertTrue(queryA.exists, queryA.debugDescription) - XCTContext.runActivity(testing: [20044, 20055]) { activity in // TODO: Replace these placeholder caseIds with some from your project. + #error("Replace the placeholder caseIds below with ones from your project. Then comment out this macro.") + XCTContext.runActivity(testing: [20044, 20055]) { activity in let queryB = app.staticTexts["non-existant accessibility identifier"] XCTAssertTrue(queryB.exists, queryB.debugDescription) XCTAssertFalse(queryB.exists, queryB.debugDescription) } - XCTContext.runActivity(testing: [20066, 20077, 20088]) { activity in // TODO: Replace these placeholder with some from your project. + #error("Replace the placeholder caseIds below with ones from your project. Then comment out this macro.") + XCTContext.runActivity(testing: [20066, 20077, 20088]) { activity in let queryC = app.staticTexts["exampleLabel"] XCTAssertEqual(queryC.label, "QuizTrain Example", queryC.debugDescription) } diff --git a/Example/README.md b/Example/README.md index 9f11fdf..b6763c8 100644 --- a/Example/README.md +++ b/Example/README.md @@ -13,7 +13,7 @@ The Example project is open source software released under the MIT License. See ## Setup -Before building and running tests there are some placeholder values you must update in code marked as `TODO:`. +Before building and running tests there are some placeholder values you must update in code marked with Swift `#error` macros. After updating them comment out the macros. - `TestManager.swift` - Update `let objectAPI = QuizTrain.ObjectAPI(...)` with valid credentials and other info for your TestRail instance. diff --git a/Example/Shared/TestManager.swift b/Example/Shared/TestManager.swift index 7a9b112..be39132 100644 --- a/Example/Shared/TestManager.swift +++ b/Example/Shared/TestManager.swift @@ -18,12 +18,14 @@ final class TestManager: NSObject { defer { print("\n====================================\n") } print("QuizTrainManager setup started.") - let objectAPI = QuizTrain.ObjectAPI(username: "YOUR@TESTRAIL.EMAIL", secret: "YOUR_TESTRAIL_PASSWORD_OR_API_KEY", hostname: "YOURINSTANCE.testrail.net", port: 443, scheme: "https") // TODO: Update these arguments for your TestRail instance. + #error("Update these ObjectAPI arguments below for your TestRail instance. Then comment out this macro.") + let objectAPI = QuizTrain.ObjectAPI(username: "YOUR@TESTRAIL.EMAIL", secret: "YOUR_TESTRAIL_PASSWORD_OR_API_KEY", hostname: "YOURINSTANCE.testrail.net", port: 443, scheme: "https") var quizTrainManager: QuizTrainManager! let group = DispatchGroup() group.enter() DispatchQueue.global().async { - QuizTrainProject.populatedProject(forProjectId: 99999, objectAPI: objectAPI) { (outcome) in // TODO: Replace the projectId with one from your TestRail instance. + #error("Replace the projectId below with one from your TestRail instance. Then comment out this macro.") + QuizTrainProject.populatedProject(forProjectId: 99999, objectAPI: objectAPI) { (outcome) in switch outcome { case .failed(let error): print("QuizTrainManager setup failed: \(error)") From a1b15e1b7e26f4ee2e73116dfed8959375756cf7 Mon Sep 17 00:00:00 2001 From: Dave Gallagher Date: Thu, 13 Sep 2018 13:51:01 -0700 Subject: [PATCH 8/9] Fixed warning in Example project when printing a Plan. --- Example/Shared/QuizTrainManager.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Example/Shared/QuizTrainManager.swift b/Example/Shared/QuizTrainManager.swift index 4c132d5..8e71018 100644 --- a/Example/Shared/QuizTrainManager.swift +++ b/Example/Shared/QuizTrainManager.swift @@ -291,7 +291,7 @@ extension QuizTrainManager { print("Plan creation completed. \(plan.url)") guard let planEntries = plan.entries, planEntries.count > 0 else { - print("Aborting: There are no entries in the plan: \(plan)") + print("Aborting: There are no entries in the plan: \(String(describing: plan))") return } From 876e0ec3da7c2ed13d986e2038ea75508cf54548 Mon Sep 17 00:00:00 2001 From: Dave Gallagher Date: Thu, 13 Sep 2018 14:01:07 -0700 Subject: [PATCH 9/9] Updated Cartfile.private and Cartfile.resolved in Example project. Submodule is not updated yet. --- Example/Cartfile.private | 2 +- Example/Cartfile.resolved | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Example/Cartfile.private b/Example/Cartfile.private index 66d43fb..75c03d0 100644 --- a/Example/Cartfile.private +++ b/Example/Cartfile.private @@ -1 +1 @@ -github "venmo/QuizTrain" ~> 1.1.1 +github "venmo/QuizTrain" ~> 1.2.0 diff --git a/Example/Cartfile.resolved b/Example/Cartfile.resolved index 40d6d83..9c7896e 100644 --- a/Example/Cartfile.resolved +++ b/Example/Cartfile.resolved @@ -1 +1 @@ -github "venmo/QuizTrain" "v1.1.1" +github "venmo/QuizTrain" "v1.2.0"