Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Xcode 15.1 #2247

Merged
merged 36 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
caeaa42
Update xcode version to 15
jaceklyp Sep 25, 2023
d4393db
Fix version number
jaceklyp Sep 25, 2023
0ab0b16
Change simulator version
jaceklyp Sep 25, 2023
65a796c
Merge branch 'develop' into jacek/xcode15
jaceklyp Oct 2, 2023
ca41d3c
Update resolved
jaceklyp Oct 3, 2023
c8beaeb
Remove tests that fail because URL initialization now escapes spaces
jaceklyp Oct 3, 2023
74c6059
Increase timeouts to make tests pass
jaceklyp Oct 3, 2023
0b50210
Try using Sonoma image runner
jaceklyp Oct 4, 2023
8962f3d
Try using latest runner
jaceklyp Oct 4, 2023
cb8d28d
Back to macos 13
jaceklyp Oct 4, 2023
e5c62a1
Use M1 runner
jaceklyp Oct 5, 2023
ecbc143
Fix multiple warnings
jaceklyp Oct 5, 2023
e179c1e
Silence Ignoring duplicate libraries -lc++ warnings
jaceklyp Oct 5, 2023
2a4cf00
Revert the unarchiver change
jaceklyp Oct 5, 2023
69be459
Remove unneeded swiftlint corrections
jaceklyp Oct 5, 2023
31408a3
Merge branch 'develop' into jacek/xcode15
jaceklyp Oct 5, 2023
bf9f4d5
Merge branch 'develop' into jacek/xcode15
samsymons Oct 27, 2023
5e8843b
Update Xcode version to 15.0.1.
samsymons Oct 27, 2023
ba92ef2
Merge branch 'develop' into jacek/xcode15
samsymons Nov 5, 2023
73e4494
Allow automatic provisioning on CI.
samsymons Nov 5, 2023
05f9efe
Remove automatic provisioning.
samsymons Nov 5, 2023
df276c9
Disable codesigning for test runs.
samsymons Nov 5, 2023
440dd9f
Undo the CODE_SIGNING_ALLOWED change.
samsymons Nov 5, 2023
b0da844
Merge branch 'develop' into jacek/xcode15
samsymons Nov 16, 2023
713c955
Try using more generic certificates.
samsymons Nov 17, 2023
5aaf30d
Revert "Try using more generic certificates."
samsymons Nov 17, 2023
10ef86e
Merge branch 'develop' into jacek/xcode15
samsymons Dec 5, 2023
7a8f19e
Merge branch 'main' into jacek/xcode15
samsymons Dec 7, 2023
a1a1036
Use 17.0.1 simulators.
samsymons Dec 8, 2023
c23d095
Upgrade to Xcode 15.1.
samsymons Dec 15, 2023
6a812a2
Merge branch 'main' into jacek/xcode15
samsymons Dec 21, 2023
251b470
Merge branch 'main' into jacek/xcode15
samsymons Dec 22, 2023
e168bc9
Merge branch 'main' into jacek/xcode15
samsymons Dec 24, 2023
f761958
Merge branch 'main' into jacek/xcode15
samsymons Dec 25, 2023
51a48fe
Merge branch 'main' into jacek/xcode15
samsymons Jan 8, 2024
84e9343
Fix alpha Xcode version format.
samsymons Jan 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:

# Using Xcode 15 as the alpha build uses iOS 17 APIs
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_15.0.1.app/Contents/Developer
run: sudo xcode-select -s /Applications/Xcode_$(<.xcode-version).app/Contents/Developer

- name: Prepare fastlane
run: bundle install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
run: |
set -o pipefail && xcodebuild test \
-scheme "DuckDuckGo" \
-destination "platform=iOS Simulator,name=iPhone 14,OS=16.4" \
-destination "platform=iOS Simulator,name=iPhone 15,OS=17.2" \
-derivedDataPath "DerivedData" \
-skipPackagePluginValidation \
DDG_SLOW_COMPILE_CHECK_THRESHOLD=250 \
Expand Down
2 changes: 1 addition & 1 deletion .xcode-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.3.1
15.1
4 changes: 2 additions & 2 deletions Core/BookmarksCachingSearch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ public class CoreDataBookmarksSearchStore: BookmarksSearchStore {
fetchRequest.relationshipKeyPathsForPrefetching = [#keyPath(BookmarkEntity.favoriteFolders)]

context.perform {
let result = try? context.fetch(fetchRequest) as? [Dictionary<String, Any>]
let result = try? context.fetch(fetchRequest) as? [[String: Any]]

let bookmarksAndFavorites = result?.compactMap(BookmarksCachingSearch.ScoredBookmark.init) ?? []

DispatchQueue.main.async {
Expand Down
5 changes: 4 additions & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -5661,7 +5661,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1420;
LastUpgradeCheck = 1250;
LastUpgradeCheck = 1500;
ORGANIZATIONNAME = DuckDuckGo;
TargetAttributes = {
02025661298818B100E694E7 = {
Expand Down Expand Up @@ -8121,6 +8121,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "-ld_classic";
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG APP_TRACKING_PROTECTION NETWORK_PROTECTION";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
Expand Down Expand Up @@ -8176,6 +8177,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_LDFLAGS = "-ld_classic";
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = NETWORK_PROTECTION;
SWIFT_COMPILATION_MODE = wholemodule;
Expand Down Expand Up @@ -8651,6 +8653,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "-ld_classic";
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG NETWORK_PROTECTION ALPHA";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
LastUpgradeVersion = "1500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
LastUpgradeVersion = "1500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo.xcodeproj/xcshareddata/xcschemes/Core.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
LastUpgradeVersion = "1500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1500"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
version = "1.7">
LastUpgradeVersion = "1500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
LastUpgradeVersion = "1500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
LastUpgradeVersion = "1500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
LastUpgradeVersion = "1500"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
Expand Down Expand Up @@ -94,6 +94,7 @@
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
askForAppToLaunch = "Yes"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1420"
LastUpgradeVersion = "1500"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1410"
LastUpgradeVersion = "1500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
LastUpgradeVersion = "1500"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
Expand Down Expand Up @@ -103,6 +103,7 @@
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
askForAppToLaunch = "Yes"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
LastUpgradeVersion = "1500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1320"
LastUpgradeVersion = "1500"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
Expand Down
24 changes: 14 additions & 10 deletions DuckDuckGo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -481,10 +481,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}

private func onApplicationLaunch(_ application: UIApplication) {
beginAuthentication()
initialiseBackgroundFetch(application)
applyAppearanceChanges()
refreshRemoteMessages()
Task { @MainActor in
await beginAuthentication()
initialiseBackgroundFetch(application)
applyAppearanceChanges()
refreshRemoteMessages()
}
}

private func applyAppearanceChanges() {
Expand All @@ -503,10 +505,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func applicationWillEnterForeground(_ application: UIApplication) {
ThemeManager.shared.updateUserInterfaceStyle()

beginAuthentication()
autoClear?.applicationWillMoveToForeground()
showKeyboardIfSettingOn = true
syncService.scheduler.resumeSyncQueue()
Task { @MainActor in
await beginAuthentication()
autoClear?.applicationWillMoveToForeground()
showKeyboardIfSettingOn = true
syncService.scheduler.resumeSyncQueue()
}
}

func applicationDidEnterBackground(_ application: UIApplication) {
Expand Down Expand Up @@ -634,7 +638,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
window?.isHidden = true
}

private func beginAuthentication() {
private func beginAuthentication() async {

guard privacyStore.authenticationEnabled else { return }

Expand All @@ -646,7 +650,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
return
}

controller.beginAuthentication { [weak self] in
await controller.beginAuthentication { [weak self] in
self?.removeOverlay()
self?.showKeyboardOnLaunch()
}
Expand Down
21 changes: 11 additions & 10 deletions DuckDuckGo/AuthenticationViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,28 +50,29 @@ class AuthenticationViewController: UIViewController {
return .portrait
}

public func beginAuthentication(completion: (() -> Void)?) {
public func beginAuthentication(completion: (() -> Void)?) async {
self.completion = completion
if authenticator.canAuthenticate() {
authenticate()
await authenticate()
} else {
onCouldNotAuthenticate()
}
}

private func authenticate() {
private func authenticate() async {
hideUnlockInstructions()
authenticator.authenticate { (success, _) in
if success {
self.onAuthenticationSucceeded()
} else {
self.onAuthenticationFailed()
}
let success = await authenticator.authenticate(reason: UserText.appUnlock)
if success {
self.onAuthenticationSucceeded()
} else {
self.onAuthenticationFailed()
}
}

@IBAction func onTap(_ sender: Any) {
authenticate()
Task { @MainActor in
await authenticate()
}
}

private func onCouldNotAuthenticate() {
Expand Down
4 changes: 1 addition & 3 deletions DuckDuckGo/AutofillLoginSettingsListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,7 @@ final class AutofillLoginSettingsListViewController: UIViewController {
private func updateConstraintConstants() {
let isIPhoneLandscape = traitCollection.containsTraits(in: UITraitCollection(verticalSizeClass: .compact))
if isIPhoneLandscape {
let viewVerticalCenter = view.frame.height / 2
let lockedViewHeight = max(lockedView.frame.height, 120.0)
lockedViewBottomConstraint.constant = viewVerticalCenter - (lockedViewHeight / 2.0)
lockedViewBottomConstraint.constant = (view.frame.height / 2.0 - max(lockedView.frame.height, 120.0) / 2.0)
} else {
lockedViewBottomConstraint.constant = view.frame.height * 0.15
}
Expand Down
4 changes: 2 additions & 2 deletions DuckDuckGo/FirewallManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ public class FirewallManager: FirewallManaging {
public static let apptpLog: OSLog = OSLog(subsystem: Bundle.main.bundleIdentifier ?? AppVersion.shared.identifier, category: "AppTP")

var manager: NETunnelProviderManager?
public var delegate: FirewallDelegate?
public weak var delegate: FirewallDelegate?

public init() {
NotificationCenter.default.addObserver(self, selector: #selector(statusDidChange),
name: .NEVPNStatusDidChange, object: nil)
Expand Down
24 changes: 7 additions & 17 deletions DuckDuckGoTests/ContentBlockingUpdatingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import TrackerRadarKit
import BrowserServicesKit
@testable import DuckDuckGo

class ContentBlockingUpdatingTests: XCTestCase {
final class ContentBlockingUpdatingTests: XCTestCase {
let appSettings = AppSettingsMock()
let configManager = PrivacyConfigurationManagerMock()
let rulesManager = ContentBlockerRulesManagerMock()
Expand Down Expand Up @@ -278,8 +278,7 @@ class ContentBlockingUpdatingTests: XCTestCase {

static let tracker = KnownTracker(domain: "tracker.com",
defaultAction: .block,
owner: KnownTracker.Owner(name: "Tracker Inc",
displayName: "Tracker Inc company"),
owner: KnownTracker.Owner(name: "Tracker Inc", displayName: "Tracker Inc company"),
prevalence: 0.1,
subdomains: nil,
categories: nil,
Expand Down Expand Up @@ -313,24 +312,16 @@ class ContentBlockingUpdatingTests: XCTestCase {
}

extension UserContentControllerNewContent {
func rules(withName name: String) -> WKContentRuleList? {
rulesUpdate.rules.first(where: { $0.name == name })?.rulesList
}
func rules(withName name: String) -> WKContentRuleList? { rulesUpdate.rules.first(where: { $0.name == name })?.rulesList }

var isValid: Bool {
return rules(withName: "test") != nil
}
var isValid: Bool { rules(withName: "test") != nil }
}

extension WKContentRuleList {

private static var isSwizzled = false
private static let originalDealloc = {
class_getInstanceMethod(WKContentRuleList.self, NSSelectorFromString("dealloc"))!
}()
private static let swizzledDealloc = {
class_getInstanceMethod(WKContentRuleList.self, #selector(swizzled_dealloc))!
}()
private static let originalDealloc = { class_getInstanceMethod(WKContentRuleList.self, NSSelectorFromString("dealloc"))! }()
private static let swizzledDealloc = { class_getInstanceMethod(WKContentRuleList.self, #selector(swizzled_dealloc))! }()

static func swizzleDealloc() {
guard !self.isSwizzled else { return }
Expand All @@ -345,7 +336,6 @@ extension WKContentRuleList {
}

@objc
func swizzled_dealloc() {
}
func swizzled_dealloc() { }

}
7 changes: 3 additions & 4 deletions DuckDuckGoTests/DaxDialogTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,8 @@ final class DaxDialog: XCTestCase {

private func makePrivacyInfo(url: URL) -> PrivacyInfo {
let protectionStatus = ProtectionStatus(unprotectedTemporary: false, enabledFeatures: [], allowlisted: false, denylisted: false)
let privacyInfo = PrivacyInfo(url: url,
parentEntity: entityProvider.entity(forHost: url.host!),
protectionStatus: protectionStatus)
return privacyInfo
return PrivacyInfo(url: url,
parentEntity: entityProvider.entity(forHost: url.host!),
protectionStatus: protectionStatus)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,6 @@ final class NetworkProtectionStatusViewModelTests: XCTestCase {
condition()
}
let expectation = XCTNSPredicateExpectation(predicate: predicate, object: nil)
wait(for: [expectation], timeout: 5)
wait(for: [expectation], timeout: 20)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that the simulator issue has been fixed, we can consider reverting these timeout changes. Hopefully they'll no longer be necessary.

}
}
Loading
Loading