Skip to content

Commit 31c5450

Browse files
authored
Removed pantry pod and codabled everything (#274)
* Removed pantry pod and codabled everything. * Updated tests to run on xcode 11. * More specific in our xcode build. * Use the temp directory during tests. * Less test configuration with tips from @subdigital
1 parent eb59ada commit 31c5450

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

+1436
-3076
lines changed

.bundle/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
BUNDLE_PATH: "vendor/bundle"

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
# The `macos` block requests that builds will run on a machine running
2121
# macOS with the specified version of Xcode installed
2222
macos:
23-
xcode: '10.2.1'
23+
xcode: '11.2.1'
2424
steps:
2525
# Machine Setup
2626
# If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,4 @@ fastlane/screenshots
6868
fastlane/test_output
6969
.env
7070
.ruby-version
71+
vendor/

FiveCalls/FiveCalls.xcodeproj/project.pbxproj

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@
676676
TargetAttributes = {
677677
B502805A1E478BC200749ED7 = {
678678
CreatedOnToolsVersion = 8.2.1;
679-
DevelopmentTeam = C2K3864N2N;
679+
DevelopmentTeam = 5A8RM3W5R7;
680680
LastSwiftMigration = 0900;
681681
ProvisioningStyle = Automatic;
682682
TestTargetID = B52805101E3FA94D00EE832A;
@@ -808,12 +808,10 @@
808808
);
809809
inputPaths = (
810810
"${PODS_ROOT}/Target Support Files/Pods-FiveCallsTests/Pods-FiveCallsTests-frameworks.sh",
811-
"${BUILT_PRODUCTS_DIR}/Pantry/Pantry.framework",
812811
"${BUILT_PRODUCTS_DIR}/R.swift.Library/Rswift.framework",
813812
);
814813
name = "[CP] Embed Pods Frameworks";
815814
outputPaths = (
816-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Pantry.framework",
817815
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Rswift.framework",
818816
);
819817
runOnlyForDeploymentPostprocessing = 0;
@@ -901,7 +899,6 @@
901899
"${BUILT_PRODUCTS_DIR}/DZNEmptyDataSet/DZNEmptyDataSet.framework",
902900
"${BUILT_PRODUCTS_DIR}/Down/Down.framework",
903901
"${BUILT_PRODUCTS_DIR}/Kingfisher/Kingfisher.framework",
904-
"${BUILT_PRODUCTS_DIR}/Pantry/Pantry.framework",
905902
"${BUILT_PRODUCTS_DIR}/PromiseKit/PromiseKit.framework",
906903
"${BUILT_PRODUCTS_DIR}/R.swift.Library/Rswift.framework",
907904
"${BUILT_PRODUCTS_DIR}/SimpleKeychain/SimpleKeychain.framework",
@@ -913,7 +910,6 @@
913910
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DZNEmptyDataSet.framework",
914911
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Down.framework",
915912
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Kingfisher.framework",
916-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Pantry.framework",
917913
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PromiseKit.framework",
918914
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Rswift.framework",
919915
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SimpleKeychain.framework",
@@ -1093,7 +1089,7 @@
10931089
baseConfigurationReference = FD64521687461F251492AC67 /* Pods-FiveCallsTests.debug.xcconfig */;
10941090
buildSettings = {
10951091
BUNDLE_LOADER = "$(TEST_HOST)";
1096-
DEVELOPMENT_TEAM = C2K3864N2N;
1092+
DEVELOPMENT_TEAM = 5A8RM3W5R7;
10971093
INFOPLIST_FILE = FiveCallsTests/Info.plist;
10981094
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
10991095
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
@@ -1110,7 +1106,7 @@
11101106
baseConfigurationReference = 3974FAF60EF8B491496DC6D0 /* Pods-FiveCallsTests.release.xcconfig */;
11111107
buildSettings = {
11121108
BUNDLE_LOADER = "$(TEST_HOST)";
1113-
DEVELOPMENT_TEAM = C2K3864N2N;
1109+
DEVELOPMENT_TEAM = 5A8RM3W5R7;
11141110
INFOPLIST_FILE = FiveCallsTests/Info.plist;
11151111
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
11161112
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
@@ -1250,6 +1246,7 @@
12501246
INFOPLIST_FILE = FiveCalls/Info.plist;
12511247
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
12521248
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
1249+
MARKETING_VERSION = 1.6;
12531250
ONE_SIGNAL_APP_ID = "5fd4ca41-9f6c-4149-a312-ae3e71b35c0e";
12541251
PRODUCT_BUNDLE_IDENTIFIER = "org.fivecalls.FiveCalls-ios";
12551252
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -1278,6 +1275,7 @@
12781275
INFOPLIST_FILE = FiveCalls/Info.plist;
12791276
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
12801277
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
1278+
MARKETING_VERSION = 1.6;
12811279
ONE_SIGNAL_APP_ID = "5fd4ca41-9f6c-4149-a312-ae3e71b35c0e";
12821280
PRODUCT_BUNDLE_IDENTIFIER = "org.fivecalls.FiveCalls-ios";
12831281
PRODUCT_NAME = "$(TARGET_NAME)";

FiveCalls/FiveCalls.xcodeproj/xcshareddata/xcschemes/FiveCalls.xcscheme

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@
4141
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4242
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
4343
shouldUseLaunchSchemeArgsEnv = "YES">
44+
<MacroExpansion>
45+
<BuildableReference
46+
BuildableIdentifier = "primary"
47+
BlueprintIdentifier = "B52805101E3FA94D00EE832A"
48+
BuildableName = "FiveCalls.app"
49+
BlueprintName = "FiveCalls"
50+
ReferencedContainer = "container:FiveCalls.xcodeproj">
51+
</BuildableReference>
52+
</MacroExpansion>
4453
<Testables>
4554
<TestableReference
4655
skipped = "NO">
@@ -53,17 +62,6 @@
5362
</BuildableReference>
5463
</TestableReference>
5564
</Testables>
56-
<MacroExpansion>
57-
<BuildableReference
58-
BuildableIdentifier = "primary"
59-
BlueprintIdentifier = "B52805101E3FA94D00EE832A"
60-
BuildableName = "FiveCalls.app"
61-
BlueprintName = "FiveCalls"
62-
ReferencedContainer = "container:FiveCalls.xcodeproj">
63-
</BuildableReference>
64-
</MacroExpansion>
65-
<AdditionalOptions>
66-
</AdditionalOptions>
6765
</TestAction>
6866
<LaunchAction
6967
buildConfiguration = "Debug"
@@ -85,8 +83,6 @@
8583
ReferencedContainer = "container:FiveCalls.xcodeproj">
8684
</BuildableReference>
8785
</BuildableProductRunnable>
88-
<AdditionalOptions>
89-
</AdditionalOptions>
9086
</LaunchAction>
9187
<ProfileAction
9288
buildConfiguration = "Release"

FiveCalls/FiveCalls/AppDelegate.swift

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
//
88

99
import UIKit
10-
import Pantry
1110
import Auth0
1211
import OneSignal
1312

@@ -22,10 +21,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
2221
resetData()
2322
}
2423

25-
migrateSavedData()
26-
27-
Pantry.useApplicationSupportDirectory = true
28-
2924
clearNotificationBadge()
3025
setAppearance()
3126

@@ -58,26 +53,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
5853
OneSignal.inFocusDisplayType = OSNotificationDisplayType.notification
5954
}
6055
}
61-
62-
func migrateSavedData() {
63-
let pantryDirName = "com.thatthinginswift.pantry"
64-
// Pantry used to store data in the caches folder. If this exists, we need to move it
65-
// and delete it, to avoid this getting purged when the device is low on disk space.
66-
let cachesDir = NSSearchPathForDirectoriesInDomains(.cachesDirectory, .userDomainMask, true).first!
67-
let oldPantryPath = URL(fileURLWithPath: cachesDir).appendingPathComponent(pantryDirName).path
68-
69-
if FileManager.default.fileExists(atPath: oldPantryPath) {
70-
print("Saved data found in caches folder, moving to Application Support...")
71-
let appSupportDir = NSSearchPathForDirectoriesInDomains(.applicationSupportDirectory, .userDomainMask, true).first!
72-
let targetPath = URL(fileURLWithPath: appSupportDir).appendingPathComponent(pantryDirName).path
73-
do {
74-
try FileManager.default.moveItem(atPath: oldPantryPath, toPath: targetPath)
75-
print("Files migrated.")
76-
} catch let e {
77-
print("Error moving files: \(e)")
78-
}
79-
}
80-
}
8156

8257
func transitionTo(rootViewController viewController: UIViewController) {
8358
guard let window = self.window else { return }
@@ -140,7 +115,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
140115
UserDefaults.standard.removePersistentDomain(forName: appDomain)
141116

142117
// clear any saved location data
143-
Pantry.removeAllCache()
118+
ContactLogs.removeData()
144119
}
145120

146121
private func clearNotificationBadge() {
@@ -161,4 +136,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
161136
defaults.setValue(currentVersion, forKey: UserDefaultsKey.appVersion.rawValue)
162137
defaults.set(Int(0), forKey: UserDefaultsKey.countOfCallsForRatingPrompt.rawValue)
163138
}
139+
140+
static var isRunningUnitTests: Bool {
141+
return ProcessInfo.processInfo.environment.keys.contains("XCInjectBundleInto")
142+
}
164143
}

0 commit comments

Comments
 (0)