Skip to content

Commit

Permalink
Merge pull request #894 from DataDog/ncreated/RUMM-2256-fix-mac-catal…
Browse files Browse the repository at this point in the history
…yst-compatibility

RUMM-2256 Fix Mac Catalyst compatibility in `1.11.0`
  • Loading branch information
ncreated authored Jun 20, 2022
2 parents 4fb25aa + 9a35f64 commit 58a4e5a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

### Changes

* [BUGFIX] Fix Mac Catalyst builds compatibility. See [#894][]

# 1.11.0 / 13-06-2022

### Changes
Expand Down Expand Up @@ -385,6 +387,7 @@
[#837]: https://github.com/DataDog/dd-sdk-ios/issues/837
[#832]: https://github.com/DataDog/dd-sdk-ios/issues/832
[#851]: https://github.com/DataDog/dd-sdk-ios/issues/851
[#894]: https://github.com/DataDog/dd-sdk-ios/issues/894
[@00FA9A]: https://github.com/00FA9A
[@Britton-Earnin]: https://github.com/Britton-Earnin
[@Hengyu]: https://github.com/Hengyu
Expand Down
6 changes: 3 additions & 3 deletions Sources/Datadog/Core/System/CarrierInfoProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ internal protocol CarrierInfoProviderType {
extension CarrierInfo.RadioAccessTechnology {
init(ctRadioAccessTechnologyConstant: String) {
switch ctRadioAccessTechnologyConstant {
#if os(iOS)
#if os(iOS) && !targetEnvironment(macCatalyst)
case CTRadioAccessTechnologyGPRS: self = .GPRS
case CTRadioAccessTechnologyEdge: self = .Edge
case CTRadioAccessTechnologyWCDMA: self = .WCDMA
Expand All @@ -74,7 +74,7 @@ internal class CarrierInfoProvider: CarrierInfoProviderType {
private let wrappedProvider: CarrierInfoProviderType

convenience init() {
#if os(iOS)
#if os(iOS) && !targetEnvironment(macCatalyst)
if #available(iOS 12.0, *) {
self.init(wrappedProvider: iOS12CarrierInfoProvider(networkInfo: CTTelephonyNetworkInfo()))
} else {
Expand Down Expand Up @@ -106,7 +106,7 @@ internal struct NOPCarrierInfoProvider: CarrierInfoProviderType {
func subscribe<Observer>(_ subscriber: Observer) where Observer: ValueObserver, Observer.ObservedValue == CarrierInfo? {}
}

#if os(iOS)
#if os(iOS) && !targetEnvironment(macCatalyst)
/// Carrier info provider for iOS 12 and above.
/// It reads `CarrierInfo?` from `CTTelephonyNetworkInfo` only when `CTCarrier` has changed (e.g. when the SIM card was swapped).
@available(iOS 12, *)
Expand Down
14 changes: 9 additions & 5 deletions bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -289,14 +289,18 @@ workflows:
#!/usr/bin/env bash
set -e
make test-spm ci=${CI}
- xcodebuild:
- script:
title: Check Mac Catalyst compatibility (build SPMProject for Catalyst)
run_if: '{{enveq "DD_RUN_SMOKE_TESTS" "1"}}'
inputs:
- scheme: App iOS
- destination: platform=macOS,variant=Mac Catalyst
- project_path: "$BITRISE_SOURCE_DIR/dependency-manager-tests/spm/SPMProject.xcodeproj"
- xcpretty_test_options: --color --report html --output "${BITRISE_DEPLOY_DIR}/SPMProject-catalyst-sanity-check.html"
- content: |-
#!/usr/bin/env bash
set -euxo pipefail
xcodebuild build -scheme "App iOS" \
-project "$BITRISE_SOURCE_DIR/dependency-manager-tests/spm/SPMProject.xcodeproj" \
-destination "platform=macOS,variant=Mac Catalyst" \
| xcpretty
- xcode-test:
title: Run SPMProject iOS tests
run_if: '{{enveq "DD_RUN_SMOKE_TESTS" "1"}}'
Expand Down

0 comments on commit 58a4e5a

Please sign in to comment.