Skip to content

Commit 421b0f0

Browse files
committed
Merge branch 'develop' into issue/9-fullfill-order
2 parents fa11ee4 + bdc4df6 commit 421b0f0

File tree

62 files changed

+1746
-95
lines changed

Some content is hidden

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

62 files changed

+1746
-95
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
## Build generated
66
build/
77
DerivedData/
8-
DerivedSources/
8+
WooCommerce/DerivedSources/
99

1010
## Various settings
1111
*.pbxuser

Dangerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# A PR should have at least one label
2+
warn("PR is missing at least one label.") if github.pr_labels.empty?
3+
4+
# Warn when there is a big PR
5+
warn("PR has more than 500 lines of code changing. Consider splitting into smaller PRs if possible.") if git.lines_of_code > 500
6+
7+
# PRs should have a milestone attached
8+
has_milestone = github.pr_json["milestone"] != nil
9+
warn("PR is not assigned to a milestone.", sticky: false) unless has_milestone
10+
11+
12+
### Core Data Model Safety Checks
13+
target_release_branch = github.branch_for_base.start_with? "release"
14+
has_modified_model = git.modified_files.include? "WordPress/Classes/WordPress.xcdatamodeld/*/contents"
15+
16+
warn("Core Data: Do not edit an existing model in a release branch unless it hasn't been released to testers yet. Instead create a new model version and merge back to develop soon.") if has_modified_model
17+
18+
19+
### Enable SwiftLint
20+
swiftlint.lint_files inline_mode: true

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ source 'https://rubygems.org' do
22
gem 'rake'
33
gem 'cocoapods', '~> 1.5.2'
44
gem 'xcpretty-travis-formatter'
5+
gem 'danger'
6+
gem 'danger-swiftlint'
57
end

Gemfile.lock

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@ GEM
77
minitest (~> 5.1)
88
thread_safe (~> 0.3, >= 0.3.4)
99
tzinfo (~> 1.1)
10+
addressable (2.5.2)
11+
public_suffix (>= 2.0.2, < 4.0)
1012
atomos (0.1.2)
1113
claide (1.0.2)
14+
claide-plugins (0.9.2)
15+
cork
16+
nap
17+
open4 (~> 1.3)
1218
cocoapods (1.5.3)
1319
activesupport (>= 4.0.2, < 5)
1420
claide (>= 1.0.2, < 2.0)
@@ -44,23 +50,60 @@ GEM
4450
cocoapods-try (1.1.0)
4551
colored2 (3.1.2)
4652
concurrent-ruby (1.0.5)
53+
cork (0.3.0)
54+
colored2 (~> 3.1)
55+
danger (5.6.2)
56+
claide (~> 1.0)
57+
claide-plugins (>= 0.9.2)
58+
colored2 (~> 3.1)
59+
cork (~> 0.1)
60+
faraday (~> 0.9)
61+
faraday-http-cache (~> 1.0)
62+
git (~> 1)
63+
kramdown (~> 1.5)
64+
no_proxy_fix
65+
octokit (~> 4.7)
66+
terminal-table (~> 1)
67+
danger-swiftlint (0.12.1)
68+
danger
69+
rake (> 10)
70+
thor (~> 0.19)
4771
escape (0.0.4)
72+
faraday (0.15.2)
73+
multipart-post (>= 1.2, < 3)
74+
faraday-http-cache (1.3.1)
75+
faraday (~> 0.8)
4876
fourflusher (2.0.1)
4977
fuzzy_match (2.0.4)
5078
gh_inspector (1.1.3)
79+
git (1.4.0)
5180
i18n (0.9.5)
5281
concurrent-ruby (~> 1.0)
82+
kramdown (1.17.0)
5383
minitest (5.11.3)
5484
molinillo (0.6.5)
85+
multipart-post (2.0.0)
5586
nanaimo (0.2.5)
5687
nap (1.1.0)
5788
netrc (0.11.0)
89+
no_proxy_fix (0.1.2)
90+
octokit (4.9.0)
91+
sawyer (~> 0.8.0, >= 0.5.3)
92+
open4 (1.3.4)
93+
public_suffix (2.0.5)
5894
rake (12.0.0)
5995
rouge (1.11.1)
6096
ruby-macho (1.1.0)
97+
sawyer (0.8.1)
98+
addressable (>= 2.3.5, < 2.6)
99+
faraday (~> 0.8, < 1.0)
100+
terminal-table (1.8.0)
101+
unicode-display_width (~> 1.1, >= 1.1.1)
102+
thor (0.20.0)
61103
thread_safe (0.3.6)
62104
tzinfo (1.2.5)
63105
thread_safe (~> 0.1)
106+
unicode-display_width (1.4.0)
64107
xcodeproj (1.5.9)
65108
CFPropertyList (>= 2.3.3, < 4.0)
66109
atomos (~> 0.1.2)
@@ -77,8 +120,10 @@ PLATFORMS
77120

78121
DEPENDENCIES
79122
cocoapods (~> 1.5.2)!
123+
danger!
124+
danger-swiftlint!
80125
rake!
81126
xcpretty-travis-formatter!
82127

83128
BUNDLED WITH
84-
1.16.1
129+
1.16.2

Networking/Networking.xcodeproj/project.pbxproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@
219219
B557DA0520975507005962F4 /* Remote */,
220220
B557DA1020975F60005962F4 /* Settings */,
221221
B505F6EB20BEFD9100BB1B69 /* Tools */,
222+
CE60505720D9A99C00A74DD6 /* Utilities */,
222223
B557D9E6209753AA005962F4 /* Networking.h */,
223224
B557D9E7209753AA005962F4 /* Info.plist */,
224225
);
@@ -339,6 +340,13 @@
339340
name = Pods;
340341
sourceTree = "<group>";
341342
};
343+
CE60505720D9A99C00A74DD6 /* Utilities */ = {
344+
isa = PBXGroup;
345+
children = (
346+
);
347+
path = Utilities;
348+
sourceTree = "<group>";
349+
};
342350
/* End PBXGroup section */
343351

344352
/* Begin PBXHeadersBuildPhase section */
@@ -458,10 +466,12 @@
458466
inputPaths = (
459467
"${SRCROOT}/../Pods/Target Support Files/Pods-NetworkingTests/Pods-NetworkingTests-frameworks.sh",
460468
"${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework",
469+
"${BUILT_PRODUCTS_DIR}/CocoaLumberjack-Default-Swift/CocoaLumberjack.framework",
461470
);
462471
name = "[CP] Embed Pods Frameworks";
463472
outputPaths = (
464473
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework",
474+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CocoaLumberjack.framework",
465475
);
466476
runOnlyForDeploymentPostprocessing = 0;
467477
shellPath = /bin/sh;
@@ -712,6 +722,7 @@
712722
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
713723
SWIFT_VERSION = 4.0;
714724
TARGETED_DEVICE_FAMILY = "1,2";
725+
VALID_ARCHS = "arm64 armv7 armv7s x86_64";
715726
};
716727
name = Debug;
717728
};
@@ -740,6 +751,7 @@
740751
SKIP_INSTALL = YES;
741752
SWIFT_VERSION = 4.0;
742753
TARGETED_DEVICE_FAMILY = "1,2";
754+
VALID_ARCHS = "arm64 armv7 armv7s x86_64";
743755
};
744756
name = Release;
745757
};
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "0940"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "B557D9E2209753AA005962F4"
18+
BuildableName = "Networking.framework"
19+
BlueprintName = "Networking"
20+
ReferencedContainer = "container:Networking.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
<TestableReference
32+
skipped = "NO">
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "B557D9EB209753AA005962F4"
36+
BuildableName = "NetworkingTests.xctest"
37+
BlueprintName = "NetworkingTests"
38+
ReferencedContainer = "container:Networking.xcodeproj">
39+
</BuildableReference>
40+
</TestableReference>
41+
</Testables>
42+
<MacroExpansion>
43+
<BuildableReference
44+
BuildableIdentifier = "primary"
45+
BlueprintIdentifier = "B557D9E2209753AA005962F4"
46+
BuildableName = "Networking.framework"
47+
BlueprintName = "Networking"
48+
ReferencedContainer = "container:Networking.xcodeproj">
49+
</BuildableReference>
50+
</MacroExpansion>
51+
<AdditionalOptions>
52+
</AdditionalOptions>
53+
</TestAction>
54+
<LaunchAction
55+
buildConfiguration = "Debug"
56+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
57+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
58+
launchStyle = "0"
59+
useCustomWorkingDirectory = "NO"
60+
ignoresPersistentStateOnLaunch = "NO"
61+
debugDocumentVersioning = "YES"
62+
debugServiceExtension = "internal"
63+
allowLocationSimulation = "YES">
64+
<MacroExpansion>
65+
<BuildableReference
66+
BuildableIdentifier = "primary"
67+
BlueprintIdentifier = "B557D9E2209753AA005962F4"
68+
BuildableName = "Networking.framework"
69+
BlueprintName = "Networking"
70+
ReferencedContainer = "container:Networking.xcodeproj">
71+
</BuildableReference>
72+
</MacroExpansion>
73+
<AdditionalOptions>
74+
</AdditionalOptions>
75+
</LaunchAction>
76+
<ProfileAction
77+
buildConfiguration = "Release"
78+
shouldUseLaunchSchemeArgsEnv = "YES"
79+
savedToolIdentifier = ""
80+
useCustomWorkingDirectory = "NO"
81+
debugDocumentVersioning = "YES">
82+
<MacroExpansion>
83+
<BuildableReference
84+
BuildableIdentifier = "primary"
85+
BlueprintIdentifier = "B557D9E2209753AA005962F4"
86+
BuildableName = "Networking.framework"
87+
BlueprintName = "Networking"
88+
ReferencedContainer = "container:Networking.xcodeproj">
89+
</BuildableReference>
90+
</MacroExpansion>
91+
</ProfileAction>
92+
<AnalyzeAction
93+
buildConfiguration = "Debug">
94+
</AnalyzeAction>
95+
<ArchiveAction
96+
buildConfiguration = "Release"
97+
revealArchiveInOrganizer = "YES">
98+
</ArchiveAction>
99+
</Scheme>

Networking/Networking/Network/MockupNetwork.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class MockupNetwork: Network {
2727
/// Dummy convenience initializer. Remember: Real Network wrappers will allways need credentials!
2828
///
2929
convenience init() {
30-
let dummy = Credentials(authToken: String())
30+
let dummy = Credentials(username: "", authToken: "")
3131
self.init(credentials: dummy)
3232
}
3333

Networking/Networking/Network/Tools/Loader.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Foundation
2-
2+
import CocoaLumberjack
33

44
/// File-Loading Tools: Only for Unit Testing purposes.
55
///
@@ -20,7 +20,7 @@ class Loader {
2020
do {
2121
return try JSONSerialization.jsonObject(with: data, options: [.mutableContainers, .mutableLeaves])
2222
} catch {
23-
NSLog("Parsing Error: \(error)")
23+
DDLogError("Parsing Error: \(error)")
2424
}
2525

2626
return nil

Networking/Networking/Remote/Remote.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
22
import Alamofire
3-
3+
import CocoaLumberjack
44

55
/// Represents a collection of Remote Endpoints
66
///
@@ -61,7 +61,7 @@ public class Remote {
6161
let parsed = try mapper.map(response: data)
6262
completion(parsed, nil)
6363
} catch {
64-
NSLog("<> Mapping Error: \(error)")
64+
DDLogError("<> Mapping Error: \(error)")
6565
completion(nil, error)
6666
}
6767
}

Networking/Networking/Settings/Credentials.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,19 @@ import Foundation
55
///
66
public struct Credentials: Equatable {
77

8+
/// WordPress.com Username
9+
///
10+
public let username: String
11+
812
/// WordPress.com Authentication Token
913
///
1014
public let authToken: String
1115

16+
1217
/// Designated Initializer
1318
///
14-
public init(authToken: String) {
19+
public init(username: String, authToken: String) {
20+
self.username = username
1521
self.authToken = authToken
1622
}
1723
}
@@ -20,5 +26,5 @@ public struct Credentials: Equatable {
2026
/// Equatable Support
2127
///
2228
public func ==(lhs: Credentials, rhs: Credentials) -> Bool {
23-
return lhs.authToken == rhs.authToken
29+
return lhs.authToken == rhs.authToken && lhs.username == rhs.username
2430
}

0 commit comments

Comments
 (0)