first commit

This commit is contained in:
2026-03-10 16:18:05 +00:00
commit 11f9c069b5
31635 changed files with 3187747 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
double_conversion_config = get_double_conversion_config()
double_conversion_git_url = double_conversion_config[:git]
Pod::Spec.new do |spec|
spec.name = 'DoubleConversion'
spec.version = '1.1.6'
spec.license = { :type => 'MIT' }
spec.homepage = 'https://github.com/google/double-conversion'
spec.summary = 'Efficient binary-decimal and decimal-binary conversion routines for IEEE doubles'
spec.authors = 'Google'
spec.prepare_command = 'mv src double-conversion'
spec.source = { :git => double_conversion_git_url,
:tag => "v#{spec.version}" }
spec.module_name = 'DoubleConversion'
spec.header_dir = 'double-conversion'
spec.source_files = 'double-conversion/*.{h,cc}'
spec.compiler_flags = '-Wno-unreachable-code'
spec.user_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/DoubleConversion\"" }
spec.pod_target_xcconfig = {
"DEFINES_MODULE" => "YES",
"GCC_WARN_INHIBIT_ALL_WARNINGS" => "YES" # Disable warnings because we don't control this library
}
# Pinning to the same version as React.podspec.
spec.platforms = min_supported_versions
end

View File

@@ -0,0 +1,132 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
folly_config = get_folly_config()
folly_config_file = folly_config[:config_file]
folly_release_version = folly_config[:version]
folly_git_url = folly_config[:git]
Pod::Spec.new do |spec|
spec.name = 'RCT-Folly'
# Patched to v2 to address https://github.com/react-native-community/releases/issues/251
spec.version = folly_release_version
spec.license = { :type => 'Apache License, Version 2.0' }
spec.homepage = 'https://github.com/facebook/folly'
spec.summary = 'An open-source C++ library developed and used at Facebook.'
spec.authors = 'Facebook'
spec.source = { :git => folly_git_url,
:tag => "v#{folly_release_version}" }
spec.module_name = 'folly'
spec.prepare_command = "echo '#{folly_config_file.join("\n")}' > folly/folly-config.h"
spec.header_mappings_dir = '.'
spec.dependency "boost"
spec.dependency "DoubleConversion"
spec.dependency "glog"
spec.dependency "fast_float", "8.0.0"
spec.dependency "fmt", "11.0.2"
spec.compiler_flags = '-Wno-documentation -faligned-new'
spec.source_files = 'folly/String.cpp',
'folly/Conv.cpp',
'folly/Demangle.cpp',
'folly/FileUtil.cpp',
'folly/Format.cpp',
'folly/lang/SafeAssert.cpp',
'folly/lang/ToAscii.cpp',
'folly/ScopeGuard.cpp',
'folly/Unicode.cpp',
'folly/json/dynamic.cpp',
'folly/json/json.cpp',
'folly/json/json_pointer.cpp',
'folly/container/detail/F14Table.cpp',
'folly/detail/Demangle.cpp',
'folly/detail/FileUtilDetail.cpp',
'folly/detail/SplitStringSimd.cpp',
'folly/detail/StaticSingletonManager.cpp',
'folly/detail/UniqueInstance.cpp',
'folly/hash/SpookyHashV2.cpp',
'folly/lang/CString.cpp',
'folly/lang/Exception.cpp',
'folly/memory/ReentrantAllocator.cpp',
'folly/memory/detail/MallocImpl.cpp',
'folly/net/NetOps.cpp',
'folly/portability/SysUio.cpp',
'folly/synchronization/SanitizeThread.cpp',
'folly/system/AtFork.cpp',
'folly/system/ThreadId.cpp',
'folly/*.h',
'folly/algorithm/simd/*.h',
'folly/algorithm/simd/detail/*.h',
'folly/chrono/*.h',
'folly/container/*.h',
'folly/container/detail/*.h',
'folly/detail/*.h',
'folly/functional/*.h',
'folly/hash/*.h',
'folly/json/*.h',
'folly/lang/*.h',
'folly/memory/*.h',
'folly/memory/detail/*.h',
'folly/net/*.h',
'folly/net/detail/*.h',
'folly/portability/*.h',
'folly/system/*.h',
# workaround for https://github.com/facebook/react-native/issues/14326
spec.preserve_paths = 'folly/*.h',
'folly/algorithm/simd/*.h',
'folly/algorithm/simd/detail/*.h',
'folly/chrono/*.h',
'folly/container/*.h',
'folly/container/detail/*.h',
'folly/detail/*.h',
'folly/functional/*.h',
'folly/hash/*.h',
'folly/json/*.h',
'folly/lang/*.h',
'folly/memory/*.h',
'folly/memory/detail/*.h',
'folly/net/*.h',
'folly/net/detail/*.h',
'folly/portability/*.h',
'folly/system/*.h',
spec.libraries = "c++abi" # NOTE Apple-only: Keep c++abi here due to https://github.com/react-native-community/releases/issues/251
spec.pod_target_xcconfig = { "USE_HEADERMAP" => "NO",
"DEFINES_MODULE" => "YES",
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fast_float/include\" \"$(PODS_ROOT)/fmt/include\"",
# In dynamic framework (use_frameworks!) mode, ignore the unused and undefined boost symbols when generating the library.
"OTHER_LDFLAGS" => "\"-Wl,-U,_jump_fcontext\" \"-Wl,-U,_make_fcontext\"",
"GCC_WARN_INHIBIT_ALL_WARNINGS" => "YES" # Disable warnings because we don't control this library
}
# TODO: The boost spec should really be selecting these files so that dependents of Folly can also access the required headers.
spec.user_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"" }
spec.default_subspec = 'Default'
spec.resource_bundles = {'RCT-Folly_privacy' => 'RCT-Folly/PrivacyInfo.xcprivacy'}
spec.subspec 'Default' do
# no-op
end
spec.subspec 'Fabric' do |fabric|
fabric.source_files = 'folly/SharedMutex.cpp',
'folly/concurrency/CacheLocality.cpp',
'folly/detail/Futex.cpp',
'folly/synchronization/ParkingLot.cpp',
'folly/concurrency/CacheLocality.h',
'folly/synchronization/*.h',
'folly/system/ThreadId.h'
fabric.preserve_paths = 'folly/concurrency/CacheLocality.h',
'folly/synchronization/*.h',
'folly/system/ThreadId.h'
end
# Folly has issues when compiled with iOS 10 set as deployment target
# See https://github.com/facebook/folly/issues/1470 for details
spec.platforms = min_supported_versions
end

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>C617.1</string>
</array>
</dict>
</array>
<key>NSPrivacyCollectedDataTypes</key>
<array/>
<key>NSPrivacyTracking</key>
<false/>
</dict>
</plist>

View File

@@ -0,0 +1,99 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
require "json"
begin
react_native_path = File.dirname(Pod::Executable.execute_command('node', ['-p',
'require.resolve(
"react-native",
{paths: [process.argv[1]]},
)', __dir__]).strip
)
rescue => e
# Fallback to the parent directory if the above command fails (e.g when building locally in OOT Platform)
react_native_path = File.join(__dir__, "..", "..")
end
# package.json
package = JSON.parse(File.read(File.join(react_native_path, "package.json")))
version = package['version']
source = ReactNativeDependenciesUtils.resolve_podspec_source()
Pod::Spec.new do |spec|
spec.name = 'ReactNativeDependencies'
spec.version = version
spec.summary = 'React Native Dependencies'
spec.description = 'ReactNativeDependencies is a podspec that contains all the third-party dependencies of React Native.'
spec.homepage = 'https://github.com/facebook/react-native'
spec.license = package['license']
spec.authors = 'meta'
spec.platforms = min_supported_versions
spec.user_target_xcconfig = {
'WARNING_CFLAGS' => '-Wno-comma -Wno-shorten-64-to-32',
}
spec.source = source
spec.preserve_paths = '**/*.*'
spec.vendored_frameworks = 'framework/packages/react-native/ReactNativeDependencies.xcframework'
spec.header_mappings_dir = 'Headers'
spec.source_files = 'Headers/**/*.{h,hpp}'
# We need to make sure that the headers are copied to the right place - local tar.gz has a different structure
# than the one from the maven repo
spec.prepare_command = <<-CMD
CURRENT_PATH=$(pwd)
mkdir -p Headers
XCFRAMEWORK_PATH=$(find "$CURRENT_PATH" -type d -name "ReactNativeDependencies.xcframework")
HEADERS_PATH=$(find "$XCFRAMEWORK_PATH" -type d -name "Headers" | head -n 1)
# Check if XCFRAMEWORK_PATH is empty
if [ -z "$XCFRAMEWORK_PATH" ]; then
echo "ERROR: XCFRAMEWORK_PATH is empty."
exit 0
fi
# Check if HEADERS_PATH is empty
if [ -z "$HEADERS_PATH" ]; then
echo "ERROR: HEADERS_PATH is empty."
exit 0
fi
cp -R "$HEADERS_PATH/." Headers
mkdir -p framework/packages/react-native
cp -R "$XCFRAMEWORK_PATH/../." framework/packages/react-native/
find "$XCFRAMEWORK_PATH/.." -type f -exec rm {} +
find "$CURRENT_PATH" -type d -empty -delete
CMD
# If we are passing a local tarball, we don't want to switch between Debug and Release
if !ENV["RCT_USE_LOCAL_RN_DEP"]
script_phase = {
:name => "[RNDeps] Replace React Native Dependencies for the right configuration, if needed",
:execution_position => :before_compile,
:script => <<-EOS
. "$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh"
CONFIG="Release"
if echo $GCC_PREPROCESSOR_DEFINITIONS | grep -q "DEBUG=1"; then
CONFIG="Debug"
fi
"$NODE_BINARY" "$REACT_NATIVE_PATH/third-party-podspecs/replace_dependencies_version.js" -c "$CONFIG" -r "#{version}" -p "$PODS_ROOT"
EOS
}
# :always_out_of_date is only available in CocoaPods 1.13.0 and later
if Gem::Version.new(Pod::VERSION) >= Gem::Version.new('1.13.0')
# always run the script without warning
script_phase[:always_out_of_date] = "1"
end
spec.script_phase = script_phase
end
end

View File

@@ -0,0 +1,34 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
boost_config = get_boost_config()
boost_git_url = boost_config[:git]
Pod::Spec.new do |spec|
spec.name = 'boost'
spec.version = '1.84.0'
spec.license = { :type => 'Boost Software License', :file => "LICENSE_1_0.txt" }
spec.homepage = 'http://www.boost.org'
spec.summary = 'Boost provides free peer-reviewed portable C++ source libraries.'
spec.authors = 'Rene Rivera'
spec.source = { :git => boost_git_url,
:tag => "v1.84.0" }
# Pinning to the same version as React.podspec.
spec.platforms = min_supported_versions
spec.requires_arc = false
spec.source_files = 'boost/**/*.{hpp,cpp}'
spec.module_name = 'boost'
spec.header_dir = 'boost'
spec.preserve_path = 'boost'
spec.header_mappings_dir = 'boost/boost'
spec.resource_bundles = {'boost_privacy' => 'boost/PrivacyInfo.xcprivacy'}
spec.pod_target_xcconfig = {
"GCC_WARN_INHIBIT_ALL_WARNINGS" => "YES" # Disable warnings because we don't control this library
}
end

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>C617.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategorySystemBootTime</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>35F9.1</string>
</array>
</dict>
</array>
<key>NSPrivacyCollectedDataTypes</key>
<array/>
<key>NSPrivacyTracking</key>
<false/>
</dict>
</plist>

View File

@@ -0,0 +1,29 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
fast_float_config = get_fast_float_config()
fast_float_git_url = fast_float_config[:git]
Pod::Spec.new do |spec|
spec.name = "fast_float"
spec.version = "8.0.0"
spec.license = { :type => "MIT" }
spec.homepage = "https://github.com/fastfloat/fast_float"
spec.summary = "{fast_float} is an open-source number parsing library for C++. The library provides fast header-only implementations."
spec.authors = "The fast_float contributors"
spec.source = {
:git => fast_float_git_url,
:tag => "v8.0.0"
}
spec.pod_target_xcconfig = {
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
"GCC_WARN_INHIBIT_ALL_WARNINGS" => "YES" # Disable warnings because we don't control this library
}
spec.platforms = min_supported_versions
spec.libraries = "c++"
spec.public_header_files = "include/fast_float/*.h"
spec.header_mappings_dir = "include"
spec.source_files = ["include/fast_float/*.h"]
end

View File

@@ -0,0 +1,29 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
fmt_config = get_fmt_config()
fmt_git_url = fmt_config[:git]
Pod::Spec.new do |spec|
spec.name = "fmt"
spec.version = "11.0.2"
spec.license = { :type => "MIT" }
spec.homepage = "https://github.com/fmtlib/fmt"
spec.summary = "{fmt} is an open-source formatting library for C++. It can be used as a safe and fast alternative to (s)printf and iostreams."
spec.authors = "The fmt contributors"
spec.source = {
:git => fmt_git_url,
:tag => "11.0.2"
}
spec.pod_target_xcconfig = {
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
"GCC_WARN_INHIBIT_ALL_WARNINGS" => "YES" # Disable warnings because we don't control this library
}
spec.platforms = min_supported_versions
spec.libraries = "c++"
spec.public_header_files = "include/fmt/*.h"
spec.header_mappings_dir = "include"
spec.source_files = ["include/fmt/*.h", "src/format.cc"]
end

View File

@@ -0,0 +1,47 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
glog_config = get_glog_config()
glog_git_url = glog_config[:git]
Pod::Spec.new do |spec|
spec.name = 'glog'
spec.version = '0.3.5'
spec.license = { :type => 'Google', :file => 'COPYING' }
spec.homepage = 'https://github.com/google/glog'
spec.summary = 'Google logging module'
spec.authors = 'Google'
spec.prepare_command = File.read("../scripts/ios-configure-glog.sh")
spec.source = { :git => glog_git_url,
:tag => "v#{spec.version}" }
spec.module_name = 'glog'
spec.header_dir = 'glog'
spec.source_files = 'src/glog/*.h',
'src/demangle.cc',
'src/logging.cc',
'src/raw_logging.cc',
'src/signalhandler.cc',
'src/symbolize.cc',
'src/utilities.cc',
'src/vlog_is_on.cc'
# workaround for https://github.com/facebook/react-native/issues/14326
spec.preserve_paths = 'src/*.h',
'src/base/*.h'
spec.exclude_files = "src/windows/**/*"
spec.compiler_flags = '-Wno-shorten-64-to-32'
spec.resource_bundles = {'glog_privacy' => 'glog/PrivacyInfo.xcprivacy'}
spec.pod_target_xcconfig = {
"USE_HEADERMAP" => "NO",
"HEADER_SEARCH_PATHS" => "$(PODS_TARGET_SRCROOT)/src",
"DEFINES_MODULE" => "YES",
"GCC_WARN_INHIBIT_ALL_WARNINGS" => "YES" # Disable warnings because we don't control this library
}
# Pinning to the same version as React.podspec.
spec.platforms = min_supported_versions
end

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>C617.1</string>
</array>
</dict>
</array>
<key>NSPrivacyCollectedDataTypes</key>
<array/>
<key>NSPrivacyTracking</key>
<false/>
</dict>
</plist>

View File

@@ -0,0 +1,140 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
'use strict';
const {spawnSync} = require('child_process');
const fs = require('fs');
const yargs = require('yargs');
const LAST_BUILD_FILENAME = 'ReactNativeDependencies/.last_build_configuration';
function validateBuildConfiguration(configuration /*: string */) {
if (!['Debug', 'Release'].includes(configuration)) {
throw new Error(`Invalid configuration ${configuration}`);
}
}
function validateVersion(version /*: ?string */) {
if (version == null || version === '') {
throw new Error('Version cannot be empty');
}
}
function shouldReplaceRnDepsConfiguration(configuration /*: string */) {
const fileExists = fs.existsSync(LAST_BUILD_FILENAME);
if (fileExists) {
console.log(`Found ${LAST_BUILD_FILENAME} file`);
const oldConfiguration = fs.readFileSync(LAST_BUILD_FILENAME).toString();
if (oldConfiguration === configuration) {
console.log(
'Same config of the previous build. No need to replace RNDeps',
);
return false;
}
}
// Assumption: if there is no stored last build, we assume that it was build for debug.
if (!fileExists && configuration === 'Debug') {
console.log(
'No previous build detected, but Debug Configuration. No need to replace RNDeps',
);
return false;
}
return true;
}
function replaceRNDepsConfiguration(
configuration /*: string */,
version /*: string */,
podsRoot /*: string */,
) {
const tarballURLPath = `${podsRoot}/ReactNativeDependencies-artifacts/reactnative-dependencies-${version.toLowerCase()}-${configuration.toLowerCase()}.tar.gz`;
const finalLocation = 'ReactNativeDependencies/framework';
console.log('Preparing the final location', finalLocation);
fs.rmSync(finalLocation, {force: true, recursive: true});
fs.mkdirSync(finalLocation, {recursive: true});
console.log('Extracting the tarball', tarballURLPath);
spawnSync('tar', ['-xf', tarballURLPath, '-C', finalLocation], {
stdio: 'inherit',
});
// Now we need to remove the extra third-party folder as we do in the podspec's prepare-script
// We need to take the ReactNativeDependencies.xcframework folder and move it up one level
// from ${finalLocation}/packages/react-native/third-party/ to ${finalLocation}/packages/react-native/
console.log('Resolving ReactNativeDependencies.xcframework folder structure');
const thirdPartyPath = `${finalLocation}/packages/react-native/third-party`;
const sourcePath = `${thirdPartyPath}/ReactNativeDependencies.xcframework`;
const destinationPath = `${finalLocation}/packages/react-native/ReactNativeDependencies.xcframework`;
if (fs.existsSync(sourcePath)) {
fs.renameSync(sourcePath, destinationPath);
} else {
throw new Error(
`Expected ReactNativeDependencies.xcframework to be at ${sourcePath}, but it was not found.`,
);
}
if (fs.existsSync(thirdPartyPath)) {
fs.rmSync(thirdPartyPath, {force: true, recursive: true});
}
}
function updateLastBuildConfiguration(configuration /*: string */) {
console.log(`Updating ${LAST_BUILD_FILENAME} with ${configuration}`);
fs.writeFileSync(LAST_BUILD_FILENAME, configuration);
}
function main(
configuration /*: string */,
version /*: string */,
podsRoot /*: string */,
) {
validateBuildConfiguration(configuration);
validateVersion(version);
if (!shouldReplaceRnDepsConfiguration(configuration)) {
return;
}
replaceRNDepsConfiguration(configuration, version, podsRoot);
updateLastBuildConfiguration(configuration);
console.log('Done replacing React Native Dependencies');
}
// This script is executed in the Pods folder, which is usually not synched to Github, so it should be ok
const argv = yargs
.option('c', {
alias: 'configuration',
description:
'Configuration to use to download the right React Native Dependencies version. Allowed values are "Debug" and "Release".',
})
.option('r', {
alias: 'reactNativeVersion',
description:
'The Version of React Native associated with the React Native Dependencies tarball.',
})
.option('p', {
alias: 'podsRoot',
description: 'The path to the Pods root folder',
})
.usage('Usage: $0 -c Debug -r <version> -p <path/to/react-native>').argv;
// $FlowFixMe[prop-missing]
const configuration = argv.configuration;
// $FlowFixMe[prop-missing]
const version = argv.reactNativeVersion;
// $FlowFixMe[prop-missing]
const podsRoot = argv.podsRoot;
main(configuration, version, podsRoot);