diff --git a/.github/workflows/compatibility_tests.yml b/.github/workflows/compatibility_tests.yml index d314c137..4e1b141e 100644 --- a/.github/workflows/compatibility_tests.yml +++ b/.github/workflows/compatibility_tests.yml @@ -22,6 +22,11 @@ jobs: OPENSWIFTUI_SWIFT_LOG: 0 OPENSWIFTUI_SWIFT_CRYPTO: 0 OPENSWIFTUI_TARGET_RELEASE: ${{ matrix.release }} + OPENSWIFTUI_USE_LOCAL_DEPS: 1 + OPENGRAPH_USE_LOCAL_DEPS: 1 + OPENGRAPH_TARGET_RELEASE: ${{ matrix.release }} + DARWIN_PRIVATE_FRAMEWORKS_TARGET_RELEASE: ${{ matrix.release }} + GH_TOKEN: ${{ github.token }} steps: - uses: actions/checkout@v4 - name: Setup Xcode @@ -30,6 +35,9 @@ jobs: xcode-version: ${{ matrix.xcode-version }} - name: Swift version run: swift --version + - name: Set up build environment + run: Scripts/CI/darwin_setup_build.sh + shell: bash - name: Run compatibility tests on OpenSwiftUI + macOS run: | swift test \ @@ -64,6 +72,11 @@ jobs: OPENSWIFTUI_SWIFT_CRYPTO: 0 OPENSWIFTUI_TARGET_RELEASE: ${{ matrix.release }} OPENSWIFTUI_SUPPORT_MULTI_PRODUCTS: 0 + OPENSWIFTUI_USE_LOCAL_DEPS: 1 + OPENGRAPH_USE_LOCAL_DEPS: 1 + OPENGRAPH_TARGET_RELEASE: ${{ matrix.release }} + DARWIN_PRIVATE_FRAMEWORKS_TARGET_RELEASE: ${{ matrix.release }} + GH_TOKEN: ${{ github.token }} steps: - uses: actions/checkout@v4 - name: Setup Xcode @@ -72,6 +85,9 @@ jobs: xcode-version: ${{ matrix.xcode-version }} - name: Swift version run: swift --version + - name: Set up build environment + run: Scripts/CI/darwin_setup_build.sh + shell: bash - name: Run compatibility tests on OpenSwiftUI + iOS run: | # FIXME: xcodebuild will run all test targets. diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index ee66173f..9af05e52 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -27,10 +27,11 @@ jobs: OPENSWIFTUI_SWIFT_LOG: 0 OPENSWIFTUI_SWIFT_CRYPTO: 0 OPENSWIFTUI_TARGET_RELEASE: ${{ matrix.release }} - OPENSWIFTUI_USE_LOCAL_DEPS: 1 OPENSWIFTUI_SUPPORT_MULTI_PRODUCTS: 0 + OPENSWIFTUI_USE_LOCAL_DEPS: 1 + OPENGRAPH_USE_LOCAL_DEPS: 1 OPENGRAPH_TARGET_RELEASE: ${{ matrix.release }} - OPENGRAPH_ATTRIBUTEGRAPH_VERSION: RELEASE_${{ matrix.release }} + DARWIN_PRIVATE_FRAMEWORKS_TARGET_RELEASE: ${{ matrix.release }} GH_TOKEN: ${{ github.token }} steps: - uses: actions/checkout@v4 @@ -41,7 +42,7 @@ jobs: - name: Swift version run: swift --version - name: Set up build environment - run: Scripts/CI/macOS_setup_build.sh + run: Scripts/CI/darwin_setup_build.sh shell: bash - name: Build test target in debug mode run: | diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 17e94861..91494f24 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -24,8 +24,9 @@ jobs: OPENSWIFTUI_SWIFT_CRYPTO: 0 OPENSWIFTUI_TARGET_RELEASE: ${{ matrix.release }} OPENSWIFTUI_USE_LOCAL_DEPS: 1 + OPENGRAPH_USE_LOCAL_DEPS: 1 OPENGRAPH_TARGET_RELEASE: ${{ matrix.release }} - OPENGRAPH_ATTRIBUTEGRAPH_VERSION: RELEASE_${{ matrix.release }} + DARWIN_PRIVATE_FRAMEWORKS_TARGET_RELEASE: ${{ matrix.release }} GH_TOKEN: ${{ github.token }} steps: - uses: actions/checkout@v4 @@ -36,7 +37,7 @@ jobs: - name: Swift version run: swift --version - name: Set up build environment - run: Scripts/CI/macOS_setup_build.sh + run: Scripts/CI/darwin_setup_build.sh shell: bash - name: Build and run tests in debug mode with coverage run: | diff --git a/Package.resolved b/Package.resolved index 73f25655..5ebe8ff2 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,13 +1,22 @@ { - "originHash" : "5c37246fc3829f800b0ccd442988c364c2beeffc296cdc8b4f7ce1585eebc14a", + "originHash" : "0c4677673310eb1475283b96def29718c2f307825c2d136e0bfc40f4cd3d6920", "pins" : [ + { + "identity" : "darwinprivateframeworks", + "kind" : "remoteSourceControl", + "location" : "https://github.com/OpenSwiftUIProject/DarwinPrivateFrameworks.git", + "state" : { + "branch" : "main", + "revision" : "fc757950da6df4b1e30a3236549a27f21f82ab8a" + } + }, { "identity" : "opengraph", "kind" : "remoteSourceControl", "location" : "https://github.com/OpenSwiftUIProject/OpenGraph", "state" : { "branch" : "main", - "revision" : "074491f9950c7692142630b08b7c87b8cb682e28" + "revision" : "5eccfe5e3149b3deb4bf5b76511d2ea7f5b39b94" } }, { diff --git a/Package.swift b/Package.swift index de62ff97..b20cb1c8 100644 --- a/Package.swift +++ b/Package.swift @@ -241,7 +241,7 @@ extension Target { func addAGSettings() { // FIXME: Weird SwiftPM behavior for test Target. Otherwize we'll get the following error message // "could not determine executable path for bundle 'AttributeGraph.framework'" - dependencies.append(.product(name: "AttributeGraph", package: "OpenGraph")) + dependencies.append(.product(name: "AttributeGraph", package: "DarwinPrivateFrameworks")) var swiftSettings = swiftSettings ?? [] swiftSettings.append(.define("OPENGRAPH_ATTRIBUTEGRAPH")) self.swiftSettings = swiftSettings @@ -269,7 +269,17 @@ extension Target { } } +let useLocalDeps = envEnable("OPENSWIFTUI_USE_LOCAL_DEPS") + if attributeGraphCondition { + let privateFrameworkRepo: Package.Dependency + if useLocalDeps { + privateFrameworkRepo = Package.Dependency.package(path: "../DarwinPrivateFrameworks") + } else { + privateFrameworkRepo = Package.Dependency.package(url: "https://github.com/OpenSwiftUIProject/DarwinPrivateFrameworks.git", branch: "main") + } + package.dependencies.append(privateFrameworkRepo) + openSwiftUICoreTarget.addAGSettings() openSwiftUITarget.addAGSettings() @@ -280,6 +290,17 @@ if attributeGraphCondition { openSwiftUIBridgeTestTarget.addAGSettings() } +if useLocalDeps { + package.dependencies += [ + .package(path: "../OpenGraph"), + ] +} else { + package.dependencies += [ + // FIXME: on Linux platform: OG contains unsafe build flags which prevents us using version dependency + .package(url: "https://github.com/OpenSwiftUIProject/OpenGraph", branch: "main"), + ] +} + #if os(macOS) let openCombineCondition = envEnable("OPENSWIFTUI_OPENCOMBINE") #else @@ -328,18 +349,6 @@ if compatibilityTestCondition { openSwiftUICompatibilityTestTarget.dependencies.append("OpenSwiftUI") } -let useLocalDeps = envEnable("OPENSWIFTUI_USE_LOCAL_DEPS") -if useLocalDeps { - package.dependencies += [ - .package(path: "../OpenGraph"), - ] -} else { - package.dependencies += [ - // FIXME: on Linux platform: OG contains unsafe build flags which prevents us using version dependency - .package(url: "https://github.com/OpenSwiftUIProject/OpenGraph", branch: "main"), - ] -} - extension [Platform] { static var nonDarwinPlatforms: [Platform] { [.linux, .android, .wasi, .openbsd, .windows] diff --git a/Scripts/CI/macOS_setup_build.sh b/Scripts/CI/darwin_setup_build.sh similarity index 100% rename from Scripts/CI/macOS_setup_build.sh rename to Scripts/CI/darwin_setup_build.sh diff --git a/Scripts/CI/og_setup.sh b/Scripts/CI/og_setup.sh index d4e7967d..2e530f66 100755 --- a/Scripts/CI/og_setup.sh +++ b/Scripts/CI/og_setup.sh @@ -18,7 +18,7 @@ clone_checkout_og() { update_og() { cd $REPO_ROOT/../OpenGraph - ./AG/update.sh + ./Scripts/CI/darwin_setup_build.sh } clone_checkout_og