Skip to content

Commit

Permalink
Merge pull request #7062 from woocommerce/xcode-14
Browse files Browse the repository at this point in the history
Upgrade to support Xcode 14.0
  • Loading branch information
crazytonyli authored Sep 15, 2022
2 parents 83036c1 + 21de10c commit c457ff0
Show file tree
Hide file tree
Showing 18 changed files with 64 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ common_params:
repo: "woocommerce/woocommerce-ios/"
# Common environment values to use with the `env` key.
- &common_env
IMAGE_ID: xcode-13.4.1
IMAGE_ID: xcode-14

# This is the default pipeline – it will build and test the app
steps:
Expand Down Expand Up @@ -68,7 +68,7 @@ steps:
# UI Tests
#################
- label: "🔬 UI Tests (iPhone)"
command: .buildkite/commands/run-ui-tests.sh UITests 'iPhone 11'
command: .buildkite/commands/run-ui-tests.sh UITests 'iPhone 14'
depends_on: "build"
env: *common_env
plugins: *common_plugins
Expand Down
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ GEM
sawyer (>= 0.6)
chroma (0.2.0)
claide (1.0.3)
cocoapods (1.11.2)
cocoapods (1.11.3)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.11.2)
cocoapods-core (= 1.11.3)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 1.4.0, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
Expand All @@ -59,7 +59,7 @@ GEM
cocoapods-catalyst-support (0.1.3)
cocoapods (~> 1.9)
colored2 (~> 3.1)
cocoapods-core (1.11.2)
cocoapods-core (1.11.3)
activesupport (>= 5.0, < 7)
addressable (~> 2.8)
algoliasearch (~> 1.0)
Expand All @@ -70,7 +70,7 @@ GEM
public_suffix (~> 4.0)
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (1.5.1)
cocoapods-downloader (1.6.3)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.1)
Expand Down Expand Up @@ -181,7 +181,7 @@ GEM
progress_bar (~> 1.3)
rake (>= 12.3, < 14.0)
rake-compiler (~> 1.0)
ffi (1.15.4)
ffi (1.15.5)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
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 = "1210"
LastUpgradeVersion = "1400"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
9 changes: 9 additions & 0 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -360,5 +360,14 @@ post_install do |installer|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', 'ALPHA=1']
end
end

# Fix a code signing issue in Xcode 14 beta.
# This solution is suggested here: https://github.com/CocoaPods/CocoaPods/issues/11402#issuecomment-1189861270
# ====================================
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['CODE_SIGN_IDENTITY'] = ''
end
end
# rubocop:enable Style/CombinableLoops
end
4 changes: 2 additions & 2 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,6 @@ SPEC CHECKSUMS:
ZendeskSupportProvidersSDK: 2bdf8544f7cd0fd4c002546f5704b813845beb2a
ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba

PODFILE CHECKSUM: 0b413ca49ed0793630b6cffce7d1dabbaf0d2886
PODFILE CHECKSUM: 3e746ecbe69d5cf22e0377beba8d803003558dd6

COCOAPODS: 1.11.2
COCOAPODS: 1.11.3
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1210"
LastUpgradeVersion = "1400"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,25 @@ final class HubMenuViewController: UIHostingController<HubMenu> {
func showPaymentsMenu() {
show(InPersonPaymentsMenuViewController(), sender: self)
}

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)

// We want to hide navigation bar *only* on HubMenu screen. But on iOS 16, the `navigationBarHidden(true)`
// modifier on `HubMenu` view hides the navigation bar for the whole navigation stack.
// Here we manually hide or show navigation bar when entering or leaving the HubMenu screen.
if #available(iOS 16.0, *) {
self.navigationController?.setNavigationBarHidden(true, animated: animated)
}
}

override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)

if #available(iOS 16.0, *) {
self.navigationController?.setNavigationBarHidden(false, animated: animated)
}
}
}

private extension HubMenuViewController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ struct ShippingLineDetails: View {
symbol: nil,
keyboardType: .default)
.accessibilityIdentifier("add-shipping-name-field")
.onTapGesture {
focusAmountInput = false
}
}
.padding(.horizontal, insets: safeAreaInsets)
.addingTopAndBottomDividers()
Expand Down
12 changes: 6 additions & 6 deletions WooCommerce/WooCommerce.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@
3F1FA84928B60126009E246C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3F1FA84828B60126009E246C /* Assets.xcassets */; };
3F1FA84B28B60126009E246C /* StoreWidgets.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 3F1FA84728B60125009E246C /* StoreWidgets.intentdefinition */; };
3F1FA84C28B60126009E246C /* StoreWidgets.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 3F1FA84728B60125009E246C /* StoreWidgets.intentdefinition */; };
3F1FA84F28B60126009E246C /* StoreWidgetsExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 3F1FA84028B60125009E246C /* StoreWidgetsExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
3F1FA84F28B60126009E246C /* StoreWidgetsExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 3F1FA84028B60125009E246C /* StoreWidgetsExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
3F2C8A19285B038800B1A5BB /* BuildkiteTestCollector in Frameworks */ = {isa = PBXBuildFile; productRef = 3F2C8A18285B038800B1A5BB /* BuildkiteTestCollector */; };
3F2C8A1B285B039900B1A5BB /* BuildkiteTestCollector in Frameworks */ = {isa = PBXBuildFile; productRef = 3F2C8A1A285B039900B1A5BB /* BuildkiteTestCollector */; };
3F2C8A1D285B03A400B1A5BB /* BuildkiteTestCollector in Frameworks */ = {isa = PBXBuildFile; productRef = 3F2C8A1C285B03A400B1A5BB /* BuildkiteTestCollector */; };
Expand Down Expand Up @@ -1895,15 +1895,15 @@
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
3F1FA85028B60126009E246C /* Embed App Extensions */ = {
3F1FA85028B60126009E246C /* Embed Foundation Extensions */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 13;
files = (
3F1FA84F28B60126009E246C /* StoreWidgetsExtension.appex in Embed App Extensions */,
3F1FA84F28B60126009E246C /* StoreWidgetsExtension.appex in Embed Foundation Extensions */,
);
name = "Embed App Extensions";
name = "Embed Foundation Extensions";
runOnlyForDeploymentPostprocessing = 0;
};
B5650B1020A4CD7F009702D0 /* Embed Frameworks */ = {
Expand Down Expand Up @@ -8673,7 +8673,7 @@
B5650B1020A4CD7F009702D0 /* Embed Frameworks */,
B7A94351C1ADC31EA528B895 /* [CP] Embed Pods Frameworks */,
095040D72655531C001D08FA /* Check for nested frameworks */,
3F1FA85028B60126009E246C /* Embed App Extensions */,
3F1FA85028B60126009E246C /* Embed Foundation Extensions */,
);
buildRules = (
);
Expand Down Expand Up @@ -8774,7 +8774,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1340;
LastUpgradeCheck = 1210;
LastUpgradeCheck = 1400;
ORGANIZATIONNAME = Automattic;
TargetAttributes = {
3F1FA83F28B60125009E246C = {
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 = "1210"
LastUpgradeVersion = "1400"
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 = "1210"
LastUpgradeVersion = "1400"
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 = "1210"
LastUpgradeVersion = "1400"
version = "1.7">
<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 = "1210"
LastUpgradeVersion = "1400"
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 = "1210"
LastUpgradeVersion = "1400"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,11 @@ final class StoreStatsPeriodViewModelTests: XCTestCase {
viewModel.selectedIntervalIndex = 0

// Then
XCTAssertEqual(timeRangeBarViewModels.map { $0.timeRangeText }, ["Monday, Jan 3", "Monday, Jan 3, 1:00 AM"])
if #available(iOS 16.0, *) {
XCTAssertEqual(timeRangeBarViewModels.map { $0.timeRangeText }, ["Monday, Jan 3", "Monday, Jan 3 at 1:00 AM"])
} else {
XCTAssertEqual(timeRangeBarViewModels.map { $0.timeRangeText }, ["Monday, Jan 3", "Monday, Jan 3, 1:00 AM"])
}
}

func test_timeRangeBarViewModel_for_thisWeek_is_emitted_twice_after_order_and_visitor_stats_updated_and_selecting_interval() {
Expand Down
5 changes: 4 additions & 1 deletion WooFoundation/WooFoundation.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1330;
LastUpgradeCheck = 1330;
LastUpgradeCheck = 1400;
TargetAttributes = {
B9C9C634283E703C001B879F = {
CreatedOnToolsVersion = 13.3;
Expand Down Expand Up @@ -526,6 +526,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down Expand Up @@ -630,6 +631,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand Down Expand Up @@ -688,6 +690,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = 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 = "1400"
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 = "1210"
LastUpgradeVersion = "1400"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down

0 comments on commit c457ff0

Please sign in to comment.