diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c55739840..b8d766fb7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,24 +61,24 @@ jobs: - [iPadOS, 18, 6] - [iPadOS, 26, 0] + - [macCatalyst, 15, 0] + - [macOS, 15, 0] + - [tvOS, 15, 4] - [tvOS, 16, 4] - [tvOS, 17, 5] - [tvOS, 18, 5] - [tvOS, 26, 0] + - [visionOS, 1, 2] + - [visionOS, 2, 5] + - [visionOS, 26, 0] + - [watchOS, 8, 5] - [watchOS, 9, 4] - [watchOS, 10, 5] - [watchOS, 11, 5] - [watchOS, 26, 0] - - - [macOS, 15, 0] - # - [macOS, 26, 0] - - - [visionOS, 1, 2] - - [visionOS, 2, 5] - - [visionOS, 26, 0] steps: - name: Git Checkout uses: actions/checkout@v5 @@ -97,13 +97,20 @@ jobs: else case "$PLATFORM" in iOS) SCRIPT_PLATFORM=ios ;; + macOS) SCRIPT_PLATFORM=macos ;; + macCatalyst) SCRIPT_PLATFORM=mac-catalyst ;; tvOS) SCRIPT_PLATFORM=tvos ;; - watchOS) SCRIPT_PLATFORM=watchos ;; visionOS) SCRIPT_PLATFORM=visionos ;; - macOS) SCRIPT_PLATFORM=macos ;; + watchOS) SCRIPT_PLATFORM=watchos ;; esac fi + if [ "$PLATFORM" = "macCatalyst" ]; then + XCB_PLATFORM="mac-catalyst" + else + XCB_PLATFORM="$PLATFORM" + fi + RUNTIME="$PLATFORM $MAJOR.$MINOR" echo "PLATFORM=$PLATFORM" >> $GITHUB_ENV @@ -112,7 +119,7 @@ jobs: echo "RUNTIME=$RUNTIME" >> $GITHUB_ENV echo "SCRIPT_PLATFORM=$SCRIPT_PLATFORM" >> $GITHUB_ENV - - if: ${{ env.PLATFORM != 'macOS' }} + - if: ${{ env.PLATFORM != 'macCatalyst' && env.PLATFORM != 'macOS' }} name: Check for ${{ env.RUNTIME }} runtime run: | if xcrun simctl list runtimes | grep -q "$RUNTIME"; then @@ -140,7 +147,7 @@ jobs: max_attempts: 3 command: sudo xcodes runtimes install "$RUNTIME" - - if: ${{ env.PLATFORM != 'macOS' }} + - if: ${{ env.PLATFORM != 'macCatalyst' && env.PLATFORM != 'macOS' }} name: Create Required Simulators run: | set -eo pipefail @@ -162,7 +169,7 @@ jobs: uses: davdroman/xcodebuild@destination with: xcode: ~26.0 - platform: ${{ env.PLATFORM }} + platform: ${{ env.XCB_PLATFORM }} platform-version: ~${{ env.MAJOR }}.${{ env.MINOR }} destination: ${{ env.SIM_UDID }} action: build @@ -175,7 +182,7 @@ jobs: uses: davdroman/xcodebuild@destination with: xcode: ~26.0 - platform: ${{ env.PLATFORM }} + platform: ${{ env.XCB_PLATFORM }} platform-version: ~${{ env.MAJOR }}.${{ env.MINOR }} destination: ${{ env.SIM_UDID }} action: build @@ -188,7 +195,7 @@ jobs: uses: davdroman/xcodebuild@destination with: xcode: ~26.0 - platform: ${{ env.PLATFORM }} + platform: ${{ env.XCB_PLATFORM }} platform-version: ~${{ env.MAJOR }}.${{ env.MINOR }} destination: ${{ env.SIM_UDID }} action: test @@ -203,20 +210,20 @@ jobs: strategy: fail-fast: false matrix: - platform: [iOS, macOS, tvOS, watchOS, visionOS, macCatalyst] + platform: [iOS, macCatalyst, macOS, tvOS, visionOS, watchOS] include: - platform: iOS destination: "generic/platform=iOS" + - platform: macCatalyst + destination: "platform=macOS,variant=Mac Catalyst" - platform: macOS destination: "generic/platform=macOS" - platform: tvOS destination: "generic/platform=tvOS" - - platform: watchOS - destination: "generic/platform=watchOS" - platform: visionOS destination: "generic/platform=visionOS" - - platform: macCatalyst - destination: "platform=macOS,variant=Mac Catalyst" + - platform: watchOS + destination: "generic/platform=watchOS" steps: - name: Git Checkout uses: actions/checkout@v5 diff --git a/Examples/Showcase/Showcase/Controls.swift b/Examples/Showcase/Showcase/Controls.swift index cc0191f0b..3efe2dfe7 100644 --- a/Examples/Showcase/Showcase/Controls.swift +++ b/Examples/Showcase/Showcase/Controls.swift @@ -74,6 +74,7 @@ struct ControlsShowcase: View { #endif } + #if !targetEnvironment(macCatalyst) HStack { Slider(value: $sliderValue, in: 0...100) #if os(iOS) @@ -97,6 +98,7 @@ struct ControlsShowcase: View { } #endif } + #endif HStack { Stepper(onIncrement: {}, onDecrement: {}) { diff --git a/SwiftUIIntrospect.xcworkspace/xcshareddata/xcschemes/SwiftUIIntrospect.xcscheme b/SwiftUIIntrospect.xcworkspace/xcshareddata/xcschemes/SwiftUIIntrospect.xcscheme index 21c5793e7..d41171e87 100644 --- a/SwiftUIIntrospect.xcworkspace/xcshareddata/xcschemes/SwiftUIIntrospect.xcscheme +++ b/SwiftUIIntrospect.xcworkspace/xcshareddata/xcschemes/SwiftUIIntrospect.xcscheme @@ -1,10 +1,11 @@ + version = "1.7"> + buildImplicitDependencies = "YES" + buildArchitectures = "Automatic"> - - + shouldUseLaunchSchemeArgsEnv = "YES" + shouldAutocreateTestPlan = "YES"> - - - - diff --git a/Tests/Tests.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Tests/Tests.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003..000000000 --- a/Tests/Tests.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/Tests/Tests.xcodeproj/xcshareddata/xcschemes/SwiftUIIntrospectTestFramework.xcscheme b/Tests/Tests.xcodeproj/xcshareddata/xcschemes/SwiftUIIntrospectTestFramework.xcscheme index badd8b7fd..a98568b5a 100644 --- a/Tests/Tests.xcodeproj/xcshareddata/xcschemes/SwiftUIIntrospectTestFramework.xcscheme +++ b/Tests/Tests.xcodeproj/xcshareddata/xcschemes/SwiftUIIntrospectTestFramework.xcscheme @@ -15,7 +15,7 @@ buildForAnalyzing = "YES"> @@ -50,7 +50,7 @@ diff --git a/Tests/Tests.xcodeproj/xcshareddata/xcschemes/SwiftUIIntrospectTests.xcscheme b/Tests/Tests.xcodeproj/xcshareddata/xcschemes/SwiftUIIntrospectTests.xcscheme index 72528b38e..026e39cd1 100644 --- a/Tests/Tests.xcodeproj/xcshareddata/xcschemes/SwiftUIIntrospectTests.xcscheme +++ b/Tests/Tests.xcodeproj/xcshareddata/xcschemes/SwiftUIIntrospectTests.xcscheme @@ -1,39 +1,30 @@ + version = "1.7"> - - - - - - + buildImplicitDependencies = "YES" + buildArchitectures = "Automatic"> + + + + @@ -51,16 +42,6 @@ debugDocumentVersioning = "YES" debugServiceExtension = "internal" allowLocationSimulation = "YES"> - - - - - - - - diff --git a/Tests/Tests.xctestplan b/Tests/Tests.xctestplan new file mode 100644 index 000000000..2610cdcdb --- /dev/null +++ b/Tests/Tests.xctestplan @@ -0,0 +1,25 @@ +{ + "configurations" : [ + { + "id" : "BFDC7AD2-E943-4590-B54A-FAEEBCE74E0D", + "name" : "Test Scheme Action", + "options" : { + + } + } + ], + "defaultOptions" : { + "performanceAntipatternCheckerEnabled" : true + }, + "testTargets" : [ + { + "parallelizable" : false, + "target" : { + "containerPath" : "container:Tests.xcodeproj", + "identifier" : "D5E04C252E84254D006739F9", + "name" : "Tests" + } + } + ], + "version" : 1 +} diff --git a/Tests/Tests/ViewTypes/DatePickerWithWheelStyleTests.swift b/Tests/Tests/ViewTypes/DatePickerWithWheelStyleTests.swift index 861365d5c..f8fd75449 100644 --- a/Tests/Tests/ViewTypes/DatePickerWithWheelStyleTests.swift +++ b/Tests/Tests/ViewTypes/DatePickerWithWheelStyleTests.swift @@ -1,4 +1,4 @@ -#if !os(tvOS) && !os(macOS) +#if !os(tvOS) && !os(macOS) && !targetEnvironment(macCatalyst) import SwiftUI import SwiftUIIntrospect import Testing diff --git a/Tests/Tests/ViewTypes/MapTests.swift b/Tests/Tests/ViewTypes/MapTests.swift index 485e1a149..754cc7a22 100644 --- a/Tests/Tests/ViewTypes/MapTests.swift +++ b/Tests/Tests/ViewTypes/MapTests.swift @@ -5,7 +5,8 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite struct MapTests { +@Suite +struct MapTests { typealias PlatformMap = MKMapView @Test func introspect() async throws { diff --git a/Tests/Tests/ViewTypes/PickerWithWheelStyleTests.swift b/Tests/Tests/ViewTypes/PickerWithWheelStyleTests.swift index 92726a9f2..2ec21c4dd 100644 --- a/Tests/Tests/ViewTypes/PickerWithWheelStyleTests.swift +++ b/Tests/Tests/ViewTypes/PickerWithWheelStyleTests.swift @@ -1,4 +1,4 @@ -#if !os(tvOS) && !os(macOS) +#if !os(tvOS) && !os(macOS) && !targetEnvironment(macCatalyst) import SwiftUI import SwiftUIIntrospect import Testing diff --git a/Tests/Tests/ViewTypes/SliderTests.swift b/Tests/Tests/ViewTypes/SliderTests.swift index 22e6cfc11..d8d1fa61f 100644 --- a/Tests/Tests/ViewTypes/SliderTests.swift +++ b/Tests/Tests/ViewTypes/SliderTests.swift @@ -1,4 +1,4 @@ -#if !os(tvOS) && !os(visionOS) +#if !os(tvOS) && !os(visionOS) && !targetEnvironment(macCatalyst) import SwiftUI import SwiftUIIntrospect import Testing diff --git a/Tests/Tests/ViewTypes/StepperTests.swift b/Tests/Tests/ViewTypes/StepperTests.swift index 24eb3ceab..194bd6863 100644 --- a/Tests/Tests/ViewTypes/StepperTests.swift +++ b/Tests/Tests/ViewTypes/StepperTests.swift @@ -1,4 +1,4 @@ -#if !os(tvOS) && !os(visionOS) +#if !os(tvOS) && !os(visionOS) && !targetEnvironment(macCatalyst) import SwiftUI import SwiftUIIntrospect import Testing diff --git a/Tests/Tests/ViewTypes/ToggleTests.swift b/Tests/Tests/ViewTypes/ToggleTests.swift index 90fb0bae8..bdf631bef 100644 --- a/Tests/Tests/ViewTypes/ToggleTests.swift +++ b/Tests/Tests/ViewTypes/ToggleTests.swift @@ -1,4 +1,4 @@ -#if !os(tvOS) && !os(visionOS) +#if !os(tvOS) && !os(visionOS) && !targetEnvironment(macCatalyst) import SwiftUI import SwiftUIIntrospect import Testing diff --git a/Tests/TestsHostApp/App.swift b/Tests/TestsHostApp/App.swift new file mode 100644 index 000000000..050f4177e --- /dev/null +++ b/Tests/TestsHostApp/App.swift @@ -0,0 +1,10 @@ +import SwiftUI + +@main +struct App: SwiftUI.App { + var body: some Scene { + WindowGroup { + EmptyView() + } + } +} diff --git a/Tests/TestsHostApp/Assets.xcassets/AccentColor.colorset/Contents.json b/Tests/TestsHostApp/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 000000000..eb8789700 --- /dev/null +++ b/Tests/TestsHostApp/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Tests/TestsHostApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/Tests/TestsHostApp/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..ffdfe150b --- /dev/null +++ b/Tests/TestsHostApp/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,85 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "tinted" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "512x512" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "512x512" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Tests/TestsHostApp/Assets.xcassets/Contents.json b/Tests/TestsHostApp/Assets.xcassets/Contents.json new file mode 100644 index 000000000..73c00596a --- /dev/null +++ b/Tests/TestsHostApp/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Tests/TestsHostApp/TestsHostApp.swift b/Tests/TestsHostApp/TestsHostApp.swift deleted file mode 100644 index abed6a522..000000000 --- a/Tests/TestsHostApp/TestsHostApp.swift +++ /dev/null @@ -1,10 +0,0 @@ -import SwiftUI - -@main -struct App: SwiftUI.App { - var body: some Scene { - WindowGroup { - EmptyView() - } - } -} diff --git a/Tests/UITests/__Snapshots__/StatusBarStyleUITests/test.ipad-ios-13-screenshot-1.png b/Tests/UITests/__Snapshots__/StatusBarStyleUITests/test.ipad-ios-13-screenshot-1.png deleted file mode 100644 index 9fcbc3d86..000000000 Binary files a/Tests/UITests/__Snapshots__/StatusBarStyleUITests/test.ipad-ios-13-screenshot-1.png and /dev/null differ diff --git a/Tests/UITests/__Snapshots__/StatusBarStyleUITests/test.ipad-ios-14-screenshot-1.png b/Tests/UITests/__Snapshots__/StatusBarStyleUITests/test.ipad-ios-14-screenshot-1.png deleted file mode 100644 index f008882b2..000000000 Binary files a/Tests/UITests/__Snapshots__/StatusBarStyleUITests/test.ipad-ios-14-screenshot-1.png and /dev/null differ diff --git a/Tests/UITests/__Snapshots__/StatusBarStyleUITests/test.ipad-ios-15-screenshot-1.png b/Tests/UITests/__Snapshots__/StatusBarStyleUITests/test.ipad-ios-15-screenshot-1.png deleted file mode 100644 index 6f0e828cb..000000000 Binary files a/Tests/UITests/__Snapshots__/StatusBarStyleUITests/test.ipad-ios-15-screenshot-1.png and /dev/null differ diff --git a/Tests/UITests/__Snapshots__/StatusBarStyleUITests/test.ipad-ios-16-screenshot-1.png b/Tests/UITests/__Snapshots__/StatusBarStyleUITests/test.ipad-ios-16-screenshot-1.png deleted file mode 100644 index 9778bb3ff..000000000 Binary files a/Tests/UITests/__Snapshots__/StatusBarStyleUITests/test.ipad-ios-16-screenshot-1.png and /dev/null differ diff --git a/Tests/UITests/__Snapshots__/StatusBarStyleUITests/test.iphone-ios-13-screenshot-1.png b/Tests/UITests/__Snapshots__/StatusBarStyleUITests/test.iphone-ios-13-screenshot-1.png deleted file mode 100644 index a1f9cab1a..000000000 Binary files a/Tests/UITests/__Snapshots__/StatusBarStyleUITests/test.iphone-ios-13-screenshot-1.png and /dev/null differ diff --git a/Tests/UITests/__Snapshots__/StatusBarStyleUITests/test.iphone-ios-14-screenshot-1.png b/Tests/UITests/__Snapshots__/StatusBarStyleUITests/test.iphone-ios-14-screenshot-1.png deleted file mode 100644 index 74dfd54e4..000000000 Binary files a/Tests/UITests/__Snapshots__/StatusBarStyleUITests/test.iphone-ios-14-screenshot-1.png and /dev/null differ diff --git a/Tests/UITests/__Snapshots__/StatusBarStyleUITests/test.iphone-ios-15-screenshot-1.png b/Tests/UITests/__Snapshots__/StatusBarStyleUITests/test.iphone-ios-15-screenshot-1.png deleted file mode 100644 index d8c9541b9..000000000 Binary files a/Tests/UITests/__Snapshots__/StatusBarStyleUITests/test.iphone-ios-15-screenshot-1.png and /dev/null differ diff --git a/Tests/UITests/__Snapshots__/StatusBarStyleUITests/test.iphone-ios-16-screenshot-1.png b/Tests/UITests/__Snapshots__/StatusBarStyleUITests/test.iphone-ios-16-screenshot-1.png deleted file mode 100644 index a5129697e..000000000 Binary files a/Tests/UITests/__Snapshots__/StatusBarStyleUITests/test.iphone-ios-16-screenshot-1.png and /dev/null differ diff --git a/script/create_simulators b/script/create_simulators index 050e956d0..601549c8f 100755 --- a/script/create_simulators +++ b/script/create_simulators @@ -30,6 +30,11 @@ devices = { 18 => "Apple TV (18.5)", 26 => "Apple TV (26.0)", }, + "visionos" => { + 1 => "Apple Vision Pro (at 2732x2048) (1.2)", + 2 => "Apple Vision Pro (at 2732x2048) (2.5)", + 26 => "Apple Vision Pro (26.0)", + }, "watchos" => { 8 => "Apple Watch Series 7 (45mm) (8.5)", 9 => "Apple Watch Series 8 (45mm) (9.4)", @@ -37,11 +42,6 @@ devices = { 11 => "Apple Watch Series 10 (42mm) (11.5)", 26 => "Apple Watch Series 11 (42mm) (26.0)", }, - "visionos" => { - 1 => "Apple Vision Pro (at 2732x2048) (1.2)", - 2 => "Apple Vision Pro (at 2732x2048) (2.5)", - 26 => "Apple Vision Pro (26.0)", - }, } # Map script platform keys to CoreSimulator OS display names