Skip to content

Commit 251aa02

Browse files
nbhasin2skhamislougeniaC64
authored
Swift Package Manager and M1 Support (#9507)
added: - added references to specific components to compile - added spm related nightly, beta and prod builds to bitrise - added content_blocker_update.sh script to update shavar content blocker - added swiftkeychain wrapper (MZSwiftKeychain) to RustFxAClient - added a workaround run-script to each apex (application extension) target to remove any framework that isn't required in the archive to avoid nested dependency - added rust places and sdwebimage framework to XCUitest - added M1 simulator work - added all dependencies as a part of swift package manager moved: - moved app services to swift packages - moved all app services related static dependency to dlyb frameworks to avoid cyclic dependency until SPM is ready for nested frameworks in multiple targets updated: - updated and moved sdk_generator.sh to /bin folrder repo and removed references to getting it from a-s - updated A~S v90.0.2 (main branch) and added Client / Storage test libs - updated Glean package to 43.0.2 (latest) - fixed test dependencies - updated Firefox and Firefox beta scheme to support dependency order and find implicit dependency - updated readme to mention that we support XCode 13.2.1 - updated bootstrap.sh to not have any carthage related item and use content_blocker_update.sh - updated gitignore to ignore shavar prod list removed: - removed bitrise step for moving, copying sdk_generator (should be for main branch only) - removed carthage and moved all dependencies to swift package manager - removed stale 1password related framework and code. If required we will revisit to cleanup more todo: - update: MozillaRustComponents to support direct version instead of a special branch on a fork - update: Fuzi spm package to support direct version instead of a fork - update: MappaMundi spm package and move changes from fork to the actual branch - update: GCDWebservier spm package to support direct version instead of a fork - update: need to update BR for unit tests - remove: any un-used workaround script and just use static frameworks once SPM supports nested frameworks Note: - Not all frameworks are required to be code signed and copy framework step on purpose so we can add it later if required Co-authored-by: Sammy Khamis <skhamis@mozilla.com> Co-authored-by: lougeniaC64 <lougeniaC64@users.noreply.github.com>
1 parent 78ad57b commit 251aa02

File tree

81 files changed

+3511
-738
lines changed

Some content is hidden

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

81 files changed

+3511
-738
lines changed

.gitignore

+1-3
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,4 @@ Client/Assets/*.js.LICENSE.txt
9797
# L10n
9898
/firefoxios-l10n
9999
/ios-l10n-scripts
100-
101-
# Glean
102-
sdk_generator.sh
100+
/shavar-prod-lists

Account/FxAPushMessageHandler.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import Shared
66
import SwiftyJSON
77
import SyncTelemetry
88
import Account
9-
import SwiftKeychainWrapper
109
import os.log
10+
import FxAClient
1111

1212
private let log = Logger.syncLogger
1313

@@ -31,7 +31,7 @@ extension FxAPushMessageHandler {
3131
/// This method then decrypts it according to the content-encoding (aes128gcm or aesgcm)
3232
/// and then effects changes on the logged in account.
3333
@discardableResult func handle(userInfo: [AnyHashable: Any]) -> PushMessageResult {
34-
let keychain = KeychainWrapper.sharedAppContainerKeychain
34+
let keychain = MZKeychainWrapper.sharedClientAppContainerKeychain
3535
guard let pushReg = keychain.object(forKey: KeychainKey.fxaPushRegistration) as? PushRegistration else {
3636
return deferMaybe(PushMessageError.accountError)
3737
}
@@ -57,7 +57,7 @@ extension FxAPushMessageHandler {
5757

5858
guard let string = plaintext else {
5959
// The app will detect this missing, and re-register. see AppDelegate+PushNotifications.swift.
60-
keychain.removeObject(forKey: KeychainKey.apnsToken, withAccessibility: .afterFirstUnlock)
60+
keychain.removeObject(forKey: KeychainKey.apnsToken, withAccessibility: MZKeychainItemAccessibility.afterFirstUnlock)
6161
return deferMaybe(PushMessageError.notDecrypted)
6262
}
6363

Account/SyncAuthState.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Foundation
66
import Shared
77
import XCGLogger
88
import SwiftyJSON
9-
import MozillaAppServices
9+
import FxAClient
1010

1111

1212
public let FxAClientErrorDomain = "org.mozilla.fxa.error"

Cartfile

-16
This file was deleted.

Cartfile.resolved

-16
This file was deleted.

Client.xcodeproj/project.pbxproj

+2,394-403
Large diffs are not rendered by default.

Client.xcodeproj/project.xcworkspace/contents.xcworkspacedata

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Client.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

+127-1
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,140 @@
11
{
22
"object": {
33
"pins": [
4+
{
5+
"package": "AStar",
6+
"repositoryURL": "https://github.com/Dev1an/A-Star",
7+
"state": {
8+
"branch": null,
9+
"revision": "036256f9a8d1dda44085a2b92fa58199446a8339",
10+
"version": "3.0.0-beta-1"
11+
}
12+
},
13+
{
14+
"package": "Fuzi",
15+
"repositoryURL": "https://github.com/nbhasin2/Fuzi.git",
16+
"state": {
17+
"branch": "master",
18+
"revision": "04170682baf5c013a41270963c689c87ba0d1374",
19+
"version": null
20+
}
21+
},
22+
{
23+
"package": "GCDWebServer",
24+
"repositoryURL": "https://github.com/nbhasin2/GCDWebServer.git",
25+
"state": {
26+
"branch": "master",
27+
"revision": "14f9eedb296c5b71fec971d8256ef3bfc20a2245",
28+
"version": null
29+
}
30+
},
31+
{
32+
"package": "Glean",
33+
"repositoryURL": "https://github.com/mozilla/glean-swift",
34+
"state": {
35+
"branch": null,
36+
"revision": "e8fef341610de380b55cd5a057f9a3adf7cebb44",
37+
"version": "43.0.2"
38+
}
39+
},
440
{
541
"package": "Adjust",
6-
"repositoryURL": "https://github.com/adjust/ios_sdk",
42+
"repositoryURL": "https://github.com/adjust/ios_sdk.git",
743
"state": {
844
"branch": null,
945
"revision": "43c5bb5eb8f77c72da856637dac5c46087c27848",
1046
"version": "4.29.6"
1147
}
48+
},
49+
{
50+
"package": "KIF",
51+
"repositoryURL": "https://github.com/kif-framework/KIF.git",
52+
"state": {
53+
"branch": null,
54+
"revision": "709adbc64f2d8d40d48136cdd56b0a706010904b",
55+
"version": "3.8.6"
56+
}
57+
},
58+
{
59+
"package": "MappaMundi",
60+
"repositoryURL": "https://github.com/nbhasin2/MappaMundi.git",
61+
"state": {
62+
"branch": "master",
63+
"revision": "7fcd2b7910550227088480490ac19ea66044b3d1",
64+
"version": null
65+
}
66+
},
67+
{
68+
"package": "MozillaRustComponentsSwift",
69+
"repositoryURL": "https://github.com/skhamis/rust-components-swift",
70+
"state": {
71+
"branch": "update-for-fxios",
72+
"revision": "1f1aba21157b0da730a5f3c7029bfca448cbec5e",
73+
"version": null
74+
}
75+
},
76+
{
77+
"package": "SDWebImage",
78+
"repositoryURL": "https://github.com/SDWebImage/SDWebImage.git",
79+
"state": {
80+
"branch": null,
81+
"revision": "7ef9a314b12c1a31edb0d09d41fcba93143fe772",
82+
"version": "5.4.0"
83+
}
84+
},
85+
{
86+
"package": "Sentry",
87+
"repositoryURL": "https://github.com/getsentry/sentry-cocoa.git",
88+
"state": {
89+
"branch": null,
90+
"revision": "bb3c1d852980432907cd314e4fa984fc9a78c9f3",
91+
"version": "4.4.3"
92+
}
93+
},
94+
{
95+
"package": "SnapKit",
96+
"repositoryURL": "https://github.com/SnapKit/SnapKit.git",
97+
"state": {
98+
"branch": null,
99+
"revision": "d458564516e5676af9c70b4f4b2a9178294f1bc6",
100+
"version": "5.0.1"
101+
}
102+
},
103+
{
104+
"package": "SwiftProtobuf",
105+
"repositoryURL": "https://github.com/apple/swift-protobuf.git",
106+
"state": {
107+
"branch": null,
108+
"revision": "7e2c5f3cbbeea68e004915e3a8961e20bd11d824",
109+
"version": "1.18.0"
110+
}
111+
},
112+
{
113+
"package": "SwiftyJSON",
114+
"repositoryURL": "https://github.com/SwiftyJSON/SwiftyJSON",
115+
"state": {
116+
"branch": null,
117+
"revision": "b3dcd7dbd0d488e1a7077cb33b00f2083e382f07",
118+
"version": "5.0.1"
119+
}
120+
},
121+
{
122+
"package": "Telemetry",
123+
"repositoryURL": "https://github.com/mozilla-mobile/telemetry-ios",
124+
"state": {
125+
"branch": null,
126+
"revision": "68f2d813320c9fda2fb4aee4548c64293500200a",
127+
"version": "2.0.0"
128+
}
129+
},
130+
{
131+
"package": "XCGLogger",
132+
"repositoryURL": "https://github.com/DaveWoodCom/XCGLogger.git",
133+
"state": {
134+
"branch": null,
135+
"revision": "a9c4667b247928a29bdd41be2ec2c8d304215a54",
136+
"version": "7.0.1"
137+
}
12138
}
13139
]
14140
},

Client.xcodeproj/xcshareddata/xcschemes/Firefox.xcscheme

+11-15
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,18 @@
2626
buildConfiguration = "Firefox"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES"
2930
language = "en"
30-
region = "US"
31-
shouldUseLaunchSchemeArgsEnv = "YES">
31+
region = "US">
32+
<MacroExpansion>
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "F84B21BD1A090F8100AAB793"
36+
BuildableName = "Client.app"
37+
BlueprintName = "Client"
38+
ReferencedContainer = "container:Client.xcodeproj">
39+
</BuildableReference>
40+
</MacroExpansion>
3241
<Testables>
3342
<TestableReference
3443
skipped = "NO">
@@ -134,17 +143,6 @@
134143
</SkippedTests>
135144
</TestableReference>
136145
</Testables>
137-
<MacroExpansion>
138-
<BuildableReference
139-
BuildableIdentifier = "primary"
140-
BlueprintIdentifier = "F84B21BD1A090F8100AAB793"
141-
BuildableName = "Client.app"
142-
BlueprintName = "Client"
143-
ReferencedContainer = "container:Client.xcodeproj">
144-
</BuildableReference>
145-
</MacroExpansion>
146-
<AdditionalOptions>
147-
</AdditionalOptions>
148146
</TestAction>
149147
<LaunchAction
150148
buildConfiguration = "Firefox"
@@ -173,8 +171,6 @@
173171
isEnabled = "YES">
174172
</EnvironmentVariable>
175173
</EnvironmentVariables>
176-
<AdditionalOptions>
177-
</AdditionalOptions>
178174
</LaunchAction>
179175
<ProfileAction
180176
buildConfiguration = "Firefox"

Client.xcodeproj/xcshareddata/xcschemes/FirefoxBeta.xcscheme

+12-16
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
6-
parallelizeBuildables = "NO"
6+
parallelizeBuildables = "YES"
77
buildImplicitDependencies = "YES">
88
<BuildActionEntries>
99
<BuildActionEntry
@@ -26,9 +26,18 @@
2626
buildConfiguration = "FirefoxBeta"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES"
2930
language = "en"
30-
region = "US"
31-
shouldUseLaunchSchemeArgsEnv = "YES">
31+
region = "US">
32+
<MacroExpansion>
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "F84B21BD1A090F8100AAB793"
36+
BuildableName = "Client.app"
37+
BlueprintName = "Client"
38+
ReferencedContainer = "container:Client.xcodeproj">
39+
</BuildableReference>
40+
</MacroExpansion>
3241
<Testables>
3342
<TestableReference
3443
skipped = "NO">
@@ -134,17 +143,6 @@
134143
</SkippedTests>
135144
</TestableReference>
136145
</Testables>
137-
<MacroExpansion>
138-
<BuildableReference
139-
BuildableIdentifier = "primary"
140-
BlueprintIdentifier = "F84B21BD1A090F8100AAB793"
141-
BuildableName = "Client.app"
142-
BlueprintName = "Client"
143-
ReferencedContainer = "container:Client.xcodeproj">
144-
</BuildableReference>
145-
</MacroExpansion>
146-
<AdditionalOptions>
147-
</AdditionalOptions>
148146
</TestAction>
149147
<LaunchAction
150148
buildConfiguration = "FirefoxBeta"
@@ -173,8 +171,6 @@
173171
isEnabled = "YES">
174172
</EnvironmentVariable>
175173
</EnvironmentVariables>
176-
<AdditionalOptions>
177-
</AdditionalOptions>
178174
</LaunchAction>
179175
<ProfileAction
180176
buildConfiguration = "FirefoxBeta"

Client/Application/AppDelegate+PushNotifications.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Sync
88
import XCGLogger
99
import UserNotifications
1010
import Account
11-
import SwiftKeychainWrapper
11+
import FxAClient
1212

1313
private let log = Logger.browserLogger
1414

@@ -52,7 +52,7 @@ extension AppDelegate {
5252
NotificationCenter.default.addObserver(forName: .constellationStateUpdate, object: nil, queue: nil) { notification in
5353
if let newState = notification.userInfo?["newState"] as? ConstellationState {
5454
if newState.localDevice?.pushEndpointExpired ?? false {
55-
KeychainWrapper.sharedAppContainerKeychain.removeObject(forKey: KeychainKey.apnsToken, withAccessibility: .afterFirstUnlock)
55+
MZKeychainWrapper.sharedClientAppContainerKeychain.removeObject(forKey: KeychainKey.apnsToken, withAccessibility: MZKeychainItemAccessibility.afterFirstUnlock)
5656
NotificationCenter.default.post(name: .RegisterForPushNotifications, object: nil)
5757
}
5858
}
@@ -61,8 +61,8 @@ extension AppDelegate {
6161
// Use sync event as a periodic check for the apnsToken.
6262
// The notification service extension can clear this token if there is an error, and the main app can detect this and re-register.
6363
NotificationCenter.default.addObserver(forName: .ProfileDidStartSyncing, object: nil, queue: .main) { _ in
64-
let kc = KeychainWrapper.sharedAppContainerKeychain
65-
if kc.object(forKey: KeychainKey.apnsToken, withAccessibility: .afterFirstUnlock) == nil {
64+
let kc = MZKeychainWrapper.sharedClientAppContainerKeychain
65+
if kc.object(forKey: KeychainKey.apnsToken, withAccessibility: MZKeychainItemAccessibility.afterFirstUnlock) == nil {
6666
NotificationCenter.default.post(name: .RegisterForPushNotifications, object: nil)
6767
}
6868
}

Client/Application/AppDelegate.swift

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import AVFoundation
88
import XCGLogger
99
import MessageUI
1010
import SDWebImage
11-
import SwiftKeychainWrapper
1211
import SyncTelemetry
1312
import LocalAuthentication
1413
import SyncTelemetry

Client/Application/NavigationRouter.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import Foundation
66
import Shared
7-
import MozillaAppServices
7+
import Glean
88

99
struct FxALaunchParams {
1010
var query: [String: String]

Client/Configuration/Common.xcconfig

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ DEVELOPMENT_TEAM = 43AQ936H96
1212
ENABLE_BITCODE = NO
1313
ENABLE_TESTABILITY = YES;
1414
ENABLE_STRICT_OBJC_MSGSEND = YES;
15-
FRAMEWORK_SEARCH_PATHS = $(PROJECT_DIR)/Carthage/Build/iOS
1615
GCC_DYNAMIC_NO_PIC = NO;
1716
HEADER_SEARCH_PATHS = $(inherited) /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include $(SRCROOT) $(SDKROOT)/usr/include/libxml2
1817
INCLUDE_SETTINGS_BUNDLE = NO

Client/Experiments/Experiments.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// file, You can obtain one at http://mozilla.org/MPL/2.0
44

55
import Foundation
6-
import MozillaAppServices
6+
import Nimbus
77
import Shared
88
import XCGLogger
99

0 commit comments

Comments
 (0)