From fd1e57b0c051e2a809ae7972e3eafcae5fe160fa Mon Sep 17 00:00:00 2001 From: Christian Falch Date: Wed, 19 Mar 2025 05:07:36 -0700 Subject: [PATCH] moved resources to correct location (#50101) Summary: In the final XCFramework we no longer need to place resource bundles in a subfolder called Resources - they should be located directly in the framework folder. This commit fixes this by removing copying to the Resources folder. I also removed a few unneeded tests since we know that we are in a valid folder at this point. bypass-github-export-checks ## Changelog: [INTERNAL] - Moved resource bundles up one level Pull Request resolved: https://github.com/facebook/react-native/pull/50101 Test Plan: Run RNTester with RCT_USE_RN_DEP=1 and verify that it launches Reviewed By: cortinico Differential Revision: D71464608 Pulled By: cipolleschi fbshipit-source-id: 6cfdda0c6785ffeb13c170f9fd2dd9f5b889d490 --- .github/workflows/prebuild-ios.yml | 12 ++++++------ scripts/releases/ios-prebuild/compose-framework.js | 11 +---------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/.github/workflows/prebuild-ios.yml b/.github/workflows/prebuild-ios.yml index 213475eec56..56f15777fa8 100644 --- a/.github/workflows/prebuild-ios.yml +++ b/.github/workflows/prebuild-ios.yml @@ -18,7 +18,7 @@ jobs: uses: actions/cache/restore@v4 with: path: packages/react-native/third-party/ - key: v1-ios-dependencies-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }} + key: v2-ios-dependencies-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }} enableCrossOsArchive: true - name: Yarn Install if: steps.restore-ios-prebuilds.outputs.cache-hit != 'true' @@ -40,7 +40,7 @@ jobs: uses: actions/cache/save@v4 if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode with: - key: v1-ios-dependencies-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }} + key: v2-ios-dependencies-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }} enableCrossOsArchive: true path: packages/react-native/third-party/ @@ -74,7 +74,7 @@ jobs: uses: actions/cache/restore@v4 with: path: packages/react-native/third-party/.build/Build/Products - key: v1-ios-dependencies-slice-folder-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }} + key: v2-ios-dependencies-slice-folder-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }} - name: Yarn Install if: steps.restore-slice-folder.outputs.cache-hit != 'true' uses: ./.github/actions/yarn-install @@ -107,7 +107,7 @@ jobs: uses: actions/cache/save@v4 if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode with: - key: v1-ios-dependencies-slice-folder-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }} + key: v2-ios-dependencies-slice-folder-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }} enableCrossOsArchive: true path: | packages/react-native/third-party/.build/Build/Products @@ -138,7 +138,7 @@ jobs: with: path: | packages/react-native/third-party/ - key: v1-ios-dependencies-xcframework-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }} + key: v2-ios-dependencies-xcframework-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }} # If cache hit, we already have our binary. We don't need to do anything. - name: Yarn Install if: steps.restore-xcframework.outputs.cache-hit != 'true' @@ -199,4 +199,4 @@ jobs: path: | packages/react-native/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework.tar.gz packages/react-native/third-party/ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz - key: v1-ios-dependencies-xcframework-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }} + key: v2-ios-dependencies-xcframework-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }} diff --git a/scripts/releases/ios-prebuild/compose-framework.js b/scripts/releases/ios-prebuild/compose-framework.js index 02f24ac51fd..51197541de9 100644 --- a/scripts/releases/ios-prebuild/compose-framework.js +++ b/scripts/releases/ios-prebuild/compose-framework.js @@ -149,19 +149,10 @@ function copyBundles( const targetBundlePath = path.join( targetArchFolder, `${scheme}.framework`, - 'Resources', bundleName, ); - if ( - !fs.existsSync(path.join(targetArchFolder, `${scheme}.framework`)) - ) { - console.warn("Target Bundle path doesn't exist", targetBundlePath); - } - if (!fs.existsSync(path.dirname(sourceBundlePath))) { - console.warn("Source bundle doesn't exist", sourceBundlePath); - } + // A bundle is a directory, so we need to copy the whole directory - execSync(`mkdir -p "${targetBundlePath}"`); execSync(`cp -r "${sourceBundlePath}/" "${targetBundlePath}"`); }); } else {