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
4 changes: 3 additions & 1 deletion packages/app/ReactTestApp-DevSupport.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ Pod::Spec.new do |s|

s.pod_target_xcconfig = {
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++20',
'CPP_PREPROCESSOR_DEFINITIONS' => preprocessor_definitions,
'DEFINES_MODULE' => 'YES',
'GCC_PREPROCESSOR_DEFINITIONS' => preprocessor_definitions,
'CPP_PREPROCESSOR_DEFINITIONS' => preprocessor_definitions,
'GCC_TREAT_WARNINGS_AS_ERRORS' => 'YES',
'SWIFT_OBJC_BRIDGING_HEADER' =>
'ios/ReactTestApp/Public/ReactTestApp-DevSupport-Bridging-Header.h',
'SWIFT_TREAT_WARNINGS_AS_ERRORS' => 'YES',
}

s.source_files = 'common/AppRegistry.{cpp,h}',
Expand Down
2 changes: 1 addition & 1 deletion packages/app/example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2190,7 +2190,7 @@ SPEC CHECKSUMS:
ReactCommon: 66763e5bd1b778828ff6cb82d771b7162a5215c2
ReactNativeDependencies: 8cbd0fbc0255c3949672a00a81fc8d60a29dcfd9
ReactNativeHost: c49183895850a534a9d58049bf02b3c80a3ebb0c
ReactTestApp-DevSupport: aeb3fe7bc1b2916413ac41309a70a0df7475f8a5
ReactTestApp-DevSupport: a661d0353c33448b3a5fe3a7719696bb07d20051
ReactTestApp-Resources: 1bd9ff10e4c24f2ad87101a32023721ae923bccf
RNWWebStorage: a3612eab23117c5bf9d18faa213565409a376ef1
Yoga: b1085f68c014785350a2afdc95eaef0d49f23ccb
Expand Down
4 changes: 4 additions & 0 deletions packages/app/ios/ReactTestApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "";
ENABLE_PREVIEWS = YES;
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
INFOPLIST_FILE = Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -413,6 +414,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "ReactTestApp/ReactTestApp-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_TREAT_WARNINGS_AS_ERRORS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
Expand All @@ -427,6 +429,7 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "";
ENABLE_PREVIEWS = YES;
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
INFOPLIST_FILE = Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -435,6 +438,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.microsoft.ReactTestApp;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "ReactTestApp/ReactTestApp-Bridging-Header.h";
SWIFT_TREAT_WARNINGS_AS_ERRORS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
Expand Down
2 changes: 0 additions & 2 deletions packages/app/ios/ReactTestApp/ReactTestApp.common.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ ENABLE_STRICT_OBJC_MSGSEND = YES
ENABLE_USER_SCRIPT_SANDBOXING = NO
GCC_C_LANGUAGE_STANDARD = gnu11
GCC_NO_COMMON_BLOCKS = YES
GCC_TREAT_WARNINGS_AS_ERRORS = YES
IPHONEOS_DEPLOYMENT_TARGET = 15.1
MTL_FAST_MATH = YES
OTHER_CFLAGS = $(inherited) -fstack-protector-strong
OTHER_LDFLAGS = $(inherited) -fstack-protector-strong
SDKROOT = iphoneos
SWIFT_TREAT_WARNINGS_AS_ERRORS = YES
WARNING_CFLAGS = -Wall
13 changes: 8 additions & 5 deletions packages/app/ios/test_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,10 @@ def use_test_app_internal!(target_platform, options)

installer.pods_project.targets.each do |target|
case target.name
when /\AReact/, 'RCT-Folly', 'SocketRocket', 'Yoga', 'fmt', 'glog', 'libevent'
target.build_configurations.each do |config|
config.build_settings[WARNING_CFLAGS] ||= []
config.build_settings[WARNING_CFLAGS] << '-w'
end
when /\AReactTestApp/
# We had to remove `*_TREAT_WARNINGS_AS_ERRORS` from our `.xcconfig`
# files because Xcode treats imported XCFrameworks as part of the main
# target. We need to revisit this when we've migrated to SPM.
when 'RNReanimated'
# Reanimated tries to automatically install itself by swizzling a method
# in `RCTAppDelegate`. We don't use it since it doesn't exist on older
Expand All @@ -221,6 +220,10 @@ def use_test_app_internal!(target_platform, options)
config.build_settings[GCC_PREPROCESSOR_DEFINITIONS] << 'DONT_AUTOINSTALL_REANIMATED'
end
else
target.build_configurations.each do |config|
config.build_settings[WARNING_CFLAGS] ||= []
config.build_settings[WARNING_CFLAGS] << '-w'
end
# Ensure `ENABLE_TESTING_SEARCH_PATHS` is always set otherwise Xcode may
# fail to properly import XCTest
unless test_dependencies.assoc(target.name).nil?
Expand Down
4 changes: 4 additions & 0 deletions packages/app/macos/ReactTestApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
INFOPLIST_FILE = Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -389,6 +390,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.microsoft.ReactTestApp;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Shared/ReactTestApp-Bridging-Header.h";
SWIFT_TREAT_WARNINGS_AS_ERRORS = NO;
SWIFT_VERSION = 5.0;
};
name = Debug;
Expand All @@ -402,6 +404,7 @@
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
INFOPLIST_FILE = Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -410,6 +413,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.microsoft.ReactTestApp;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Shared/ReactTestApp-Bridging-Header.h";
SWIFT_TREAT_WARNINGS_AS_ERRORS = NO;
SWIFT_VERSION = 5.0;
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ ENABLE_STRICT_OBJC_MSGSEND = YES
ENABLE_USER_SCRIPT_SANDBOXING = NO
GCC_C_LANGUAGE_STANDARD = gnu11
GCC_NO_COMMON_BLOCKS = YES
GCC_TREAT_WARNINGS_AS_ERRORS = YES
MACOSX_DEPLOYMENT_TARGET = 14.0
MTL_FAST_MATH = YES
OTHER_CFLAGS = $(inherited) -fstack-protector-strong
OTHER_LDFLAGS = $(inherited) -fstack-protector-strong
SDKROOT = macosx
SWIFT_TREAT_WARNINGS_AS_ERRORS = YES
WARNING_CFLAGS = -Wall -Wno-error=undef-prefix
16 changes: 11 additions & 5 deletions packages/app/scripts/internal/set-react-version.mts
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,23 @@ function fetchPackageInfo(pkg: string, version: string): Promise<Manifest> {
/**
* Fetches the template manifest for the specified React Native version.
*/
function fetchTemplateManifest(version: string): Promise<Manifest> {
async function fetchTemplateManifest(version: string): Promise<Manifest> {
const url = `https://raw.githubusercontent.com/react-native-community/template/refs/heads/${version}-stable/template/package.json`;
console.log(`Fetching template manifest from ${url}`);
return fetch(url, {
const res = await fetch(url, {
headers: {
Accept:
"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*",
},
})
.then((res) => res.text())
.then((text) => JSON.parse(text));
});

const body = await res.text();
if (res.status !== 200) {
console.error(`Failed to fetch template: ${body}`);
return { name: "", version: "" };
}

return JSON.parse(body);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "";
ENABLE_PREVIEWS = YES;
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
INFOPLIST_FILE = ReactTestApp/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -393,6 +394,7 @@
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_OBJC_BRIDGING_HEADER = "Shared/ReactTestApp-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_TREAT_WARNINGS_AS_ERRORS = NO;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How much can you move out to xcconfigs?

SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 7;
};
Expand All @@ -407,6 +409,7 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "";
ENABLE_PREVIEWS = YES;
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
INFOPLIST_FILE = ReactTestApp/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -419,6 +422,7 @@
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_OBJC_BRIDGING_HEADER = "Shared/ReactTestApp-Bridging-Header.h";
SWIFT_TREAT_WARNINGS_AS_ERRORS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 7;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ ENABLE_STRICT_OBJC_MSGSEND = YES
ENABLE_USER_SCRIPT_SANDBOXING = NO
GCC_C_LANGUAGE_STANDARD = gnu11
GCC_NO_COMMON_BLOCKS = YES
GCC_TREAT_WARNINGS_AS_ERRORS = YES
XROS_DEPLOYMENT_TARGET = 1.0
MTL_FAST_MATH = YES
OTHER_CFLAGS = $(inherited) -fstack-protector-strong
OTHER_LDFLAGS = $(inherited) -fstack-protector-strong
SDKROOT = iphoneos
SWIFT_TREAT_WARNINGS_AS_ERRORS = YES
WARNING_CFLAGS = -Wall
2 changes: 1 addition & 1 deletion packages/example-macos/macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2639,7 +2639,7 @@ SPEC CHECKSUMS:
ReactCodegen: 5a676a29f556095ce9f87f1f39e273ca0ad9586f
ReactCommon: ef913092a4501cf30c176155312c30abc82dbd34
ReactNativeHost: c8a7476a8bed6ba32f07207ee095837c8f7456e9
ReactTestApp-DevSupport: 4d0b86847c5f7fffa0f09479443be7a2420d19a4
ReactTestApp-DevSupport: 46ca013ea7a3bd8380244e305593fb54874a86d0
ReactTestApp-Resources: 71a3155bca10819738469de1f161410f43528209
RNWWebStorage: 8bc155b048a2d1ee1db5f63b1b9c5705434d48db
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
Expand Down
2 changes: 1 addition & 1 deletion packages/example-visionos/visionos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2639,7 +2639,7 @@ SPEC CHECKSUMS:
ReactCodegen: 5a676a29f556095ce9f87f1f39e273ca0ad9586f
ReactCommon: ef913092a4501cf30c176155312c30abc82dbd34
ReactNativeHost: c8a7476a8bed6ba32f07207ee095837c8f7456e9
ReactTestApp-DevSupport: 4d0b86847c5f7fffa0f09479443be7a2420d19a4
ReactTestApp-DevSupport: 46ca013ea7a3bd8380244e305593fb54874a86d0
ReactTestApp-Resources: 2ad57492ef72ab9b2c6f6e89ea198cc1999ca20b
RNWWebStorage: 8bc155b048a2d1ee1db5f63b1b9c5705434d48db
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
Expand Down
Loading