diff --git a/.github/actions/uitests/action.yml b/.github/actions/uitests/action.yml index 2560d1ec1..3037a6834 100644 --- a/.github/actions/uitests/action.yml +++ b/.github/actions/uitests/action.yml @@ -2,6 +2,10 @@ name: Run UI Tests description: Execute UI tests and collect artifacts if failure inputs: + xcode-version: + description: 'Xcode version to use' + required: false + default: '16.4' platform: description: 'Platform to test (ios or macos)' required: true @@ -20,16 +24,47 @@ outputs: runs: using: composite steps: + - name: Setup Xcode + uses: OpenSwiftUIProject/setup-xcode@v2 + with: + xcode-version: ${{ inputs.xcode-version }} + + - name: Set up mise + uses: jdx/mise-action@v2 + with: + install: false + cache: false + + - name: Install Tuist + run: | + cd Example + mise trust mise.toml + mise install + tuist version + shell: bash + + - name: Set up build environment + run: Scripts/CI/darwin_setup_build.sh + shell: bash + - name: Install xcbeautify shell: bash run: brew install xcbeautify + - name: Generate Example project + shell: bash + run: | + cd Example + mise exec -- tuist install + mise exec -- tuist generate --no-open + - name: Record baseline images with SwiftUI shell: bash run: | cd Example set -o pipefail NSUnbufferedIO=YES xcodebuild test \ + -workspace Example.xcworkspace \ -scheme SUI_UITests \ -destination "${{ inputs.destination }}" \ -skipMacroValidation \ @@ -45,6 +80,7 @@ runs: rm -rf /tmp/${{ inputs.platform }}-uitest.xcresult set -o pipefail NSUnbufferedIO=YES xcodebuild test \ + -workspace Example.xcworkspace \ -scheme OSUI_UITests \ -destination "${{ inputs.destination }}" \ -skipMacroValidation \ diff --git a/.github/workflows/uitests.yml b/.github/workflows/uitests.yml index 677c6f30b..f330b00fa 100644 --- a/.github/workflows/uitests.yml +++ b/.github/workflows/uitests.yml @@ -172,17 +172,11 @@ jobs: with: repository: ${{ needs.prepare_issue_comment.outputs.repository || github.repository }} ref: ${{ needs.prepare_issue_comment.outputs.ref || github.sha }} - - name: Setup Xcode - uses: OpenSwiftUIProject/setup-xcode@v2 - with: - xcode-version: ${{ matrix.xcode-version }} - - name: Set up build environment - run: Scripts/CI/darwin_setup_build.sh - shell: bash - name: Run UI Tests id: run-tests uses: ./.github/actions/uitests with: + xcode-version: ${{ matrix.xcode-version }} platform: ios destination: "platform=iOS Simulator,OS=${{ matrix.ios-version }},name=${{ matrix.ios-simulator-name }}" artifact-name: ios-uitest-snapshots-${{ matrix.ios-version }} @@ -267,17 +261,11 @@ jobs: with: repository: ${{ needs.prepare_issue_comment.outputs.repository || github.repository }} ref: ${{ needs.prepare_issue_comment.outputs.ref || github.sha }} - - name: Setup Xcode - uses: OpenSwiftUIProject/setup-xcode@v2 - with: - xcode-version: ${{ matrix.xcode-version }} - - name: Set up build environment - run: Scripts/CI/darwin_setup_build.sh - shell: bash - name: Run UI Tests id: run-tests uses: ./.github/actions/uitests with: + xcode-version: ${{ matrix.xcode-version }} platform: macos destination: "platform=macOS" artifact-name: macos-uitest-snapshots diff --git a/Example/.gitignore b/Example/.gitignore new file mode 100644 index 000000000..c7dd40ac2 --- /dev/null +++ b/Example/.gitignore @@ -0,0 +1,4 @@ +Derived/ +Example.xcodeproj/ +Example.xcworkspace/ +Tuist/.build/ diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example_Legacy.xcodeproj/project.pbxproj similarity index 100% rename from Example/Example.xcodeproj/project.pbxproj rename to Example/Example_Legacy.xcodeproj/project.pbxproj diff --git a/Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Example/Example_Legacy.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to Example/Example_Legacy.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/Example/Example.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Example/Example_Legacy.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved similarity index 100% rename from Example/Example.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved rename to Example/Example_Legacy.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved diff --git a/Example/Example.xcodeproj/xcshareddata/xcschemes/OSUI_Example.xcscheme b/Example/Example_Legacy.xcodeproj/xcshareddata/xcschemes/OSUI_Example.xcscheme similarity index 92% rename from Example/Example.xcodeproj/xcshareddata/xcschemes/OSUI_Example.xcscheme rename to Example/Example_Legacy.xcodeproj/xcshareddata/xcschemes/OSUI_Example.xcscheme index b1b0b8e82..03e50e56f 100644 --- a/Example/Example.xcodeproj/xcshareddata/xcschemes/OSUI_Example.xcscheme +++ b/Example/Example_Legacy.xcodeproj/xcshareddata/xcschemes/OSUI_Example.xcscheme @@ -18,7 +18,7 @@ BlueprintIdentifier = "27CD0B482AFC8D37003665EB" BuildableName = "Example.app" BlueprintName = "Example" - ReferencedContainer = "container:Example.xcodeproj"> + ReferencedContainer = "container:Example_Legacy.xcodeproj"> @@ -43,7 +43,7 @@ BlueprintIdentifier = "279283B82DFF11CE00234D64" BuildableName = "OpenSwiftUIUITests.xctest" BlueprintName = "OpenSwiftUIUITests" - ReferencedContainer = "container:Example.xcodeproj"> + ReferencedContainer = "container:Example_Legacy.xcodeproj"> @@ -65,7 +65,7 @@ BlueprintIdentifier = "27CD0B482AFC8D37003665EB" BuildableName = "Example.app" BlueprintName = "Example" - ReferencedContainer = "container:Example.xcodeproj"> + ReferencedContainer = "container:Example_Legacy.xcodeproj"> @@ -94,7 +94,7 @@ BlueprintIdentifier = "27CD0B482AFC8D37003665EB" BuildableName = "Example.app" BlueprintName = "Example" - ReferencedContainer = "container:Example.xcodeproj"> + ReferencedContainer = "container:Example_Legacy.xcodeproj"> diff --git a/Example/Example.xcodeproj/xcshareddata/xcschemes/OSUI_HostingExample.xcscheme b/Example/Example_Legacy.xcodeproj/xcshareddata/xcschemes/OSUI_HostingExample.xcscheme similarity index 93% rename from Example/Example.xcodeproj/xcshareddata/xcschemes/OSUI_HostingExample.xcscheme rename to Example/Example_Legacy.xcodeproj/xcshareddata/xcschemes/OSUI_HostingExample.xcscheme index 9ba3dd6b6..7489fa464 100644 --- a/Example/Example.xcodeproj/xcshareddata/xcschemes/OSUI_HostingExample.xcscheme +++ b/Example/Example_Legacy.xcodeproj/xcshareddata/xcschemes/OSUI_HostingExample.xcscheme @@ -18,7 +18,7 @@ BlueprintIdentifier = "27D49DF72BA604FB00F6E2E2" BuildableName = "HostingExample.app" BlueprintName = "HostingExample" - ReferencedContainer = "container:Example.xcodeproj"> + ReferencedContainer = "container:Example_Legacy.xcodeproj"> @@ -52,7 +52,7 @@ BlueprintIdentifier = "27D49DF72BA604FB00F6E2E2" BuildableName = "HostingExample.app" BlueprintName = "HostingExample" - ReferencedContainer = "container:Example.xcodeproj"> + ReferencedContainer = "container:Example_Legacy.xcodeproj"> @@ -81,7 +81,7 @@ BlueprintIdentifier = "27D49DF72BA604FB00F6E2E2" BuildableName = "HostingExample.app" BlueprintName = "HostingExample" - ReferencedContainer = "container:Example.xcodeproj"> + ReferencedContainer = "container:Example_Legacy.xcodeproj"> diff --git a/Example/Example.xcodeproj/xcshareddata/xcschemes/OSUI_TestingHost.xcscheme b/Example/Example_Legacy.xcodeproj/xcshareddata/xcschemes/OSUI_TestingHost.xcscheme similarity index 92% rename from Example/Example.xcodeproj/xcshareddata/xcschemes/OSUI_TestingHost.xcscheme rename to Example/Example_Legacy.xcodeproj/xcshareddata/xcschemes/OSUI_TestingHost.xcscheme index c56e60a89..f039beb83 100644 --- a/Example/Example.xcodeproj/xcshareddata/xcschemes/OSUI_TestingHost.xcscheme +++ b/Example/Example_Legacy.xcodeproj/xcshareddata/xcschemes/OSUI_TestingHost.xcscheme @@ -18,7 +18,7 @@ BlueprintIdentifier = "275751E22DEE1441003E467C" BuildableName = "TestingHost.app" BlueprintName = "TestingHost" - ReferencedContainer = "container:Example.xcodeproj"> + ReferencedContainer = "container:Example_Legacy.xcodeproj"> @@ -47,7 +47,7 @@ BlueprintIdentifier = "275751E22DEE1441003E467C" BuildableName = "TestingHost.app" BlueprintName = "TestingHost" - ReferencedContainer = "container:Example.xcodeproj"> + ReferencedContainer = "container:Example_Legacy.xcodeproj"> @@ -64,7 +64,7 @@ BlueprintIdentifier = "275751E22DEE1441003E467C" BuildableName = "TestingHost.app" BlueprintName = "TestingHost" - ReferencedContainer = "container:Example.xcodeproj"> + ReferencedContainer = "container:Example_Legacy.xcodeproj"> diff --git a/Example/Example.xcodeproj/xcshareddata/xcschemes/OSUI_UITests.xcscheme b/Example/Example_Legacy.xcodeproj/xcshareddata/xcschemes/OSUI_UITests.xcscheme similarity index 96% rename from Example/Example.xcodeproj/xcshareddata/xcschemes/OSUI_UITests.xcscheme rename to Example/Example_Legacy.xcodeproj/xcshareddata/xcschemes/OSUI_UITests.xcscheme index 382e37f12..13ac7fde1 100644 --- a/Example/Example.xcodeproj/xcshareddata/xcschemes/OSUI_UITests.xcscheme +++ b/Example/Example_Legacy.xcodeproj/xcshareddata/xcschemes/OSUI_UITests.xcscheme @@ -27,7 +27,7 @@ BlueprintIdentifier = "279283B82DFF11CE00234D64" BuildableName = "OpenSwiftUIUITests.xctest" BlueprintName = "OpenSwiftUIUITests" - ReferencedContainer = "container:Example.xcodeproj"> + ReferencedContainer = "container:Example_Legacy.xcodeproj"> diff --git a/Example/Example.xcodeproj/xcshareddata/xcschemes/SUI_Example.xcscheme b/Example/Example_Legacy.xcodeproj/xcshareddata/xcschemes/SUI_Example.xcscheme similarity index 92% rename from Example/Example.xcodeproj/xcshareddata/xcschemes/SUI_Example.xcscheme rename to Example/Example_Legacy.xcodeproj/xcshareddata/xcschemes/SUI_Example.xcscheme index 26ab3a722..d577c59f8 100644 --- a/Example/Example.xcodeproj/xcshareddata/xcschemes/SUI_Example.xcscheme +++ b/Example/Example_Legacy.xcodeproj/xcshareddata/xcschemes/SUI_Example.xcscheme @@ -18,7 +18,7 @@ BlueprintIdentifier = "27CD0B482AFC8D37003665EB" BuildableName = "Example.app" BlueprintName = "Example" - ReferencedContainer = "container:Example.xcodeproj"> + ReferencedContainer = "container:Example_Legacy.xcodeproj"> @@ -43,7 +43,7 @@ BlueprintIdentifier = "279283B82DFF11CE00234D64" BuildableName = "OpenSwiftUIUITests.xctest" BlueprintName = "OpenSwiftUIUITests" - ReferencedContainer = "container:Example.xcodeproj"> + ReferencedContainer = "container:Example_Legacy.xcodeproj"> @@ -65,7 +65,7 @@ BlueprintIdentifier = "27CD0B482AFC8D37003665EB" BuildableName = "Example.app" BlueprintName = "Example" - ReferencedContainer = "container:Example.xcodeproj"> + ReferencedContainer = "container:Example_Legacy.xcodeproj"> @@ -89,7 +89,7 @@ BlueprintIdentifier = "27CD0B482AFC8D37003665EB" BuildableName = "Example.app" BlueprintName = "Example" - ReferencedContainer = "container:Example.xcodeproj"> + ReferencedContainer = "container:Example_Legacy.xcodeproj"> diff --git a/Example/Example.xcodeproj/xcshareddata/xcschemes/SUI_HostingExample.xcscheme b/Example/Example_Legacy.xcodeproj/xcshareddata/xcschemes/SUI_HostingExample.xcscheme similarity index 94% rename from Example/Example.xcodeproj/xcshareddata/xcschemes/SUI_HostingExample.xcscheme rename to Example/Example_Legacy.xcodeproj/xcshareddata/xcschemes/SUI_HostingExample.xcscheme index 3a27745ba..a04518e55 100644 --- a/Example/Example.xcodeproj/xcshareddata/xcschemes/SUI_HostingExample.xcscheme +++ b/Example/Example_Legacy.xcodeproj/xcshareddata/xcschemes/SUI_HostingExample.xcscheme @@ -18,7 +18,7 @@ BlueprintIdentifier = "27D49DF72BA604FB00F6E2E2" BuildableName = "HostingExample.app" BlueprintName = "HostingExample" - ReferencedContainer = "container:Example.xcodeproj"> + ReferencedContainer = "container:Example_Legacy.xcodeproj"> @@ -52,7 +52,7 @@ BlueprintIdentifier = "27D49DF72BA604FB00F6E2E2" BuildableName = "HostingExample.app" BlueprintName = "HostingExample" - ReferencedContainer = "container:Example.xcodeproj"> + ReferencedContainer = "container:Example_Legacy.xcodeproj"> @@ -91,7 +91,7 @@ BlueprintIdentifier = "27D49DF72BA604FB00F6E2E2" BuildableName = "HostingExample.app" BlueprintName = "HostingExample" - ReferencedContainer = "container:Example.xcodeproj"> + ReferencedContainer = "container:Example_Legacy.xcodeproj"> diff --git a/Example/Example.xcodeproj/xcshareddata/xcschemes/SUI_TestingHost.xcscheme b/Example/Example_Legacy.xcodeproj/xcshareddata/xcschemes/SUI_TestingHost.xcscheme similarity index 92% rename from Example/Example.xcodeproj/xcshareddata/xcschemes/SUI_TestingHost.xcscheme rename to Example/Example_Legacy.xcodeproj/xcshareddata/xcschemes/SUI_TestingHost.xcscheme index 0db9ed435..69629c282 100644 --- a/Example/Example.xcodeproj/xcshareddata/xcschemes/SUI_TestingHost.xcscheme +++ b/Example/Example_Legacy.xcodeproj/xcshareddata/xcschemes/SUI_TestingHost.xcscheme @@ -18,7 +18,7 @@ BlueprintIdentifier = "275751E22DEE1441003E467C" BuildableName = "TestingHost.app" BlueprintName = "TestingHost" - ReferencedContainer = "container:Example.xcodeproj"> + ReferencedContainer = "container:Example_Legacy.xcodeproj"> @@ -47,7 +47,7 @@ BlueprintIdentifier = "275751E22DEE1441003E467C" BuildableName = "TestingHost.app" BlueprintName = "TestingHost" - ReferencedContainer = "container:Example.xcodeproj"> + ReferencedContainer = "container:Example_Legacy.xcodeproj"> @@ -64,7 +64,7 @@ BlueprintIdentifier = "275751E22DEE1441003E467C" BuildableName = "TestingHost.app" BlueprintName = "TestingHost" - ReferencedContainer = "container:Example.xcodeproj"> + ReferencedContainer = "container:Example_Legacy.xcodeproj"> diff --git a/Example/Example.xcodeproj/xcshareddata/xcschemes/SUI_UITests.xcscheme b/Example/Example_Legacy.xcodeproj/xcshareddata/xcschemes/SUI_UITests.xcscheme similarity index 96% rename from Example/Example.xcodeproj/xcshareddata/xcschemes/SUI_UITests.xcscheme rename to Example/Example_Legacy.xcodeproj/xcshareddata/xcschemes/SUI_UITests.xcscheme index f0f7211d4..56a0bbd89 100644 --- a/Example/Example.xcodeproj/xcshareddata/xcschemes/SUI_UITests.xcscheme +++ b/Example/Example_Legacy.xcodeproj/xcshareddata/xcschemes/SUI_UITests.xcscheme @@ -27,7 +27,7 @@ BlueprintIdentifier = "279283B82DFF11CE00234D64" BuildableName = "OpenSwiftUIUITests.xctest" BlueprintName = "OpenSwiftUIUITests" - ReferencedContainer = "container:Example.xcodeproj"> + ReferencedContainer = "container:Example_Legacy.xcodeproj"> diff --git a/Example/OpenSwiftUIUITests/OpenSwiftUIUITests-Bridging-Header.h b/Example/OpenSwiftUIUITests/OpenSwiftUIUITests-Bridging-Header.h index dfb27df13..81e272cc7 100644 --- a/Example/OpenSwiftUIUITests/OpenSwiftUIUITests-Bridging-Header.h +++ b/Example/OpenSwiftUIUITests/OpenSwiftUIUITests-Bridging-Header.h @@ -2,4 +2,4 @@ // Use this file to import your target's public headers that you would like to expose to Swift. // -#import "AnimationDebugControllerHelper.h" +#import "UITests/AnimationDebugControllerHelper.h" diff --git a/Example/OpenSwiftUIUITests/OpenSwiftUIUITests.xctestplan b/Example/OpenSwiftUIUITests/OpenSwiftUIUITests.xctestplan index a756e13ef..8ce543076 100644 --- a/Example/OpenSwiftUIUITests/OpenSwiftUIUITests.xctestplan +++ b/Example/OpenSwiftUIUITests/OpenSwiftUIUITests.xctestplan @@ -21,7 +21,7 @@ } ], "targetForVariableExpansion" : { - "containerPath" : "container:Example.xcodeproj", + "containerPath" : "container:Example_Legacy.xcodeproj", "identifier" : "275751E22DEE1441003E467C", "name" : "TestingHost" } @@ -29,7 +29,7 @@ "testTargets" : [ { "target" : { - "containerPath" : "container:Example.xcodeproj", + "containerPath" : "container:Example_Legacy.xcodeproj", "identifier" : "279283B82DFF11CE00234D64", "name" : "OpenSwiftUIUITests" } diff --git a/Example/OpenSwiftUIUITests/UITests/SnapshotTesting+Testing.swift b/Example/OpenSwiftUIUITests/UITests/SnapshotTesting+Testing.swift index 39e419eaa..33573bb33 100644 --- a/Example/OpenSwiftUIUITests/UITests/SnapshotTesting+Testing.swift +++ b/Example/OpenSwiftUIUITests/UITests/SnapshotTesting+Testing.swift @@ -8,6 +8,18 @@ import TestingHost import Foundation let defaultSize = CGSize(width: 200, height: 200) +let snapshotReferenceDirectory: String = { + #if os(macOS) + let os = "macOS" + #elseif os(iOS) && targetEnvironment(simulator) + let os = "iOS_Simulator" + #else + #error("Unsupported UI test platform") + #endif + let directory = ProcessInfo.processInfo.environment["SNAPSHOT_REFERENCE_DIR"]! + "/\(os)" + print("SNAPSHOT_REFERENCE_DIR: \(directory)") + return directory +}() #if os(macOS) import AppKit @@ -146,12 +158,7 @@ private func openSwiftUIAssertSnapshot( line: UInt = #line, column: UInt = #column ) { - #if os(macOS) - let os = "macOS" - #elseif os(iOS) && targetEnvironment(simulator) - let os = "iOS_Simulator" - #endif - let snapshotDirectory = ProcessInfo.processInfo.environment["SNAPSHOT_REFERENCE_DIR"]! + "/\(os)/" + fileID.description + let snapshotDirectory = snapshotReferenceDirectory + "/" + fileID.description let failure = verifySnapshot( of: value(), as: snapshotting, diff --git a/Example/Package.swift b/Example/Package.swift deleted file mode 100644 index ea456731e..000000000 --- a/Example/Package.swift +++ /dev/null @@ -1,65 +0,0 @@ -// swift-tools-version: 5.9 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import Foundation -import PackageDescription - -let exampleTarget = Target.executableTarget( - name: "Example", - dependencies: [ - .product(name: "OpenSwiftUI", package: "OpenSwiftUI"), - ], - path: "Example", - sources: ["ExampleApp.swift", "ContentView.swift"] -) - -let package = Package( - name: "Example", - platforms: [ - .macOS(.v10_15), - .iOS(.v13), - ], - products: [.executable(name: "Example", targets: ["Example"])], - dependencies: [ - .package(path: "../"), - .package(path: "../../OpenAttributeGraph") - ], - targets: [ - exampleTarget, - ] -) - -func envEnable(_ key: String, default defaultValue: Bool = false) -> Bool { - guard let value = ProcessInfo.processInfo.environment[key] else { - return defaultValue - } - if value == "1" { - return true - } else if value == "0" { - return false - } else { - return defaultValue - } -} - -#if os(macOS) -let attributeGraphCondition = envEnable("OPENATTRIBUTEGRAPH_ATTRIBUTEGRAPH", default: true) -#else -let attributeGraphCondition = envEnable("OPENATTRIBUTEGRAPH_ATTRIBUTEGRAPH") -#endif - -extension Target { - func addAGSettings() { - // FIXME: Weird SwiftPM behavior for binary Target. Otherwize we'll get the following error message - // "could not determine executable path for bundle 'AttributeGraph.framework'" - dependencies.append(.product(name: "AttributeGraph", package: "OpenAttributeGraph")) - - var swiftSettings = swiftSettings ?? [] - swiftSettings.append(.define("OPENSWIFTUI_ATTRIBUTEGRAPH")) - self.swiftSettings = swiftSettings - } -} - -if attributeGraphCondition { - exampleTarget.addAGSettings() -} diff --git a/Example/Project.swift b/Example/Project.swift new file mode 100644 index 000000000..71208de95 --- /dev/null +++ b/Example/Project.swift @@ -0,0 +1,436 @@ +import ProjectDescription + +// MARK: - Constants + +let destinations: Destinations = [.iPhone, .iPad, .mac, .appleVision] + +let deploymentTargets = DeploymentTargets.multiplatform( + iOS: "18.0", + macOS: "15.0", + visionOS: "2.0" +) + +let openSwiftUIDebug = ConfigurationName.configuration("OpenSwiftUIDebug") +let openSwiftUIRelease = ConfigurationName.configuration("OpenSwiftUIRelease") +let swiftUIDebug = ConfigurationName.configuration("SwiftUIDebug") +let swiftUIRelease = ConfigurationName.configuration("SwiftUIRelease") + +let projectConfigurations: [Configuration] = [ + .debug(name: swiftUIDebug, xcconfig: "../Configurations/Shared/SwiftUI-debug.xcconfig"), + .release(name: swiftUIRelease, xcconfig: "../Configurations/Shared/SwiftUI-release.xcconfig"), + .debug(name: openSwiftUIDebug, xcconfig: "../Configurations/Shared/OpenSwiftUI-debug.xcconfig"), + .release(name: openSwiftUIRelease, xcconfig: "../Configurations/Shared/OpenSwiftUI-release.xcconfig"), +] + +let swiftUIModeSettings: SettingsDictionary = [ + "OPENSWIFTUI_TARGET_BUNDLE_ID": "SwiftUI", + "SWIFT_VERSION": "5.0", +] + +let openSwiftUIModeSettings: SettingsDictionary = [ + "GCC_PREPROCESSOR_DEFINITIONS": "$(inherited) OPENSWIFTUI=1", + "OPENSWIFTUI_TARGET_BUNDLE_ID": "OpenSwiftUI", + "SWIFT_ACTIVE_COMPILATION_CONDITIONS": "$(inherited) OPENSWIFTUI", + "SWIFT_VERSION": "5.0", +] + +let debugModeSettings: SettingsDictionary = [ + "ENABLE_TESTABILITY": "YES", + "GCC_PREPROCESSOR_DEFINITIONS": "$(inherited) DEBUG=1", + "SWIFT_ACTIVE_COMPILATION_CONDITIONS": "$(inherited) DEBUG", + "SWIFT_COMPILATION_MODE": "singlefile", + "SWIFT_OPTIMIZATION_LEVEL": "-Onone", +] + +let openSwiftUIDebugModeSettings = openSwiftUIModeSettings.merging([ + "ENABLE_TESTABILITY": "YES", + "GCC_PREPROCESSOR_DEFINITIONS": "$(inherited) OPENSWIFTUI=1 DEBUG=1", + "SWIFT_ACTIVE_COMPILATION_CONDITIONS": "$(inherited) OPENSWIFTUI DEBUG", + "SWIFT_COMPILATION_MODE": "singlefile", + "SWIFT_OPTIMIZATION_LEVEL": "-Onone", +]) + +func targetConfigurations(_ xcconfig: Path) -> [Configuration] { + [ + .debug(name: swiftUIDebug, settings: swiftUIModeSettings.merging(debugModeSettings), xcconfig: xcconfig), + .release(name: swiftUIRelease, settings: swiftUIModeSettings, xcconfig: xcconfig), + .debug(name: openSwiftUIDebug, settings: openSwiftUIDebugModeSettings, xcconfig: xcconfig), + .release(name: openSwiftUIRelease, settings: openSwiftUIModeSettings, xcconfig: xcconfig), + ] +} + +func settings(base: SettingsDictionary = [:], xcconfig: Path) -> Settings { + .settings( + base: base, + configurations: targetConfigurations(xcconfig), + defaultSettings: .none, + defaultConfiguration: "OpenSwiftUIDebug" + ) +} + +let commonAppSettings: SettingsDictionary = [ + "ASSETCATALOG_COMPILER_APPICON_NAME": "AppIcon", + "ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME": "AccentColor", + "CODE_SIGN_STYLE": "Automatic", + "DEVELOPMENT_TEAM": "", + "ENABLE_PREVIEWS": "YES", + "GENERATE_INFOPLIST_FILE": "YES", + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]": "YES", + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]": "YES", + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]": "YES", + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]": "YES", + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]": "YES", + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]": "YES", + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]": "UIStatusBarStyleDefault", + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]": "UIStatusBarStyleDefault", + "INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad": "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight", + "INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone": "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight", + "FRAMEWORK_SEARCH_PATHS": [ + "$(inherited)", + "$(BUILD_DIR)/Debug$(EFFECTIVE_PLATFORM_NAME)", + "$(BUILD_DIR)/Release$(EFFECTIVE_PLATFORM_NAME)", + ], + "LD_RUNPATH_SEARCH_PATHS": [ + "@executable_path/Frameworks", + ], + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]": "@executable_path/../Frameworks", + "LIBRARY_SEARCH_PATHS": [ + "$(inherited)", + "$(BUILD_DIR)/Debug$(EFFECTIVE_PLATFORM_NAME)", + "$(BUILD_DIR)/Release$(EFFECTIVE_PLATFORM_NAME)", + ], + "SDKROOT": "auto", + "SUPPORTED_PLATFORMS": "iphoneos iphonesimulator macosx xros xrsimulator", + "SUPPORTS_MACCATALYST": "NO", + "SWIFT_EMIT_LOC_STRINGS": "YES", + "SWIFT_INCLUDE_PATHS": [ + "$(inherited)", + "$(SRCROOT)/Modules/Platform/cocoa", + ], + "SWIFT_VERSION": "5.0", + "TARGETED_DEVICE_FAMILY": "1,2,7", +] + +let exampleSettings = commonAppSettings.merging([ + "ENABLE_HARDENED_RUNTIME": "YES", +]) + +let hostingExampleSettings = commonAppSettings.merging([ + "CLANG_ENABLE_MODULES": "YES", + "GENERATE_INFOPLIST_FILE": "YES", + "INFOPLIST_FILE": "HostingExample/Info.plist", + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents": "YES", + "INFOPLIST_KEY_UILaunchStoryboardName": "LaunchScreen", + "INFOPLIST_KEY_UIMainStoryboardFile": "Main", + "LD_RUNPATH_SEARCH_PATHS": [ + "$(inherited)", + "@executable_path/Frameworks", + ], + "REGISTER_APP_GROUPS": "NO", + "SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD": "NO", + "SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD": "NO", + "SWIFT_OPTIMIZATION_LEVEL": "-Onone", + "XROS_DEPLOYMENT_TARGET": "2.0", +]) + +let testingHostSettings = commonAppSettings.merging([ + "REGISTER_APP_GROUPS": "YES", +]) + +let uiTestsSettings: SettingsDictionary = [ + "BUNDLE_LOADER": "$(TEST_HOST)", + "CODE_SIGN_STYLE": "Automatic", + "FRAMEWORK_SEARCH_PATHS": [ + "$(inherited)", + "$(BUILD_DIR)/Debug$(EFFECTIVE_PLATFORM_NAME)", + "$(BUILD_DIR)/Release$(EFFECTIVE_PLATFORM_NAME)", + ], + "GENERATE_INFOPLIST_FILE": "YES", + "LIBRARY_SEARCH_PATHS": [ + "$(inherited)", + "$(BUILD_DIR)/Debug$(EFFECTIVE_PLATFORM_NAME)", + "$(BUILD_DIR)/Release$(EFFECTIVE_PLATFORM_NAME)", + ], + "LOCALIZATION_PREFERS_STRING_CATALOGS": "YES", + "SDKROOT": "auto", + "SUPPORTED_PLATFORMS": "iphoneos iphonesimulator macosx xros xrsimulator", + "SUPPORTS_MACCATALYST": "NO", + "SWIFT_EMIT_LOC_STRINGS": "NO", + "SWIFT_INCLUDE_PATHS": [ + "$(inherited)", + "$(SRCROOT)/Modules/Platform/cocoa", + ], + "SWIFT_OBJC_BRIDGING_HEADER": "OpenSwiftUIUITests/OpenSwiftUIUITests-Bridging-Header.h", + "SWIFT_VERSION": "5.0", + "TARGETED_DEVICE_FAMILY": "1,2,7", + "TEST_HOST": "$(BUILT_PRODUCTS_DIR)/TestingHost.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/TestingHost", +] + +let sharedSources: SourceFilesList = [ + "Shared/**/*.swift", +] + +let sharedResources: ResourceFileElements = [ + "Shared/Assets/Assets.xcassets", + "Shared/Assets/images/**", +] + +let privateFrameworkDependencies: [TargetDependency] = [ + .external(name: "AttributeGraph"), + .external(name: "RenderBox"), + .external(name: "CoreUI"), + .external(name: "CoreSVG"), + .external(name: "SFSymbols"), + .external(name: "BacklightServices", condition: .when([.ios, .visionos])), +] + +let appDependencies: [TargetDependency] = [ + .external(name: "OpenSwiftUI"), + .external(name: "Equatable"), +] + privateFrameworkDependencies + +let testArguments = Arguments.arguments( + environmentVariables: [ + "SNAPSHOT_REFERENCE_DIR": .environmentVariable( + value: "$(PROJECT_DIR)/ReferenceImages", + isEnabled: true + ), + "SWIFTUI_PRINT_TREE": .environmentVariable(value: "1", isEnabled: false), + ] +) + +let launchArguments = Arguments.arguments( + environmentVariables: [ + "SWIFTUI_PRINT_TREE": .environmentVariable(value: "1", isEnabled: false), + ] +) + +let openSwiftUILaunchArguments = Arguments.arguments( + environmentVariables: [ + "OPENSWIFTUI_PRINT_TREE": .environmentVariable(value: "1", isEnabled: false), + "SWIFTUI_PRINT_TREE": .environmentVariable(value: "1", isEnabled: false), + ] +) + +let openSwiftUIHostingLaunchArguments = Arguments.arguments( + environmentVariables: [ + "SWIFTUI_PRINT_TREE": .environmentVariable(value: "1", isEnabled: false), + "OPENSWIFTUI_PRINT_TREE": .environmentVariable(value: "1", isEnabled: false), + ] +) + +let swiftUIHostingLaunchArguments = Arguments.arguments( + environmentVariables: [ + "SWIFTUI_PRINT_TREE": .environmentVariable(value: "1", isEnabled: false), + "AG_PRINT_CYCLES": .environmentVariable(value: "2", isEnabled: false), + "AG_TRAP_CYCLES": .environmentVariable(value: "1", isEnabled: false), + "OPENSWIFTUI_PRINT_TREE": .environmentVariable(value: "1", isEnabled: false), + ] +) + +// MARK: - Targets + +let targets: [Target] = [ + .target( + name: "Example", + destinations: destinations, + product: .app, + bundleId: "org.OpenSwiftUIProject.$(OPENSWIFTUI_TARGET_BUNDLE_ID).Example", + deploymentTargets: deploymentTargets, + infoPlist: .extendingDefault(with: [:]), + sources: [ + "Example/**/*.swift", + "Shared/**/*.swift", + ], + resources: sharedResources, + entitlements: "Example/Example.entitlements", + dependencies: appDependencies, + settings: settings(base: exampleSettings, xcconfig: "../Configurations/Example.xcconfig") + ), + .target( + name: "HostingExample", + destinations: destinations, + product: .app, + bundleId: "org.OpenSwiftUIProject.$(OPENSWIFTUI_TARGET_BUNDLE_ID).HostingExample", + deploymentTargets: deploymentTargets, + infoPlist: "HostingExample/Info.plist", + sources: [ + .glob("HostingExample/**/*.swift"), + .glob("Shared/**/*.swift"), + ], + resources: [ + "HostingExample/Base.lproj/**", + "Shared/Assets/Assets.xcassets", + "Shared/Assets/images/**", + ], + dependencies: appDependencies, + settings: settings(base: hostingExampleSettings, xcconfig: "../Configurations/HostingExample.xcconfig") + ), + .target( + name: "TestingHost", + destinations: destinations, + product: .app, + bundleId: "org.OpenSwiftUIProject.$(OPENSWIFTUI_TARGET_BUNDLE_ID).TestingHost", + deploymentTargets: deploymentTargets, + infoPlist: .extendingDefault(with: [:]), + sources: [ + "TestingHost/**/*.swift", + "Shared/**/*.swift", + ], + resources: sharedResources, + entitlements: "TestingHost/TestingHost.entitlements", + dependencies: appDependencies, + settings: settings(base: testingHostSettings, xcconfig: "../Configurations/TestingHost.xcconfig") + ), + .target( + name: "OpenSwiftUIUITests", + destinations: destinations, + product: .unitTests, + bundleId: "org.OpenSwiftUIProject.$(OPENSWIFTUI_TARGET_BUNDLE_ID).OpenSwiftUIUITests", + deploymentTargets: deploymentTargets, + infoPlist: .default, + sources: [ + "OpenSwiftUIUITests/**/*.swift", + "OpenSwiftUIUITests/**/*.m", + "OpenSwiftUIUITests/**/*.c", + ], + dependencies: [ + .target(name: "TestingHost"), + .external(name: "SnapshotTesting"), + .external(name: "Equatable"), + ] + privateFrameworkDependencies, + settings: settings(base: uiTestsSettings, xcconfig: "../Configurations/OpenSwiftUIUITests.xcconfig") + ), +] + +// MARK: - Schemes + +func scheme( + name: String, + target: TargetReference, + debugConfiguration: ConfigurationName, + releaseConfiguration: ConfigurationName, + testableTargets: [TestableTarget] = [ + .testableTarget(target: "OpenSwiftUIUITests", parallelization: .enabled), + ], + includeTestAction: Bool = true, + runArguments: Arguments = launchArguments +) -> Scheme { + .scheme( + name: name, + shared: true, + buildAction: .buildAction(targets: [target]), + testAction: includeTestAction + ? .targets( + testableTargets, + arguments: testArguments, + configuration: debugConfiguration, + expandVariableFromTarget: "TestingHost" + ) + : nil, + runAction: .runAction( + configuration: debugConfiguration, + executable: .executable(target), + arguments: runArguments + ), + archiveAction: .archiveAction(configuration: releaseConfiguration), + profileAction: .profileAction( + configuration: releaseConfiguration, + executable: .executable(target) + ), + analyzeAction: .analyzeAction(configuration: debugConfiguration) + ) +} + +let schemes: [Scheme] = [ + scheme( + name: "OSUI_Example", + target: "Example", + debugConfiguration: openSwiftUIDebug, + releaseConfiguration: openSwiftUIRelease, + runArguments: openSwiftUILaunchArguments + ), + scheme( + name: "SUI_Example", + target: "Example", + debugConfiguration: swiftUIDebug, + releaseConfiguration: swiftUIRelease + ), + scheme( + name: "OSUI_HostingExample", + target: "HostingExample", + debugConfiguration: openSwiftUIDebug, + releaseConfiguration: openSwiftUIRelease, + testableTargets: [], + runArguments: openSwiftUIHostingLaunchArguments + ), + scheme( + name: "SUI_HostingExample", + target: "HostingExample", + debugConfiguration: swiftUIDebug, + releaseConfiguration: swiftUIRelease, + testableTargets: [], + runArguments: swiftUIHostingLaunchArguments + ), + scheme( + name: "OSUI_TestingHost", + target: "TestingHost", + debugConfiguration: openSwiftUIDebug, + releaseConfiguration: openSwiftUIRelease, + includeTestAction: false + ), + scheme( + name: "SUI_TestingHost", + target: "TestingHost", + debugConfiguration: swiftUIDebug, + releaseConfiguration: swiftUIRelease, + includeTestAction: false + ), + .scheme( + name: "OSUI_UITests", + shared: true, + buildAction: .buildAction(targets: ["OpenSwiftUIUITests"]), + testAction: .targets( + [.testableTarget(target: "OpenSwiftUIUITests", parallelization: .enabled)], + arguments: testArguments, + configuration: openSwiftUIDebug, + expandVariableFromTarget: "TestingHost" + ), + analyzeAction: .analyzeAction(configuration: openSwiftUIDebug) + ), + .scheme( + name: "SUI_UITests", + shared: true, + buildAction: .buildAction(targets: ["OpenSwiftUIUITests"]), + testAction: .targets( + [.testableTarget(target: "OpenSwiftUIUITests", parallelization: .enabled)], + arguments: testArguments, + configuration: swiftUIDebug, + expandVariableFromTarget: "TestingHost" + ), + analyzeAction: .analyzeAction(configuration: swiftUIDebug) + ), +] + +// MARK: - Project + +let project = Project( + name: "Example", + options: .options( + automaticSchemesOptions: .disabled, + developmentRegion: "en" + ), + settings: .settings( + configurations: projectConfigurations, + defaultSettings: .none, + defaultConfiguration: "OpenSwiftUIDebug" + ), + targets: targets, + schemes: schemes, + additionalFiles: [ + "../Configurations/**", + "Modules/**", + "ReferenceImages/**", + "OpenSwiftUIUITests/OpenSwiftUIUITests.xctestplan", + ] +) diff --git a/Example/README.md b/Example/README.md index cd09167bd..b3bec6b53 100644 --- a/Example/README.md +++ b/Example/README.md @@ -2,24 +2,20 @@ ## Pre-Requirements -Clone other components to the same directory of `OpenSwiftUI` +Run the CI setup script from the `OpenSwiftUI` repository root. It checks out the local package dependencies used by the generated Example project. ```shell -cd .. -git clone https://github.com/OpenSwiftUIProject/OpenAttributeGraph.git -git clone https://github.com/OpenSwiftUIProject/OpenRenderBox.git -git clone https://github.com/OpenSwiftUIProject/DarwinPrivateFrameworks.git +# From OpenSwiftUI/Example +../Scripts/CI/darwin_setup_build.sh ``` +`OpenCoreGraphics` and `OpenObservation` are resolved through the `OpenSwiftUI` package dependency. + ## Configure AttributeGraph Backend Since OpenAttributeGraph is not yet completed, you need to configure an AG backend before building. -Use Apple's private AttributeGraph framework (Darwin only): - -```shell -export OPENSWIFTUI_OPENATTRIBUTESHIMS_ATTRIBUTEGRAPH=1 -``` +This example defaults to Apple's private AttributeGraph framework through `mise.toml`. Or use the Compute module: @@ -28,6 +24,13 @@ export OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE=1 export OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE_USE_BINARY=1 ``` +## Generate Project + +```shell +mise exec -- tuist install +mise exec -- tuist generate --no-open +``` + ## Example A OpenSwiftUI/SwiftUI `App` lifecycle example. diff --git a/Example/Tuist.swift b/Example/Tuist.swift new file mode 100644 index 000000000..9492042f4 --- /dev/null +++ b/Example/Tuist.swift @@ -0,0 +1,14 @@ +import ProjectDescription + +let tuist = Tuist( + project: .tuist( + generationOptions: .options( + manifestEnvironment: [ + "DARWINPRIVATEFRAMEWORKS_*", + "OPENATTRIBUTEGRAPH_*", + "OPENRENDERBOX_*", + "OPENSWIFTUI_*", + ] + ) + ) +) diff --git a/Example/Tuist/Package.resolved b/Example/Tuist/Package.resolved new file mode 100644 index 000000000..b2741d55c --- /dev/null +++ b/Example/Tuist/Package.resolved @@ -0,0 +1,96 @@ +{ + "originHash" : "154116076f9106391f665916f636f6142e20264d7bdbff93d21cf58c63c1c2fc", + "pins" : [ + { + "identity" : "equatable", + "kind" : "remoteSourceControl", + "location" : "https://github.com/OpenSwiftUIProject/equatable.git", + "state" : { + "branch" : "main", + "revision" : "8f1dccead65d97173ed695c6c1ba9d0570d35619" + } + }, + { + "identity" : "opencoregraphics", + "kind" : "remoteSourceControl", + "location" : "https://github.com/OpenSwiftUIProject/OpenCoreGraphics", + "state" : { + "branch" : "main", + "revision" : "050239bd42b19a4c8b1ef3936bfb9f3589ecfc46" + } + }, + { + "identity" : "openobservation", + "kind" : "remoteSourceControl", + "location" : "https://github.com/OpenSwiftUIProject/OpenObservation", + "state" : { + "branch" : "main", + "revision" : "05e0581e76b7153338836469320a4789fd0257e2" + } + }, + { + "identity" : "swift-collections", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-collections", + "state" : { + "revision" : "03cc312c2c933ed87abace34044a5dff7a3117c1", + "version" : "1.5.0" + } + }, + { + "identity" : "swift-custom-dump", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-custom-dump", + "state" : { + "revision" : "06c57924455064182d6b217f06ebc05d00cb2990", + "version" : "1.5.0" + } + }, + { + "identity" : "swift-numerics", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-numerics", + "state" : { + "revision" : "0c0290ff6b24942dadb83a929ffaaa1481df04a2", + "version" : "1.1.1" + } + }, + { + "identity" : "swift-snapshot-testing", + "kind" : "remoteSourceControl", + "location" : "https://github.com/OpenSwiftUIProject/swift-snapshot-testing", + "state" : { + "revision" : "6456a4fd141fa6ae4aedfb433987038293220cfd", + "version" : "1.18.9-osui" + } + }, + { + "identity" : "swift-syntax", + "kind" : "remoteSourceControl", + "location" : "https://github.com/swiftlang/swift-syntax", + "state" : { + "revision" : "f99ae8aa18f0cf0d53481901f88a0991dc3bd4a2", + "version" : "601.0.1" + } + }, + { + "identity" : "symbollocator", + "kind" : "remoteSourceControl", + "location" : "https://github.com/OpenSwiftUIProject/SymbolLocator.git", + "state" : { + "revision" : "546053c03f282df1a8270853da6692e1b078be09", + "version" : "0.2.1" + } + }, + { + "identity" : "xctest-dynamic-overlay", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/xctest-dynamic-overlay", + "state" : { + "revision" : "dfd70507def84cb5fb821278448a262c6ff2bbad", + "version" : "1.9.0" + } + } + ], + "version" : 3 +} diff --git a/Example/Tuist/Package.swift b/Example/Tuist/Package.swift new file mode 100644 index 000000000..ac4bbdabe --- /dev/null +++ b/Example/Tuist/Package.swift @@ -0,0 +1,79 @@ +// swift-tools-version: 6.1 + +import PackageDescription + +let package = Package( + name: "ExampleDependencies", + dependencies: [ + .package(path: "../../"), + .package(path: "../../../OpenAttributeGraph"), + .package(path: "../../../OpenRenderBox"), + .package(path: "../../../DarwinPrivateFrameworks"), + .package(url: "https://github.com/apple/swift-collections", from: "1.1.0"), + .package(url: "https://github.com/apple/swift-numerics", from: "1.0.3"), + .package(url: "https://github.com/swiftlang/swift-syntax.git", from: "601.0.0"), + .package(url: "https://github.com/OpenSwiftUIProject/equatable.git", branch: "main"), + .package(url: "https://github.com/OpenSwiftUIProject/SymbolLocator.git", from: "0.2.0"), + .package(url: "https://github.com/OpenSwiftUIProject/swift-snapshot-testing", exact: "1.18.9-osui"), + ] +) + +#if TUIST +import ProjectDescription + +let examplePackageDestinations: Destinations = [.iPhone, .iPad, .mac, .appleVision] +let openSwiftUIPackageDebugSettings: SettingsDictionary = [ + "SWIFT_COMPILATION_MODE": "singlefile", + "SWIFT_OPTIMIZATION_LEVEL": "-Onone", +] +let openSwiftUIPackageReleaseSettings: SettingsDictionary = [ + "SWIFT_COMPILATION_MODE": "wholemodule", + "SWIFT_OPTIMIZATION_LEVEL": "-O", +] +let openSwiftUIPackageConfigurations: [Configuration] = [ + .debug(name: "SwiftUIDebug", settings: openSwiftUIPackageDebugSettings), + .release(name: "SwiftUIRelease", settings: openSwiftUIPackageReleaseSettings), + .debug(name: "OpenSwiftUIDebug", settings: openSwiftUIPackageDebugSettings), + .release(name: "OpenSwiftUIRelease", settings: openSwiftUIPackageReleaseSettings), +] +let openSwiftUITargetSettings: SettingsDictionary = [ + "DYLIB_INSTALL_NAME_BASE": "@rpath", +] + +let packageSettings = PackageSettings( + productTypes: [ + "OpenSwiftUI": ProjectDescription.Product.framework, + "OpenSwiftUICore": ProjectDescription.Product.staticFramework, + "OpenSwiftUI_SPI": ProjectDescription.Product.staticFramework, + "COpenSwiftUI": ProjectDescription.Product.staticFramework, + "OpenSwiftUIMacros": ProjectDescription.Product.macro, + "OpenSwiftUITestsSupport": ProjectDescription.Product.staticFramework, + "OpenSwiftUISymbolDualTestsSupport": ProjectDescription.Product.staticFramework, + "OpenAttributeGraphShims": ProjectDescription.Product.staticFramework, + "OpenCoreGraphicsShims": ProjectDescription.Product.staticFramework, + "OpenObservation": ProjectDescription.Product.staticFramework, + "OpenQuartzCoreShims": ProjectDescription.Product.staticFramework, + "OpenRenderBoxShims": ProjectDescription.Product.staticFramework, + "SymbolLocator": ProjectDescription.Product.staticFramework, + ], + productDestinations: [ + "OpenSwiftUI": examplePackageDestinations, + "OpenSwiftUICore": examplePackageDestinations, + "OpenSwiftUI_SPI": examplePackageDestinations, + "OpenSwiftUIExtension": examplePackageDestinations, + "OpenSwiftUIBridge": examplePackageDestinations, + "OpenAttributeGraph": examplePackageDestinations, + "OpenAttributeGraphShims": examplePackageDestinations, + "OpenRenderBox": examplePackageDestinations, + "OpenRenderBoxShims": examplePackageDestinations, + ], + baseSettings: .settings( + configurations: openSwiftUIPackageConfigurations, + defaultSettings: .none, + defaultConfiguration: "OpenSwiftUIDebug" + ), + targetSettings: [ + "OpenSwiftUI": .settings(base: openSwiftUITargetSettings), + ] +) +#endif diff --git a/Example/mise.toml b/Example/mise.toml new file mode 100644 index 000000000..0d1961104 --- /dev/null +++ b/Example/mise.toml @@ -0,0 +1,7 @@ +[tools] +tuist = "4.193.0" + +[env] +OPENSWIFTUI_USE_LOCAL_DEPS = "0" +OPENSWIFTUI_OPENATTRIBUTESHIMS_ATTRIBUTEGRAPH = "1" +OPENSWIFTUI_LINK_BACKLIGHTSERVICES = "1"