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
8 changes: 4 additions & 4 deletions .github/workflows/prebuild-ios-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
id: restore-ios-slice
uses: actions/cache/restore@v4
with:
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift') }}-${{ hashFiles('packages/react-native/scripts/ios-prebuild/setup.js') }}
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
path: packages/react-native/
- name: Setup node.js
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:
uses: actions/cache/save@v4
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode
with:
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift') }}-${{ hashFiles('packages/react-native/scripts/ios-prebuild/setup.js') }}
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
path: |
packages/react-native/.build/output/spm/${{ matrix.flavor }}/Build/Products
packages/react-native/.build/headers
Expand All @@ -140,7 +140,7 @@ jobs:
uses: actions/cache/restore@v4
with:
path: packages/react-native/.build/output/xcframeworks
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift') }}-${{ hashFiles('packages/react-native/scripts/ios-prebuild/setup.js') }}
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
- name: Setup node.js
if: steps.restore-ios-xcframework.outputs.cache-hit != 'true'
uses: ./.github/actions/setup-node
Expand Down Expand Up @@ -209,4 +209,4 @@ jobs:
path: |
packages/react-native/.build/output/xcframeworks/ReactCore${{matrix.flavor}}.xcframework.tar.gz
packages/react-native/.build/output/xcframeworks/ReactCore${{matrix.flavor}}.framework.dSYM.tar.gz
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift') }}-${{ hashFiles('packages/react-native/scripts/ios-prebuild/setup.js') }}
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ end

header_search_paths = [
"\"${PODS_ROOT}/Headers/Public/ReactCodegen/react/renderer/components\"",
"\"${PODS_ROOT}/Headers/Public/React-RCTFBReactNativeSpec/FBReactNativeSpec\"",
]

Pod::Spec.new do |s|
Expand Down Expand Up @@ -46,7 +45,7 @@ Pod::Spec.new do |s|
s.dependency "React-Core/RCTPushNotificationHeaders"
s.dependency "React-jsi"

add_dependency(s, "React-RCTFBReactNativeSpec", :additional_framework_paths => ['FBReactNativeSpec'])
add_dependency(s, "React-RCTFBReactNativeSpec")
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
add_dependency(s, "React-NativeModulesApple")

Expand Down
6 changes: 6 additions & 0 deletions packages/react-native/scripts/ios-prebuild/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

/*:: import type {BuildFlavor} from './types'; */

const {
generateFBReactNativeSpecIOS,
} = require('../codegen/generate-artifacts-executor/generateFBReactNativeSpecIOS');
const {prepareHermesArtifactsAsync} = require('./hermes');
const {
prepareReactNativeDependenciesArtifactsAsync,
Expand All @@ -25,6 +28,9 @@ async function setup(
currentVersion /*: string */,
buildType /*: BuildFlavor */,
) {
// First of all, let's run codegen to make sure that we have the FBreactNativeSpec files in the prebuilds
generateFBReactNativeSpecIOS('.');

const prebuildLog = createLogger('prebuild');
createFolderIfNotExists(buildFolder);

Expand Down
14 changes: 13 additions & 1 deletion packages/react-native/scripts/ios-prebuild/xcframework.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

/*:: import type {BuildFlavor} from './types'; */

const {
generateFBReactNativeSpecIOS,
} = require('../codegen/generate-artifacts-executor/generateFBReactNativeSpecIOS');
const headers = require('./headers');
const utils = require('./utils');
const childProcess = require('child_process');
Expand Down Expand Up @@ -49,6 +52,9 @@ function buildXCFrameworks(
buildType /*: BuildFlavor */,
identity /*: ?string */,
) {
// Let's run codegen for FBReactNativeSpec otherwise some headers will be missing
generateFBReactNativeSpecIOS('.');

const outputPath = path.join(
buildFolder,
'output',
Expand Down Expand Up @@ -106,10 +112,16 @@ function buildXCFrameworks(
if (headerFiles.length > 0) {
// Get podspec name without directory and extension and make sure it is a valid identifier
// by replacing any non-alphanumeric characters with an underscore.
const podSpecName = path
let podSpecName = path
.basename(podspec, '.podspec')
.replace(/[^a-zA-Z0-9_]/g, '_');

// Fix for FBReactNativeSpec. RN expect FBReactNative spec headers
// To be in a folder named FBReactNativeSpec.
if (podSpecName === 'React_RCTFBReactNativeSpec') {
podSpecName = 'FBReactNativeSpec';
}

// Create a folder for the podspec in the output headers path
const podSpecFolder = path.join(outputHeadersPath, podSpecName);
createFolderIfNotExists(podSpecFolder);
Expand Down
Loading