Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
PLATFORM_IOS = iOS Simulator,name=iPhone 11 Pro Max
PLATFORM_MACOS = macOS
PLATFORM_MAC_CATALYST = macOS,variant=Mac Catalyst
PLATFORM_TVOS = tvOS Simulator,name=Apple TV
PLATFORM_WATCHOS = watchOS Simulator,name=Apple Watch Series 7 (45mm)

Expand All @@ -9,7 +10,7 @@ test-all: test-library-debug test-library-release test-examples

test-library-debug:
for scheme in Dependencies ComposableArchitecture; do \
for platform in "$(PLATFORM_WATCHOS)" "$(PLATFORM_IOS)" "$(PLATFORM_MACOS)" "$(PLATFORM_TVOS)"; do \
for platform in "$(PLATFORM_IOS)" "$(PLATFORM_MACOS)" "$(PLATFORM_MAC_CATALYST)" "$(PLATFORM_TVOS)" "$(PLATFORM_WATCHOS)"; do \
xcodebuild test \
-workspace ComposableArchitecture.xcworkspace \
-scheme $$scheme \
Expand All @@ -19,7 +20,7 @@ test-library-debug:

test-library-release:
for scheme in Dependencies ComposableArchitecture; do \
for platform in "$(PLATFORM_WATCHOS)" "$(PLATFORM_IOS)" "$(PLATFORM_MACOS)" "$(PLATFORM_TVOS)"; do \
for platform in "$(PLATFORM_IOS)" "$(PLATFORM_MACOS)" "$(PLATFORM_MAC_CATALYST)" "$(PLATFORM_TVOS)" "$(PLATFORM_WATCHOS)"; do \
xcodebuild test \
-configuration release \
-workspace ComposableArchitecture.xcworkspace \
Expand Down
2 changes: 1 addition & 1 deletion Sources/Dependencies/Dependencies/OpenURL.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private enum OpenURLKey: DependencyKey {
static let liveValue = OpenURLEffect { url in
let stream = AsyncStream<Bool> { continuation in
let task = Task { @MainActor in
#if canImport(AppKit)
#if canImport(AppKit) && !targetEnvironment(macCatalyst)
Copy link
Contributor

@tgrapperon tgrapperon Oct 1, 2022

Choose a reason for hiding this comment

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

Alternatively, we can be more explicit about the intent when selecting platforms and simplify the logic by removing negations using os:

#if targetEnvironment(macCatalyst)

#elseif os(iOS)

#elseif os(tvOS)

#elseif os(watchOS)

#elseif os(macOS)

#else 

#endif

Copy link
Member Author

Choose a reason for hiding this comment

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

Might revisit this in the future, as it is admittedly a bit confusing, but for now just focused on fixing the build 😅

NSWorkspace.shared.open(url, configuration: .init()) { app, error in
continuation.yield(app != nil && error == nil)
continuation.finish()
Expand Down