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

build(tools): use xcode 15 #9323

Merged
merged 16 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
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
19 changes: 9 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ orbs:
node: circleci/[email protected]
queue: eddiewebb/[email protected]
horizon: artsy/[email protected]
ruby: circleci/ruby@2.1.0
macos: circleci/macos@2.4.0

commands:
await-previous-builds:
Expand Down Expand Up @@ -70,10 +70,6 @@ commands:
- run:
name: Compile query map
command: yarn relay
install-ruby:
steps:
- ruby/install:
version: "2.7"
install-gems:
steps:
- restore_cache:
Expand Down Expand Up @@ -147,7 +143,6 @@ commands:
- install-node-modules
- run-relay-compiler
- update-echo
- install-ruby
- install-gems
build-app-android:
steps:
Expand Down Expand Up @@ -182,7 +177,7 @@ jobs:
BUNDLE_PATH: .vendor # path to install gems and use for caching

macos:
xcode: 14.1.0
xcode: 15.0.0
resource_class: macos.x86.medium.gen2

steps:
Expand Down Expand Up @@ -262,7 +257,7 @@ jobs:
BUNDLE_PATH: .vendor # path to install gems and use for caching

macos:
xcode: 14.1.0
xcode: 15.0.0
resource_class: macos.x86.medium.gen2

steps:
Expand Down Expand Up @@ -312,7 +307,7 @@ jobs:
BUNDLE_PATH: .vendor # path to install gems and use for caching

macos:
xcode: 14.1.0
xcode: 15.0.0
resource_class: macos.x86.medium.gen2

steps:
Expand Down Expand Up @@ -352,6 +347,10 @@ jobs:
- update-echo
- install-gems
- install-cocoapods
- macos/preboot-simulator:
version: "17.0"
platform: "iOS"
device: "iPhone 15 Pro"
- build-app-ios
- run:
name: Run tests if native code has changed
Expand Down Expand Up @@ -405,7 +404,7 @@ jobs:
environment:
BUNDLE_PATH: .vendor # path to install gems and use for caching
macos:
xcode: 14.1.0
xcode: 15.0.0
resource_class: macos.x86.medium.gen2
steps:
- checkout
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.4
3.1.4
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
nodejs 16.18.0
ruby 2.7.4
ruby 3.1.4
java zulu-11.58.15
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ gem 'cocoapods', '>= 1.11.3'

# So we know if we need to run `pod install`
gem 'cocoapods-check'
gem 'cocoapods-patch'
gem 'down'
gem 'dotenv'
gem 'json'
Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ GEM
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (1.6.3)
cocoapods-patch (1.2.0)
cocoapods (~> 1.12.0)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.1)
Expand Down Expand Up @@ -304,6 +306,7 @@ PLATFORMS
DEPENDENCIES
cocoapods (>= 1.11.3)
cocoapods-check
cocoapods-patch
dotenv
down
fastlane
Expand Down
14 changes: 13 additions & 1 deletion HACKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ See what can be converted: https://github.com/facebook/react-native/blob/main/Re

PropsStore allows us to temporarily hold on the props and reinject them back into the destination view or module.

# `ORStackView` pod postinstall modification (add UIKit import)
# `ORStackView` patch (add UIKit import)

#### When can we remove this:

Expand Down Expand Up @@ -379,3 +379,15 @@ When this issue is fixed: https://github.com/microsoft/react-native-code-push/is
#### Explanation/Context:

Release builds fail on Android without this patch, more explanation in the issue: https://github.com/microsoft/react-native-code-push/issues/1578

# Pod patch for NimbleSnapshots type failure

#### When can we remove this:

When this PR is release in a new pod version: https://github.com/ashfurrow/Nimble-Snapshots/pull/268
And we update to the new version.

#### Explanation/Context:

Test compilations started failing in Xcode 15 due to a type conflict:
https://github.com/ashfurrow/Nimble-Snapshots/pull/268
4 changes: 2 additions & 2 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ asdf plugin add java

### Set up iOS

Download Xcode version 14. You can find all available versions of Xcode at [Apple's Developer Portal 🔐](http://developer.apple.com/download/more/).
Download Xcode version 15. You can find all available versions of Xcode at [Apple's Developer Portal 🔐](http://developer.apple.com/download/more/).

Ask your mentor to add you on the [firebase.console](https://console.firebase.google.com/project/eigen-a7d3b/settings/iam) to be able to release.

<details><summary>NOTE: After installing Xcode</summary>

Check that Command Line Tools version is added in the Locations tab. Xcode>Settings>Locations:
<img width="375" alt="" src="https://user-images.githubusercontent.com/29984068/123970729-6009cf00-d987-11eb-933a-1603ba4d6ae8.png">
![command-line-tools](./screenshots/command-line-tools.png)

</details>

Expand Down
Binary file added docs/screenshots/command-line-tools.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ...enceImages/ARTextViewSpec/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ...onInformationViewControllerTests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions ios/ArtsyTests/Supporting_Files/ARTestHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ - (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:
{
NSOperatingSystemVersion version = [NSProcessInfo processInfo].operatingSystemVersion;

NSAssert(version.majorVersion == 16 && version.minorVersion == 1,
@"The tests should be run on iOS 16.1, not %ld.%ld", version.majorVersion, version.minorVersion);
NSAssert(version.majorVersion == 17 && version.minorVersion == 0,
@"The tests should be run on iOS 17.0, not %ld.%ld", version.majorVersion, version.minorVersion);

CGSize nativeResolution = [UIScreen mainScreen].nativeBounds.size;
NSAssert([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone && CGSizeEqualToSize(nativeResolution, CGSizeMake(1179, 2556)),
@"The tests should be run on an iPhone 14 Pro, not a device with native resolution %@",
@"The tests should be run on an iPhone 15 Pro, not a device with native resolution %@",
NSStringFromCGSize(nativeResolution));

ARPerformWorkAsynchronously = NO;
Expand Down
31 changes: 2 additions & 29 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ inhibit_all_warnings! # ignore all warnings from all pods

$ReactNativeMapboxGLIOSVersion = '~> 6.4'

plugin 'cocoapods-patch'
brainbicycle marked this conversation as resolved.
Show resolved Hide resolved


def check_for_existing_netrc_file
mapbox_token = ENV['MAPBOX_DOWNLOAD_TOKEN']
Expand Down Expand Up @@ -177,34 +179,5 @@ target 'Artsy' do
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end

# TODO:
# * ORStackView: Move Laura's changes into master and update
# * Send PRs for the rest
%w[
Pods/ORStackView/Classes/ios/ORStackView.h
].flat_map { |x| Dir.glob(x) }.each do |header|
system("chmod +w #{header}")
addition = "#import <UIKit/UIKit.h>\n"
contents = File.read(header)
next if contents.include?(addition)

File.open(header, 'w') do |file|
file.puts addition
file.puts contents
end
end

# TODO: Might be nice to have a `cocoapods-patch` plugin that applies patches like `patch-package` does for npm.
%w[
Pods/Nimble/Sources/NimbleObjectiveC
Pods/Nimble-Snapshots
Pods/Quick/Sources/QuickObjectiveC
].flat_map { |x| Dir.glob(File.join(x, '**/*.{h,m}')) }.each do |header|
system("chmod +w #{header}")
contents = File.read(header)
patched = contents.sub(%r{["<]\w+/(\w+-Swift\.h)[">]}, '"\1"')
File.write(header, patched) if Regexp.last_match
end
end
end
2 changes: 1 addition & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1363,6 +1363,6 @@ SPEC CHECKSUMS:
Yoga: 445485143df46a9d5d4ef61cbbc629fec40fb9a0
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: fd10647b9bddf6b4d8b71fdd4b408b236f232aeb
PODFILE CHECKSUM: 8baafb37ff1a99947d2acc6cdef33c49c6d3bf96

COCOAPODS: 1.12.1
151 changes: 151 additions & 0 deletions ios/patches/Nimble-Snapshots+6.3.0.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
diff --git a/cocoapods-patch-20230922-45773-1fk3wiq/Nimble-Snapshots/DynamicSize/DynamicSizeSnapshot.swift b/Pods/Nimble-Snapshots/DynamicSize/DynamicSizeSnapshot.swift
index bb10258e1f..9363f2026d 100644
--- a/cocoapods-patch-20230922-45773-1fk3wiq/Nimble-Snapshots/DynamicSize/DynamicSizeSnapshot.swift
+++ b/Pods/Nimble-Snapshots/DynamicSize/DynamicSizeSnapshot.swift
@@ -138,8 +138,8 @@ public func snapshot(_ name: String? = nil, sizes: [String: CGSize],
public func haveValidDynamicSizeSnapshot(named name: String? = nil, sizes: [String: CGSize],
isDeviceAgnostic: Bool = false, usesDrawRect: Bool = false,
tolerance: CGFloat? = nil,
- resizeMode: ResizeMode = .frame) -> Predicate<Snapshotable> {
- return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
+ resizeMode: ResizeMode = .frame) -> Nimble.Predicate<Snapshotable> {
+ return Nimble.Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
return performDynamicSizeSnapshotTest(name, sizes: sizes, isDeviceAgnostic: isDeviceAgnostic,
usesDrawRect: usesDrawRect, actualExpression: actualExpression,
failureMessage: failureMessage, tolerance: tolerance,
@@ -200,8 +200,8 @@ public func recordSnapshot(_ name: String? = nil, sizes: [String: CGSize],

public func recordDynamicSizeSnapshot(named name: String? = nil, sizes: [String: CGSize],
isDeviceAgnostic: Bool = false, usesDrawRect: Bool = false,
- resizeMode: ResizeMode = .frame) -> Predicate<Snapshotable> {
- return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
+ resizeMode: ResizeMode = .frame) -> Nimble.Predicate<Snapshotable> {
+ return Nimble.Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
return performDynamicSizeSnapshotTest(name, sizes: sizes, isDeviceAgnostic: isDeviceAgnostic,
usesDrawRect: usesDrawRect, actualExpression: actualExpression,
failureMessage: failureMessage, isRecord: true, resizeMode: resizeMode)
diff --git a/cocoapods-patch-20230922-45773-1fk3wiq/Nimble-Snapshots/DynamicType/HaveValidDynamicTypeSnapshot.swift b/Pods/Nimble-Snapshots/DynamicType/HaveValidDynamicTypeSnapshot.swift
index 5ffcb4ff5d..9b44909b87 100644
--- a/cocoapods-patch-20230922-45773-1fk3wiq/Nimble-Snapshots/DynamicType/HaveValidDynamicTypeSnapshot.swift
+++ b/Pods/Nimble-Snapshots/DynamicType/HaveValidDynamicTypeSnapshot.swift
@@ -15,9 +15,9 @@ func shortCategoryName(_ category: UIContentSizeCategory) -> String {
return category.rawValue.replacingOccurrences(of: "UICTContentSizeCategory", with: "")
}

-func combinePredicates<T>(_ predicates: [Predicate<T>], ignoreFailures: Bool = false,
- deferred: (() -> Void)? = nil) -> Predicate<T> {
- return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
+func combinePredicates<T>(_ predicates: [Nimble.Predicate<T>], ignoreFailures: Bool = false,
+ deferred: (() -> Void)? = nil) -> Nimble.Predicate<T> {
+ return Nimble.Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
defer {
deferred?()
}
@@ -36,18 +36,18 @@ func combinePredicates<T>(_ predicates: [Predicate<T>], ignoreFailures: Bool = f
public func haveValidDynamicTypeSnapshot(named name: String? = nil, usesDrawRect: Bool = false,
tolerance: CGFloat? = nil,
sizes: [UIContentSizeCategory] = allContentSizeCategories(),
- isDeviceAgnostic: Bool = false) -> Predicate<Snapshotable> {
+ isDeviceAgnostic: Bool = false) -> Nimble.Predicate<Snapshotable> {
let mock = NBSMockedApplication()

- let predicates: [Predicate<Snapshotable>] = sizes.map { category in
+ let predicates: [Nimble.Predicate<Snapshotable>] = sizes.map { category in
let sanitizedName = sanitizedTestName(name)
let nameWithCategory = "\(sanitizedName)_\(shortCategoryName(category))"

- return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
+ return Nimble.Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
mock.mockPreferredContentSizeCategory(category)
updateTraitCollection(on: actualExpression)

- let predicate: Predicate<Snapshotable>
+ let predicate: Nimble.Predicate<Snapshotable>
if isDeviceAgnostic {
predicate = haveValidDeviceAgnosticSnapshot(named: nameWithCategory,
usesDrawRect: usesDrawRect, tolerance: tolerance)
@@ -66,18 +66,18 @@ public func haveValidDynamicTypeSnapshot(named name: String? = nil, usesDrawRect

public func recordDynamicTypeSnapshot(named name: String? = nil, usesDrawRect: Bool = false,
sizes: [UIContentSizeCategory] = allContentSizeCategories(),
- isDeviceAgnostic: Bool = false) -> Predicate<Snapshotable> {
+ isDeviceAgnostic: Bool = false) -> Nimble.Predicate<Snapshotable> {
let mock = NBSMockedApplication()

- let predicates: [Predicate<Snapshotable>] = sizes.map { category in
+ let predicates: [Nimble.Predicate<Snapshotable>] = sizes.map { category in
let sanitizedName = sanitizedTestName(name)
let nameWithCategory = "\(sanitizedName)_\(shortCategoryName(category))"

- return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
+ return Nimble.Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
mock.mockPreferredContentSizeCategory(category)
updateTraitCollection(on: actualExpression)

- let predicate: Predicate<Snapshotable>
+ let predicate: Nimble.Predicate<Snapshotable>
if isDeviceAgnostic {
predicate = recordDeviceAgnosticSnapshot(named: nameWithCategory, usesDrawRect: usesDrawRect)
} else {
diff --git a/cocoapods-patch-20230922-45773-1fk3wiq/Nimble-Snapshots/HaveValidSnapshot.swift b/Pods/Nimble-Snapshots/HaveValidSnapshot.swift
index 6671305017..d5f66aed56 100644
--- a/cocoapods-patch-20230922-45773-1fk3wiq/Nimble-Snapshots/HaveValidSnapshot.swift
+++ b/Pods/Nimble-Snapshots/HaveValidSnapshot.swift
@@ -193,9 +193,9 @@ private func currentTestName() -> String? {
internal var switchChecksWithRecords = false

public func haveValidSnapshot(named name: String? = nil, usesDrawRect: Bool = false,
- tolerance: CGFloat? = nil) -> Predicate<Snapshotable> {
+ tolerance: CGFloat? = nil) -> Nimble.Predicate<Snapshotable> {

- return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
+ return Nimble.Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
if switchChecksWithRecords {
return recordSnapshot(name, usesDrawRect: usesDrawRect, actualExpression: actualExpression,
failureMessage: failureMessage)
@@ -207,9 +207,9 @@ public func haveValidSnapshot(named name: String? = nil, usesDrawRect: Bool = fa
}

public func haveValidDeviceAgnosticSnapshot(named name: String? = nil, usesDrawRect: Bool = false,
- tolerance: CGFloat? = nil) -> Predicate<Snapshotable> {
+ tolerance: CGFloat? = nil) -> Nimble.Predicate<Snapshotable> {

- return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
+ return Nimble.Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
if switchChecksWithRecords {
return recordSnapshot(name, isDeviceAgnostic: true, usesDrawRect: usesDrawRect,
actualExpression: actualExpression, failureMessage: failureMessage)
@@ -221,18 +221,18 @@ public func haveValidDeviceAgnosticSnapshot(named name: String? = nil, usesDrawR
}
}

-public func recordSnapshot(named name: String? = nil, usesDrawRect: Bool = false) -> Predicate<Snapshotable> {
+public func recordSnapshot(named name: String? = nil, usesDrawRect: Bool = false) -> Nimble.Predicate<Snapshotable> {

- return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
+ return Nimble.Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
return recordSnapshot(name, usesDrawRect: usesDrawRect,
actualExpression: actualExpression, failureMessage: failureMessage)
}
}

public func recordDeviceAgnosticSnapshot(named name: String? = nil,
- usesDrawRect: Bool = false) -> Predicate<Snapshotable> {
+ usesDrawRect: Bool = false) -> Nimble.Predicate<Snapshotable> {

- return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
+ return Nimble.Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
return recordSnapshot(name, isDeviceAgnostic: true, usesDrawRect: usesDrawRect,
actualExpression: actualExpression, failureMessage: failureMessage)
}
diff --git a/cocoapods-patch-20230922-45773-1fk3wiq/Nimble-Snapshots/XCTestObservationCenter+CurrentTestCaseTracker.m b/Pods/Nimble-Snapshots/XCTestObservationCenter+CurrentTestCaseTracker.m
index 4a4e2ccc33..adbb9df57d 100644
--- a/cocoapods-patch-20230922-45773-1fk3wiq/Nimble-Snapshots/XCTestObservationCenter+CurrentTestCaseTracker.m
+++ b/Pods/Nimble-Snapshots/XCTestObservationCenter+CurrentTestCaseTracker.m
@@ -1,5 +1,5 @@
#import "XCTestObservationCenter+CurrentTestCaseTracker.h"
-#import "Nimble_Snapshots/Nimble_Snapshots-Swift.h"
+#import "Nimble_Snapshots-Swift.h"

@implementation XCTestObservationCenter (CurrentTestCaseTracker)

Loading