Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Commit 5ea04cd

Browse files
viktoraslBasThomas
authored andcommitted
Migrate to Xcode 10.2.x (#2733)
* Update Apollo dependency to 0.10.0; use Apollo CLI to generate API; audit & fix npm package * Adapt new Apollo GraphQL build phase * Adapt new API nodes structure * Disable unused_setter_value swiftlint rule (issue SwiftLint#2585) * Apply conformance to revamped Hashable protocol * Apply Xcode's recommended settings * Amend issue attribute name * Extract Apollo GQL API generation build phase to script * Extract API keys validation build phase to script * Update Apollo to latest version & fix Podfile warnings
1 parent 239206e commit 5ea04cd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+12727
-15005
lines changed

.swiftlint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ disabled_rules:
1111
- file_length
1212
- large_tuple
1313
- nesting
14+
- unused_setter_value
1415

1516
included:
1617
- Classes

Classes/Issues/Comments/Reactions/IssueCommentReactionViewModel.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@
99
import Foundation
1010
import IGListKit
1111

12-
extension ReactionContent: Hashable {
13-
public var hashValue: Int {
14-
return rawValue.hashValue
15-
}
16-
}
17-
1812
final class IssueCommentReactionViewModel: ListDiffable {
1913

2014
let models: [ReactionViewModel]

Classes/Issues/GithubClient+Issues.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ extension GithubClient {
154154
title: titleStringSizing(title: issueType.title, contentSizeCategory: contentSizeCategory, width: width),
155155
labels: IssueLabelsModel(
156156
status: IssueLabelStatusModel(status: status, pullRequest: issueType.pullRequest),
157-
locked: issueType.locked,
157+
locked: issueType.isLocked,
158158
labels: issueType.labelableFields.issueLabelModels
159159
),
160160
assignee: createAssigneeModel(assigneeFields: issueType.assigneeFields),

Classes/Issues/Issue+IssueType.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@ import IGListKit
1111

1212
extension IssueOrPullRequestQuery.Data.Repository.IssueOrPullRequest.AsIssue: IssueType {
1313

14+
var id: String {
15+
return fragments.nodeFields.id
16+
}
17+
18+
var isLocked: Bool {
19+
return fragments.lockableFields.locked
20+
}
21+
22+
var viewerCanUpdate: Bool {
23+
return fragments.updatableFields.viewerCanUpdate
24+
}
25+
1426
var pullRequest: Bool {
1527
return false
1628
}

Classes/Issues/IssueType.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ protocol IssueType {
3030
var milestoneFields: MilestoneFields? { get }
3131
var merged: Bool { get }
3232
var targetBranch: String? { get }
33-
var locked: Bool { get }
33+
var isLocked: Bool { get }
3434
var headPaging: HeadPaging { get }
3535
var viewerCanUpdate: Bool { get }
3636
var fileChanges: FileChanges? { get }

Classes/Issues/PullRequest+IssueType.swift

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ import StyledTextKit
1212

1313
extension IssueOrPullRequestQuery.Data.Repository.IssueOrPullRequest.AsPullRequest: IssueType {
1414

15+
var id: String {
16+
return fragments.nodeFields.id
17+
}
18+
19+
var isLocked: Bool {
20+
return fragments.lockableFields.locked
21+
}
22+
23+
var viewerCanUpdate: Bool {
24+
return fragments.updatableFields.viewerCanUpdate
25+
}
26+
1527
var pullRequest: Bool {
1628
return true
1729
}
@@ -57,7 +69,7 @@ extension IssueOrPullRequestQuery.Data.Repository.IssueOrPullRequest.AsPullReque
5769
else { return nil }
5870

5971
var contexts = [IssueMergeContextModel]()
60-
for context in commit.status?.contexts ?? [] {
72+
for context in commit.fragments.commitContext.status?.contexts ?? [] {
6173
guard let creator = context.creator,
6274
let avatarURL = URL(string: creator.avatarUrl),
6375
let targetUrlString = context.targetUrl,
@@ -75,7 +87,7 @@ extension IssueOrPullRequestQuery.Data.Repository.IssueOrPullRequest.AsPullReque
7587
}
7688

7789
return IssueMergeModel(
78-
id: commit.id,
90+
id: commit.fragments.commitContext.id,
7991
state: mergeStateStatus,
8092
contexts: contexts,
8193
availableTypes: availableTypes

Classes/Models/RepositoryLabel.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ final class RepositoryLabel: ListDiffable, Hashable, Equatable, ListSwiftDiffabl
3333

3434
// MARK: Hashable
3535

36-
var hashValue: Int {
37-
return color.hashValue
38-
.combineHash(with: name.hashValue)
36+
public func hash(into hasher: inout Hasher) {
37+
hasher.combine(color.hashValue)
38+
hasher.combine(name.hashValue)
3939
}
4040

4141
// MARK: Equatable

Classes/Repository/GQL+RepositoryIssueSummaryType.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import Foundation
1010

1111
extension RepoSearchPagesQuery.Data.Search.Node.AsIssue: RepositoryIssueSummaryType {
1212

13+
var id: String {
14+
return fragments.nodeFields.id
15+
}
16+
1317
var labelableFields: LabelableFields {
1418
return fragments.labelableFields
1519
}
@@ -37,6 +41,10 @@ extension RepoSearchPagesQuery.Data.Search.Node.AsIssue: RepositoryIssueSummaryT
3741

3842
extension RepoSearchPagesQuery.Data.Search.Node.AsPullRequest: RepositoryIssueSummaryType {
3943

44+
var id: String {
45+
return fragments.nodeFields.id
46+
}
47+
4048
var labelableFields: LabelableFields {
4149
return fragments.labelableFields
4250
}

Freetime.xcodeproj/project.pbxproj

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2488,7 +2488,7 @@
24882488
isa = PBXProject;
24892489
attributes = {
24902490
LastSwiftUpdateCheck = 0930;
2491-
LastUpgradeCheck = 1000;
2491+
LastUpgradeCheck = 1020;
24922492
ORGANIZATIONNAME = "Ryan Nystrom";
24932493
TargetAttributes = {
24942494
294EE4B8209006BF002C9CB1 = {
@@ -2539,7 +2539,7 @@
25392539
};
25402540
buildConfigurationList = 297AE82F1EC0D58A00B44A1F /* Build configuration list for PBXProject "Freetime" */;
25412541
compatibilityVersion = "Xcode 3.2";
2542-
developmentRegion = English;
2542+
developmentRegion = en;
25432543
hasScannedForEncodings = 0;
25442544
knownRegions = (
25452545
en,
@@ -2618,7 +2618,7 @@
26182618
);
26192619
runOnlyForDeploymentPostprocessing = 0;
26202620
shellPath = /bin/sh;
2621-
shellScript = "if [[ ! -z \"${DISABLE_APOLLO}\" ]]; then\n echo \"Stopping Task: Remove 'DISABLE_APOLLO' env variable to continue.\"\n exit\nfi\n\nPATH=\"$(npm bin):$PATH\"\n\nAPOLLO_FRAMEWORK_PATH=\"$(eval find $FRAMEWORK_SEARCH_PATHS -name \\\"Apollo.framework\\\" -maxdepth 1)\"\n\nif [ -z \"$APOLLO_FRAMEWORK_PATH\" ]; then\necho \"error: Couldn't find Apollo.framework in FRAMEWORK_SEARCH_PATHS; make sure to add the framework to your project.\"\nexit 1\nfi\n\ncd \"${SRCROOT}/gql\"\nTEMP_FILE=$(mktemp)\n\n[[ -f API.swift ]] || touch API.swift # ensure sure file exists\n\n$APOLLO_FRAMEWORK_PATH/check-and-run-apollo-codegen.sh generate $(find . -name '*.graphql') --schema schema.json --output $TEMP_FILE\n\ncmp API.swift $TEMP_FILE || cp $TEMP_FILE API.swift";
2621+
shellScript = "./build-phases/generate-apollo-graphql-api.sh\n";
26222622
};
26232623
295B51391FC2342200C3993B /* Run Fabric */ = {
26242624
isa = PBXShellScriptBuildPhase;
@@ -2700,7 +2700,7 @@
27002700
);
27012701
runOnlyForDeploymentPostprocessing = 0;
27022702
shellPath = /bin/sh;
2703-
shellScript = "FAILED=false\n\nif [ -z \"${BUDDYBUILD_BUILD_NUMBER}\" ]; then\n echo \"Script is not being run on CI\"\n exit 0\nfi\n\nif [ -z \"${GITHUB_CLIENT_ID}\" ]; then\n echo \"${SRCROOT}/Classes/Systems/Secrets.swift:14:1: warning: Missing GitHub Client ID\"\n FAILED=true\nfi\n\nif [ -z \"${GITHUB_CLIENT_SECRET}\" ]; then\n echo \"${SRCROOT}/Classes/Systems/Secrets.swift:15:1: warning: Missing GitHub Client Secret\"\n FAILED=true\nfi\n\nif [ -z \"${IMGUR_CLIENT_ID}\" ]; then\n echo \"${SRCROOT}/Classes/Systems/Secrets.swift:16:1: warning: Missing Imgur Client ID\"\n FAILED=true\nfi\n\nsed -i \".tmp\" \"s|{GITHUBID}|${GITHUB_CLIENT_ID}|g; s|{GITHUBSECRET}|${GITHUB_CLIENT_SECRET}|g; s|{IMGURID}|${IMGUR_CLIENT_ID}|g\" \"${SRCROOT}/Classes/Systems/Secrets.swift\"\n\nif [ \"$FAILED\" = true ]; then\n exit 1\nfi\n\necho \"All env values found!\"";
2703+
shellScript = "./build-phases/validate-api-keys.sh\n";
27042704
};
27052705
ABA015066A84600AF351C942 /* [CP] Embed Pods Frameworks */ = {
27062706
isa = PBXShellScriptBuildPhase;
@@ -3653,6 +3653,7 @@
36533653
isa = XCBuildConfiguration;
36543654
buildSettings = {
36553655
ALWAYS_SEARCH_USER_PATHS = NO;
3656+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
36563657
CLANG_ANALYZER_NONNULL = YES;
36573658
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
36583659
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
@@ -3714,6 +3715,7 @@
37143715
isa = XCBuildConfiguration;
37153716
buildSettings = {
37163717
ALWAYS_SEARCH_USER_PATHS = NO;
3718+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
37173719
CLANG_ANALYZER_NONNULL = YES;
37183720
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
37193721
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
@@ -3886,6 +3888,7 @@
38863888
isa = XCBuildConfiguration;
38873889
buildSettings = {
38883890
ALWAYS_SEARCH_USER_PATHS = NO;
3891+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
38893892
CLANG_ANALYZER_NONNULL = YES;
38903893
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
38913894
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";

Freetime.xcodeproj/xcshareddata/xcschemes/Freetime-AppCenter.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1000"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

0 commit comments

Comments
 (0)