react-native 0.72.4 → 0.72.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/vendor/emitter/EventEmitter.js +3 -1
- package/React/Base/RCTBundleURLProvider.h +33 -2
- package/React/Base/RCTBundleURLProvider.mm +78 -15
- package/React/Base/RCTVersion.m +1 -1
- package/React/CoreModules/RCTTiming.mm +5 -0
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/MaintainVisibleScrollPositionHelper.java +4 -0
- package/ReactAndroid/src/main/jni/CMakeLists.txt +5 -0
- package/ReactCommon/React-Fabric.podspec +1 -1
- package/ReactCommon/ReactCommon.podspec +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/jsc/JSCRuntime.cpp +10 -0
- package/ReactCommon/react/debug/React-debug.podspec +1 -1
- package/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +1 -1
- package/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec +1 -1
- package/ReactCommon/react/renderer/core/RawPropsKeyMap.cpp +2 -0
- package/ReactCommon/react/renderer/core/RawPropsParser.cpp +1 -0
- package/ReactCommon/react/renderer/core/RawPropsPrimitives.h +4 -4
- package/ReactCommon/react/renderer/graphics/React-graphics.podspec +1 -1
- package/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec +1 -1
- package/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec +1 -1
- package/ReactCommon/react/utils/React-utils.podspec +1 -1
- package/package.json +5 -5
- package/scripts/cocoapods/__tests__/test_utils/XcodebuildMock.rb +26 -0
- package/scripts/cocoapods/__tests__/utils-test.rb +115 -18
- package/scripts/cocoapods/helpers.rb +16 -0
- package/scripts/cocoapods/utils.rb +103 -8
- package/scripts/react_native_pods.rb +6 -2
- package/sdks/hermes-engine/utils/build-apple-framework.sh +8 -1
- package/sdks/hermes-engine/utils/build-hermes-xcode.sh +8 -0
- package/sdks/hermesc/linux64-bin/hermesc +0 -0
- package/sdks/hermesc/osx-bin/hermesc +0 -0
- package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
- package/template/Gemfile +2 -1
- package/template/package.json +1 -1
|
@@ -109,7 +109,9 @@ export default class EventEmitter<TEventToArgsMap: {...}>
|
|
|
109
109
|
Registration<$ElementType<TEventToArgsMap, TEvent>>,
|
|
110
110
|
> = this._registry[eventType];
|
|
111
111
|
if (registrations != null) {
|
|
112
|
-
|
|
112
|
+
// Copy `registrations` to take a snapshot when we invoke `emit`, in case
|
|
113
|
+
// registrations are added or removed when listeners are invoked.
|
|
114
|
+
for (const registration of Array.from(registrations)) {
|
|
113
115
|
registration.listener.apply(registration.context, args);
|
|
114
116
|
}
|
|
115
117
|
}
|
|
@@ -101,6 +101,7 @@ RCT_EXTERN void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed);
|
|
|
101
101
|
|
|
102
102
|
@property (nonatomic, assign) BOOL enableMinification;
|
|
103
103
|
@property (nonatomic, assign) BOOL enableDev;
|
|
104
|
+
@property (nonatomic, assign) BOOL inlineSourceMap;
|
|
104
105
|
|
|
105
106
|
/**
|
|
106
107
|
* The scheme/protocol used of the packager, the default is the http protocol
|
|
@@ -125,13 +126,32 @@ RCT_EXTERN void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed);
|
|
|
125
126
|
+ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
|
|
126
127
|
packagerHost:(NSString *)packagerHost
|
|
127
128
|
enableDev:(BOOL)enableDev
|
|
128
|
-
enableMinification:(BOOL)enableMinification
|
|
129
|
+
enableMinification:(BOOL)enableMinification
|
|
130
|
+
__deprecated_msg(
|
|
131
|
+
"Use `jsBundleURLForBundleRoot:packagerHost:enableDev:enableMinification:inlineSourceMap:` instead");
|
|
132
|
+
|
|
133
|
+
+ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
|
|
134
|
+
packagerHost:(NSString *)packagerHost
|
|
135
|
+
packagerScheme:(NSString *)scheme
|
|
136
|
+
enableDev:(BOOL)enableDev
|
|
137
|
+
enableMinification:(BOOL)enableMinification
|
|
138
|
+
modulesOnly:(BOOL)modulesOnly
|
|
139
|
+
runModule:(BOOL)runModule
|
|
140
|
+
__deprecated_msg(
|
|
141
|
+
"Use jsBundleURLForBundleRoot:packagerHost:enableDev:enableMinification:inlineSourceMap:modulesOnly:runModule:` instead");
|
|
142
|
+
|
|
143
|
+
+ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
|
|
144
|
+
packagerHost:(NSString *)packagerHost
|
|
145
|
+
enableDev:(BOOL)enableDev
|
|
146
|
+
enableMinification:(BOOL)enableMinification
|
|
147
|
+
inlineSourceMap:(BOOL)inlineSourceMap;
|
|
129
148
|
|
|
130
149
|
+ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
|
|
131
150
|
packagerHost:(NSString *)packagerHost
|
|
132
151
|
packagerScheme:(NSString *)scheme
|
|
133
152
|
enableDev:(BOOL)enableDev
|
|
134
153
|
enableMinification:(BOOL)enableMinification
|
|
154
|
+
inlineSourceMap:(BOOL)inlineSourceMap
|
|
135
155
|
modulesOnly:(BOOL)modulesOnly
|
|
136
156
|
runModule:(BOOL)runModule;
|
|
137
157
|
/**
|
|
@@ -142,6 +162,17 @@ RCT_EXTERN void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed);
|
|
|
142
162
|
+ (NSURL *)resourceURLForResourcePath:(NSString *)path
|
|
143
163
|
packagerHost:(NSString *)packagerHost
|
|
144
164
|
scheme:(NSString *)scheme
|
|
145
|
-
query:(NSString *)query
|
|
165
|
+
query:(NSString *)query
|
|
166
|
+
__deprecated_msg("Use version with queryItems parameter instead");
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Given a hostname for the packager and a resource path (including "/"), return the URL to the resource.
|
|
170
|
+
* In general, please use the instance method to decide if the packager is running and fallback to the pre-packaged
|
|
171
|
+
* resource if it is not: -resourceURLForResourceRoot:resourceName:resourceExtension:offlineBundle:
|
|
172
|
+
*/
|
|
173
|
+
+ (NSURL *)resourceURLForResourcePath:(NSString *)path
|
|
174
|
+
packagerHost:(NSString *)packagerHost
|
|
175
|
+
scheme:(NSString *)scheme
|
|
176
|
+
queryItems:(NSArray<NSURLQueryItem *> *)queryItems;
|
|
146
177
|
|
|
147
178
|
@end
|
|
@@ -22,10 +22,12 @@ void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed)
|
|
|
22
22
|
kRCTAllowPackagerAccess = allowed;
|
|
23
23
|
}
|
|
24
24
|
#endif
|
|
25
|
+
static NSString *const kRCTPlatformName = @"ios";
|
|
25
26
|
static NSString *const kRCTPackagerSchemeKey = @"RCT_packager_scheme";
|
|
26
27
|
static NSString *const kRCTJsLocationKey = @"RCT_jsLocation";
|
|
27
28
|
static NSString *const kRCTEnableDevKey = @"RCT_enableDev";
|
|
28
29
|
static NSString *const kRCTEnableMinificationKey = @"RCT_enableMinification";
|
|
30
|
+
static NSString *const kRCTInlineSourceMapKey = @"RCT_inlineSourceMap";
|
|
29
31
|
|
|
30
32
|
@implementation RCTBundleURLProvider
|
|
31
33
|
|
|
@@ -187,6 +189,7 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
|
|
|
187
189
|
packagerScheme:[self packagerScheme]
|
|
188
190
|
enableDev:[self enableDev]
|
|
189
191
|
enableMinification:[self enableMinification]
|
|
192
|
+
inlineSourceMap:[self inlineSourceMap]
|
|
190
193
|
modulesOnly:NO
|
|
191
194
|
runModule:YES];
|
|
192
195
|
}
|
|
@@ -199,6 +202,7 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
|
|
|
199
202
|
packagerScheme:[self packagerScheme]
|
|
200
203
|
enableDev:[self enableDev]
|
|
201
204
|
enableMinification:[self enableMinification]
|
|
205
|
+
inlineSourceMap:[self inlineSourceMap]
|
|
202
206
|
modulesOnly:YES
|
|
203
207
|
runModule:NO];
|
|
204
208
|
}
|
|
@@ -238,13 +242,29 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
|
|
|
238
242
|
return [[self class] resourceURLForResourcePath:path
|
|
239
243
|
packagerHost:packagerServerHostPort
|
|
240
244
|
scheme:packagerServerScheme
|
|
241
|
-
|
|
245
|
+
queryItems:nil];
|
|
242
246
|
}
|
|
243
247
|
|
|
244
248
|
+ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
|
|
245
249
|
packagerHost:(NSString *)packagerHost
|
|
246
250
|
enableDev:(BOOL)enableDev
|
|
247
251
|
enableMinification:(BOOL)enableMinification
|
|
252
|
+
{
|
|
253
|
+
return [self jsBundleURLForBundleRoot:bundleRoot
|
|
254
|
+
packagerHost:packagerHost
|
|
255
|
+
packagerScheme:nil
|
|
256
|
+
enableDev:enableDev
|
|
257
|
+
enableMinification:enableMinification
|
|
258
|
+
inlineSourceMap:NO
|
|
259
|
+
modulesOnly:NO
|
|
260
|
+
runModule:YES];
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
+ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
|
|
264
|
+
packagerHost:(NSString *)packagerHost
|
|
265
|
+
enableDev:(BOOL)enableDev
|
|
266
|
+
enableMinification:(BOOL)enableMinification
|
|
267
|
+
inlineSourceMap:(BOOL)inlineSourceMap
|
|
248
268
|
|
|
249
269
|
{
|
|
250
270
|
return [self jsBundleURLForBundleRoot:bundleRoot
|
|
@@ -252,6 +272,7 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
|
|
|
252
272
|
packagerScheme:nil
|
|
253
273
|
enableDev:enableDev
|
|
254
274
|
enableMinification:enableMinification
|
|
275
|
+
inlineSourceMap:inlineSourceMap
|
|
255
276
|
modulesOnly:NO
|
|
256
277
|
runModule:YES];
|
|
257
278
|
}
|
|
@@ -263,27 +284,45 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
|
|
|
263
284
|
enableMinification:(BOOL)enableMinification
|
|
264
285
|
modulesOnly:(BOOL)modulesOnly
|
|
265
286
|
runModule:(BOOL)runModule
|
|
287
|
+
{
|
|
288
|
+
return [self jsBundleURLForBundleRoot:bundleRoot
|
|
289
|
+
packagerHost:packagerHost
|
|
290
|
+
packagerScheme:nil
|
|
291
|
+
enableDev:enableDev
|
|
292
|
+
enableMinification:enableMinification
|
|
293
|
+
inlineSourceMap:NO
|
|
294
|
+
modulesOnly:modulesOnly
|
|
295
|
+
runModule:runModule];
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
+ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
|
|
299
|
+
packagerHost:(NSString *)packagerHost
|
|
300
|
+
packagerScheme:(NSString *)scheme
|
|
301
|
+
enableDev:(BOOL)enableDev
|
|
302
|
+
enableMinification:(BOOL)enableMinification
|
|
303
|
+
inlineSourceMap:(BOOL)inlineSourceMap
|
|
304
|
+
modulesOnly:(BOOL)modulesOnly
|
|
305
|
+
runModule:(BOOL)runModule
|
|
266
306
|
{
|
|
267
307
|
NSString *path = [NSString stringWithFormat:@"/%@.bundle", bundleRoot];
|
|
308
|
+
BOOL lazy = enableDev;
|
|
309
|
+
NSArray<NSURLQueryItem *> *queryItems = @[
|
|
310
|
+
[[NSURLQueryItem alloc] initWithName:@"platform" value:kRCTPlatformName],
|
|
311
|
+
[[NSURLQueryItem alloc] initWithName:@"dev" value:enableDev ? @"true" : @"false"],
|
|
312
|
+
[[NSURLQueryItem alloc] initWithName:@"minify" value:enableMinification ? @"true" : @"false"],
|
|
313
|
+
[[NSURLQueryItem alloc] initWithName:@"inlineSourceMap" value:inlineSourceMap ? @"true" : @"false"],
|
|
314
|
+
[[NSURLQueryItem alloc] initWithName:@"modulesOnly" value:modulesOnly ? @"true" : @"false"],
|
|
315
|
+
[[NSURLQueryItem alloc] initWithName:@"runModule" value:runModule ? @"true" : @"false"],
|
|
268
316
|
#ifdef HERMES_BYTECODE_VERSION
|
|
269
|
-
|
|
270
|
-
#
|
|
271
|
-
|
|
272
|
-
#endif
|
|
273
|
-
|
|
274
|
-
// When we support only iOS 8 and above, use queryItems for a better API.
|
|
275
|
-
NSString *query = [NSString stringWithFormat:@"platform=ios&dev=%@&minify=%@&modulesOnly=%@&runModule=%@%@",
|
|
276
|
-
enableDev ? @"true" : @"false",
|
|
277
|
-
enableMinification ? @"true" : @"false",
|
|
278
|
-
modulesOnly ? @"true" : @"false",
|
|
279
|
-
runModule ? @"true" : @"false",
|
|
280
|
-
runtimeBytecodeVersion];
|
|
317
|
+
[[NSURLQueryItem alloc] initWithName:@"runtimeBytecodeVersion" value:HERMES_BYTECODE_VERSION],
|
|
318
|
+
#endif
|
|
319
|
+
];
|
|
281
320
|
|
|
282
321
|
NSString *bundleID = [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleIdentifierKey];
|
|
283
322
|
if (bundleID) {
|
|
284
|
-
|
|
323
|
+
queryItems = [queryItems arrayByAddingObject:[[NSURLQueryItem alloc] initWithName:@"app" value:bundleID]];
|
|
285
324
|
}
|
|
286
|
-
return [[self class] resourceURLForResourcePath:path packagerHost:packagerHost scheme:scheme
|
|
325
|
+
return [[self class] resourceURLForResourcePath:path packagerHost:packagerHost scheme:scheme queryItems:queryItems];
|
|
287
326
|
}
|
|
288
327
|
|
|
289
328
|
+ (NSURL *)resourceURLForResourcePath:(NSString *)path
|
|
@@ -300,6 +339,20 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
|
|
|
300
339
|
return components.URL;
|
|
301
340
|
}
|
|
302
341
|
|
|
342
|
+
+ (NSURL *)resourceURLForResourcePath:(NSString *)path
|
|
343
|
+
packagerHost:(NSString *)packagerHost
|
|
344
|
+
scheme:(NSString *)scheme
|
|
345
|
+
queryItems:(NSArray<NSURLQueryItem *> *)queryItems
|
|
346
|
+
{
|
|
347
|
+
NSURLComponents *components = [NSURLComponents componentsWithURL:serverRootWithHostPort(packagerHost, scheme)
|
|
348
|
+
resolvingAgainstBaseURL:NO];
|
|
349
|
+
components.path = path;
|
|
350
|
+
if (queryItems != nil) {
|
|
351
|
+
components.queryItems = queryItems;
|
|
352
|
+
}
|
|
353
|
+
return components.URL;
|
|
354
|
+
}
|
|
355
|
+
|
|
303
356
|
- (void)updateValue:(id)object forKey:(NSString *)key
|
|
304
357
|
{
|
|
305
358
|
[[NSUserDefaults standardUserDefaults] setObject:object forKey:key];
|
|
@@ -317,6 +370,11 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
|
|
|
317
370
|
return [[NSUserDefaults standardUserDefaults] boolForKey:kRCTEnableMinificationKey];
|
|
318
371
|
}
|
|
319
372
|
|
|
373
|
+
- (BOOL)inlineSourceMap
|
|
374
|
+
{
|
|
375
|
+
return [[NSUserDefaults standardUserDefaults] boolForKey:kRCTInlineSourceMapKey];
|
|
376
|
+
}
|
|
377
|
+
|
|
320
378
|
- (NSString *)jsLocation
|
|
321
379
|
{
|
|
322
380
|
return [[NSUserDefaults standardUserDefaults] stringForKey:kRCTJsLocationKey];
|
|
@@ -346,6 +404,11 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
|
|
|
346
404
|
[self updateValue:@(enableMinification) forKey:kRCTEnableMinificationKey];
|
|
347
405
|
}
|
|
348
406
|
|
|
407
|
+
- (void)setInlineSourceMap:(BOOL)inlineSourceMap
|
|
408
|
+
{
|
|
409
|
+
[self updateValue:@(inlineSourceMap) forKey:kRCTInlineSourceMapKey];
|
|
410
|
+
}
|
|
411
|
+
|
|
349
412
|
- (void)setPackagerScheme:(NSString *)packagerScheme
|
|
350
413
|
{
|
|
351
414
|
[self updateValue:packagerScheme forKey:kRCTPackagerSchemeKey];
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -128,6 +128,11 @@ RCT_EXPORT_MODULE()
|
|
|
128
128
|
_paused = YES;
|
|
129
129
|
_timers = [NSMutableDictionary new];
|
|
130
130
|
_inBackground = NO;
|
|
131
|
+
RCTExecuteOnMainQueue(^{
|
|
132
|
+
if (!self->_inBackground && [RCTSharedApplication() applicationState] == UIApplicationStateBackground) {
|
|
133
|
+
[self appDidMoveToBackground];
|
|
134
|
+
}
|
|
135
|
+
});
|
|
131
136
|
|
|
132
137
|
for (NSString *name in @[
|
|
133
138
|
UIApplicationWillResignActiveNotification,
|
|
@@ -103,6 +103,10 @@ public class MaintainVisibleScrollPositionHelper<ScrollViewT extends ViewGroup &
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
View firstVisibleView = mFirstVisibleView.get();
|
|
106
|
+
if (firstVisibleView == null) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
|
|
106
110
|
Rect newFrame = new Rect();
|
|
107
111
|
firstVisibleView.getHitRect(newFrame);
|
|
108
112
|
|
|
@@ -8,6 +8,11 @@ set(CMAKE_VERBOSE_MAKEFILE on)
|
|
|
8
8
|
|
|
9
9
|
project(ReactAndroid)
|
|
10
10
|
|
|
11
|
+
# Convert input paths to CMake format (with forward slashes)
|
|
12
|
+
file(TO_CMAKE_PATH "${REACT_ANDROID_DIR}" REACT_ANDROID_DIR)
|
|
13
|
+
file(TO_CMAKE_PATH "${REACT_BUILD_DIR}" REACT_BUILD_DIR)
|
|
14
|
+
file(TO_CMAKE_PATH "${REACT_COMMON_DIR}" REACT_COMMON_DIR)
|
|
15
|
+
|
|
11
16
|
# If you have ccache installed, we're going to honor it.
|
|
12
17
|
find_program(CCACHE_FOUND ccache)
|
|
13
18
|
if(CCACHE_FOUND)
|
|
@@ -37,7 +37,7 @@ Pod::Spec.new do |s|
|
|
|
37
37
|
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
|
|
38
38
|
"GCC_WARN_PEDANTIC" => "YES" }
|
|
39
39
|
if ENV['USE_FRAMEWORKS']
|
|
40
|
-
s.header_mappings_dir =
|
|
40
|
+
s.header_mappings_dir = './'
|
|
41
41
|
end
|
|
42
42
|
|
|
43
43
|
# TODO (T48588859): Restructure this target to align with dir structure: "react/nativemodule/..."
|
|
@@ -302,6 +302,9 @@ class JSCRuntime : public jsi::Runtime {
|
|
|
302
302
|
#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_10_0
|
|
303
303
|
#define _JSC_NO_ARRAY_BUFFERS
|
|
304
304
|
#endif
|
|
305
|
+
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 160400
|
|
306
|
+
#define _JSC_HAS_INSPECTABLE
|
|
307
|
+
#endif
|
|
305
308
|
#endif
|
|
306
309
|
#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
|
|
307
310
|
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_11
|
|
@@ -398,6 +401,13 @@ JSCRuntime::JSCRuntime(JSGlobalContextRef ctx)
|
|
|
398
401
|
stringCounter_(0)
|
|
399
402
|
#endif
|
|
400
403
|
{
|
|
404
|
+
#ifndef NDEBUG
|
|
405
|
+
#ifdef _JSC_HAS_INSPECTABLE
|
|
406
|
+
if (__builtin_available(macOS 13.3, iOS 16.4, tvOS 16.4, *)) {
|
|
407
|
+
JSGlobalContextSetInspectable(ctx_, true);
|
|
408
|
+
}
|
|
409
|
+
#endif
|
|
410
|
+
#endif
|
|
401
411
|
}
|
|
402
412
|
|
|
403
413
|
JSCRuntime::~JSCRuntime() {
|
|
@@ -37,7 +37,7 @@ Pod::Spec.new do |s|
|
|
|
37
37
|
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
|
|
38
38
|
"GCC_WARN_PEDANTIC" => "YES" }
|
|
39
39
|
if ENV['USE_FRAMEWORKS']
|
|
40
|
-
s.header_mappings_dir =
|
|
40
|
+
s.header_mappings_dir = './'
|
|
41
41
|
end
|
|
42
42
|
|
|
43
43
|
s.source_files = "ReactCommon/**/*.{mm,cpp,h}"
|
|
@@ -38,6 +38,8 @@ void RawPropsKeyMap::insert(
|
|
|
38
38
|
item.value = value;
|
|
39
39
|
key.render(item.name, &item.length);
|
|
40
40
|
items_.push_back(item);
|
|
41
|
+
react_native_assert(
|
|
42
|
+
items_.size() < std::numeric_limits<RawPropsPropNameLength>::max());
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
void RawPropsKeyMap::reindex() noexcept {
|
|
@@ -42,6 +42,7 @@ RawValue const *RawPropsParser::at(
|
|
|
42
42
|
// This is not thread-safe part; this happens only during initialization of
|
|
43
43
|
// a `ComponentDescriptor` where it is actually safe.
|
|
44
44
|
keys_.push_back(key);
|
|
45
|
+
react_native_assert(size < std::numeric_limits<RawPropsValueIndex>::max());
|
|
45
46
|
nameToIndex_.insert(key, static_cast<RawPropsValueIndex>(size));
|
|
46
47
|
return nullptr;
|
|
47
48
|
}
|
|
@@ -16,11 +16,11 @@ namespace react {
|
|
|
16
16
|
/*
|
|
17
17
|
* Type used to represent an index of some stored values in small arrays.
|
|
18
18
|
*/
|
|
19
|
-
using RawPropsValueIndex =
|
|
19
|
+
using RawPropsValueIndex = uint16_t;
|
|
20
20
|
static_assert(
|
|
21
|
-
sizeof(RawPropsValueIndex) ==
|
|
22
|
-
"RawPropsValueIndex must be
|
|
23
|
-
using RawPropsPropNameLength =
|
|
21
|
+
sizeof(RawPropsValueIndex) == 2,
|
|
22
|
+
"RawPropsValueIndex must be two byte size.");
|
|
23
|
+
using RawPropsPropNameLength = uint16_t;
|
|
24
24
|
using RawPropsPropNameHash = uint32_t;
|
|
25
25
|
|
|
26
26
|
/*
|
|
@@ -45,7 +45,7 @@ Pod::Spec.new do |s|
|
|
|
45
45
|
|
|
46
46
|
if ENV['USE_FRAMEWORKS']
|
|
47
47
|
s.module_name = "React_graphics"
|
|
48
|
-
s.header_mappings_dir =
|
|
48
|
+
s.header_mappings_dir = "../../.."
|
|
49
49
|
header_search_paths = header_search_paths + ["\"$(PODS_TARGET_SRCROOT)/platform/ios\""]
|
|
50
50
|
end
|
|
51
51
|
|
|
@@ -42,7 +42,7 @@ Pod::Spec.new do |s|
|
|
|
42
42
|
|
|
43
43
|
if ENV['USE_FRAMEWORKS']
|
|
44
44
|
s.module_name = "React_ImageManager"
|
|
45
|
-
s.header_mappings_dir =
|
|
45
|
+
s.header_mappings_dir = "./"
|
|
46
46
|
header_search_paths = header_search_paths + [
|
|
47
47
|
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers\"",
|
|
48
48
|
"\"$(PODS_ROOT)/DoubleConversion\"",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native",
|
|
3
|
-
"version": "0.72.
|
|
3
|
+
"version": "0.72.6",
|
|
4
4
|
"bin": "./cli.js",
|
|
5
5
|
"description": "A framework for building native apps using React",
|
|
6
6
|
"license": "MIT",
|
|
@@ -79,11 +79,11 @@
|
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
81
|
"@jest/create-cache-key-function": "^29.2.1",
|
|
82
|
-
"@react-native-community/cli": "11.3.
|
|
83
|
-
"@react-native-community/cli-platform-android": "11.3.
|
|
84
|
-
"@react-native-community/cli-platform-ios": "11.3.
|
|
82
|
+
"@react-native-community/cli": "11.3.7",
|
|
83
|
+
"@react-native-community/cli-platform-android": "11.3.7",
|
|
84
|
+
"@react-native-community/cli-platform-ios": "11.3.7",
|
|
85
85
|
"@react-native/assets-registry": "^0.72.0",
|
|
86
|
-
"@react-native/codegen": "^0.72.
|
|
86
|
+
"@react-native/codegen": "^0.72.7",
|
|
87
87
|
"@react-native/gradle-plugin": "^0.72.11",
|
|
88
88
|
"@react-native/js-polyfills": "^0.72.1",
|
|
89
89
|
"@react-native/normalize-colors": "^0.72.0",
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
#
|
|
3
|
+
# This source code is licensed under the MIT license found in the
|
|
4
|
+
# LICENSE file in the root directory of this source tree.
|
|
5
|
+
|
|
6
|
+
class XcodebuildMock < Xcodebuild
|
|
7
|
+
@@version = ""
|
|
8
|
+
@@version_invocation_count = 0
|
|
9
|
+
|
|
10
|
+
def self.set_version=(v)
|
|
11
|
+
@@version = v
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def self.version
|
|
15
|
+
@@version_invocation_count += 1
|
|
16
|
+
@@version
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def self.version_invocation_count
|
|
20
|
+
@@version_invocation_count
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.reset()
|
|
24
|
+
@@version_invocation_count = 0
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -14,6 +14,7 @@ require_relative "./test_utils/FileMock.rb"
|
|
|
14
14
|
require_relative "./test_utils/systemUtils.rb"
|
|
15
15
|
require_relative "./test_utils/PathnameMock.rb"
|
|
16
16
|
require_relative "./test_utils/TargetDefinitionMock.rb"
|
|
17
|
+
require_relative "./test_utils/XcodebuildMock.rb"
|
|
17
18
|
|
|
18
19
|
class UtilsTests < Test::Unit::TestCase
|
|
19
20
|
def setup
|
|
@@ -28,6 +29,7 @@ class UtilsTests < Test::Unit::TestCase
|
|
|
28
29
|
Pod::Config.reset()
|
|
29
30
|
SysctlChecker.reset()
|
|
30
31
|
Environment.reset()
|
|
32
|
+
XcodebuildMock.reset()
|
|
31
33
|
ENV['RCT_NEW_ARCH_ENABLED'] = '0'
|
|
32
34
|
ENV['USE_HERMES'] = '1'
|
|
33
35
|
ENV['USE_FRAMEWORKS'] = nil
|
|
@@ -437,9 +439,9 @@ class UtilsTests < Test::Unit::TestCase
|
|
|
437
439
|
# ================================= #
|
|
438
440
|
# Test - Apply Xcode 15 Patch #
|
|
439
441
|
# ================================= #
|
|
440
|
-
|
|
441
|
-
def test_applyXcode15Patch_correctlyAppliesNecessaryPatch
|
|
442
|
+
def test_applyXcode15Patch_whenXcodebuild14_correctlyAppliesNecessaryPatch
|
|
442
443
|
# Arrange
|
|
444
|
+
XcodebuildMock.set_version = "Xcode 14.3"
|
|
443
445
|
first_target = prepare_target("FirstTarget")
|
|
444
446
|
second_target = prepare_target("SecondTarget")
|
|
445
447
|
third_target = TargetMock.new("ThirdTarget", [
|
|
@@ -468,24 +470,117 @@ class UtilsTests < Test::Unit::TestCase
|
|
|
468
470
|
])
|
|
469
471
|
|
|
470
472
|
# Act
|
|
471
|
-
|
|
473
|
+
user_project_mock.build_configurations.each do |config|
|
|
474
|
+
assert_nil(config.build_settings["OTHER_LDFLAGS"])
|
|
475
|
+
end
|
|
476
|
+
|
|
477
|
+
ReactNativePodsUtils.apply_xcode_15_patch(installer, :xcodebuild_manager => XcodebuildMock)
|
|
472
478
|
|
|
473
479
|
# Assert
|
|
474
|
-
|
|
475
|
-
assert_equal(config.build_settings["GCC_PREPROCESSOR_DEFINITIONS"]
|
|
476
|
-
|
|
477
|
-
)
|
|
480
|
+
user_project_mock.build_configurations.each do |config|
|
|
481
|
+
assert_equal("$(inherited) _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION", config.build_settings["GCC_PREPROCESSOR_DEFINITIONS"])
|
|
482
|
+
assert_equal("$(inherited) ", config.build_settings["OTHER_LDFLAGS"])
|
|
478
483
|
end
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
484
|
+
|
|
485
|
+
# User project and Pods project
|
|
486
|
+
assert_equal(2, XcodebuildMock.version_invocation_count)
|
|
487
|
+
end
|
|
488
|
+
|
|
489
|
+
def test_applyXcode15Patch_whenXcodebuild15_correctlyAppliesNecessaryPatch
|
|
490
|
+
# Arrange
|
|
491
|
+
XcodebuildMock.set_version = "Xcode 15.0"
|
|
492
|
+
first_target = prepare_target("FirstTarget")
|
|
493
|
+
second_target = prepare_target("SecondTarget")
|
|
494
|
+
third_target = TargetMock.new("ThirdTarget", [
|
|
495
|
+
BuildConfigurationMock.new("Debug", {
|
|
496
|
+
"GCC_PREPROCESSOR_DEFINITIONS" => '$(inherited) "SomeFlag=1" '
|
|
497
|
+
}),
|
|
498
|
+
BuildConfigurationMock.new("Release", {
|
|
499
|
+
"GCC_PREPROCESSOR_DEFINITIONS" => '$(inherited) "SomeFlag=1" '
|
|
500
|
+
}),
|
|
501
|
+
], nil)
|
|
502
|
+
|
|
503
|
+
user_project_mock = UserProjectMock.new("/a/path", [
|
|
504
|
+
prepare_config("Debug"),
|
|
505
|
+
prepare_config("Release"),
|
|
506
|
+
],
|
|
507
|
+
:native_targets => [
|
|
508
|
+
first_target,
|
|
509
|
+
second_target
|
|
510
|
+
]
|
|
511
|
+
)
|
|
512
|
+
pods_projects_mock = PodsProjectMock.new([], {"hermes-engine" => {}}, :native_targets => [
|
|
513
|
+
third_target
|
|
514
|
+
])
|
|
515
|
+
installer = InstallerMock.new(pods_projects_mock, [
|
|
516
|
+
AggregatedProjectMock.new(user_project_mock)
|
|
517
|
+
])
|
|
518
|
+
|
|
519
|
+
# Act
|
|
520
|
+
user_project_mock.build_configurations.each do |config|
|
|
521
|
+
assert_nil(config.build_settings["OTHER_LDFLAGS"])
|
|
483
522
|
end
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
523
|
+
|
|
524
|
+
ReactNativePodsUtils.apply_xcode_15_patch(installer, :xcodebuild_manager => XcodebuildMock)
|
|
525
|
+
|
|
526
|
+
# Assert
|
|
527
|
+
user_project_mock.build_configurations.each do |config|
|
|
528
|
+
assert_equal("$(inherited) _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION", config.build_settings["GCC_PREPROCESSOR_DEFINITIONS"])
|
|
529
|
+
assert_equal("$(inherited) -Wl -ld_classic", config.build_settings["OTHER_LDFLAGS"])
|
|
488
530
|
end
|
|
531
|
+
|
|
532
|
+
# User project and Pods project
|
|
533
|
+
assert_equal(2, XcodebuildMock.version_invocation_count)
|
|
534
|
+
end
|
|
535
|
+
|
|
536
|
+
def test_applyXcode15Patch_whenXcodebuild14ButProjectHasSettings_correctlyRemovesNecessaryPatch
|
|
537
|
+
# Arrange
|
|
538
|
+
XcodebuildMock.set_version = "Xcode 14.3"
|
|
539
|
+
first_target = prepare_target("FirstTarget")
|
|
540
|
+
second_target = prepare_target("SecondTarget")
|
|
541
|
+
third_target = TargetMock.new("ThirdTarget", [
|
|
542
|
+
BuildConfigurationMock.new("Debug", {
|
|
543
|
+
"GCC_PREPROCESSOR_DEFINITIONS" => '$(inherited) "SomeFlag=1" '
|
|
544
|
+
}),
|
|
545
|
+
BuildConfigurationMock.new("Release", {
|
|
546
|
+
"GCC_PREPROCESSOR_DEFINITIONS" => '$(inherited) "SomeFlag=1" '
|
|
547
|
+
}),
|
|
548
|
+
], nil)
|
|
549
|
+
|
|
550
|
+
debug_config = prepare_config("Debug", {"OTHER_LDFLAGS" => "$(inherited) -Wl -ld_classic "})
|
|
551
|
+
release_config = prepare_config("Release", {"OTHER_LDFLAGS" => "$(inherited) -Wl -ld_classic "})
|
|
552
|
+
|
|
553
|
+
user_project_mock = UserProjectMock.new("/a/path", [
|
|
554
|
+
debug_config,
|
|
555
|
+
release_config,
|
|
556
|
+
],
|
|
557
|
+
:native_targets => [
|
|
558
|
+
first_target,
|
|
559
|
+
second_target
|
|
560
|
+
]
|
|
561
|
+
)
|
|
562
|
+
pods_projects_mock = PodsProjectMock.new([debug_config.clone, release_config.clone], {"hermes-engine" => {}}, :native_targets => [
|
|
563
|
+
third_target
|
|
564
|
+
])
|
|
565
|
+
installer = InstallerMock.new(pods_projects_mock, [
|
|
566
|
+
AggregatedProjectMock.new(user_project_mock)
|
|
567
|
+
])
|
|
568
|
+
|
|
569
|
+
# Act
|
|
570
|
+
user_project_mock.build_configurations.each do |config|
|
|
571
|
+
assert_equal("$(inherited) -Wl -ld_classic ", config.build_settings["OTHER_LDFLAGS"])
|
|
572
|
+
end
|
|
573
|
+
|
|
574
|
+
ReactNativePodsUtils.apply_xcode_15_patch(installer, :xcodebuild_manager => XcodebuildMock)
|
|
575
|
+
|
|
576
|
+
# Assert
|
|
577
|
+
user_project_mock.build_configurations.each do |config|
|
|
578
|
+
assert_equal("$(inherited) _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION", config.build_settings["GCC_PREPROCESSOR_DEFINITIONS"])
|
|
579
|
+
assert_equal("$(inherited)", config.build_settings["OTHER_LDFLAGS"])
|
|
580
|
+
end
|
|
581
|
+
|
|
582
|
+
# User project and Pods project
|
|
583
|
+
assert_equal(2, XcodebuildMock.version_invocation_count)
|
|
489
584
|
end
|
|
490
585
|
|
|
491
586
|
# ==================================== #
|
|
@@ -744,12 +839,14 @@ def prepare_empty_user_project_mock
|
|
|
744
839
|
])
|
|
745
840
|
end
|
|
746
841
|
|
|
747
|
-
def prepare_config(config_name)
|
|
748
|
-
|
|
842
|
+
def prepare_config(config_name, extra_config = {})
|
|
843
|
+
config = {"LIBRARY_SEARCH_PATHS" => [
|
|
749
844
|
"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)",
|
|
750
845
|
"\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"",
|
|
751
846
|
"another/path",
|
|
752
|
-
]})
|
|
847
|
+
]}.merge(extra_config)
|
|
848
|
+
|
|
849
|
+
return BuildConfigurationMock.new(config_name, config)
|
|
753
850
|
end
|
|
754
851
|
|
|
755
852
|
def prepare_target(name, product_type = nil, dependencies = [])
|
|
@@ -11,6 +11,14 @@ class SysctlChecker
|
|
|
11
11
|
end
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
+
# Helper class that is used to easily send commands to Xcodebuild
|
|
15
|
+
# And that can be subclassed for testing purposes.
|
|
16
|
+
class Xcodebuild
|
|
17
|
+
def self.version
|
|
18
|
+
`xcodebuild -version`
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
14
22
|
# Helper object to wrap system properties like RUBY_PLATFORM
|
|
15
23
|
# This makes it easier to mock the behaviour in tests
|
|
16
24
|
class Environment
|
|
@@ -26,3 +34,11 @@ class Finder
|
|
|
26
34
|
return `find #{path} -type f \\( #{js_files} -or #{ts_files} \\)`.split("\n").sort()
|
|
27
35
|
end
|
|
28
36
|
end
|
|
37
|
+
|
|
38
|
+
module Helpers
|
|
39
|
+
class Constants
|
|
40
|
+
def self.min_ios_version_supported
|
|
41
|
+
return '12.4'
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -121,16 +121,31 @@ class ReactNativePodsUtils
|
|
|
121
121
|
end
|
|
122
122
|
end
|
|
123
123
|
|
|
124
|
-
def self.apply_xcode_15_patch(installer)
|
|
125
|
-
installer
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
124
|
+
def self.apply_xcode_15_patch(installer, xcodebuild_manager: Xcodebuild)
|
|
125
|
+
projects = self.extract_projects(installer)
|
|
126
|
+
|
|
127
|
+
gcc_preprocessor_definition_key = 'GCC_PREPROCESSOR_DEFINITIONS'
|
|
128
|
+
other_ld_flags_key = 'OTHER_LDFLAGS'
|
|
129
|
+
libcpp_cxx17_fix = '_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION'
|
|
130
|
+
xcode15_compatibility_flags = '-Wl -ld_classic '
|
|
131
|
+
|
|
132
|
+
projects.each do |project|
|
|
133
|
+
project.build_configurations.each do |config|
|
|
134
|
+
# fix for unary_function and binary_function
|
|
135
|
+
self.safe_init(config, gcc_preprocessor_definition_key)
|
|
136
|
+
self.add_value_to_setting_if_missing(config, gcc_preprocessor_definition_key, libcpp_cxx17_fix)
|
|
137
|
+
|
|
138
|
+
# fix for weak linking
|
|
139
|
+
self.safe_init(config, other_ld_flags_key)
|
|
140
|
+
if self.is_using_xcode15_or_greter(:xcodebuild_manager => xcodebuild_manager)
|
|
141
|
+
self.add_value_to_setting_if_missing(config, other_ld_flags_key, xcode15_compatibility_flags)
|
|
142
|
+
else
|
|
143
|
+
self.remove_value_from_setting_if_present(config, other_ld_flags_key, xcode15_compatibility_flags)
|
|
144
|
+
end
|
|
132
145
|
end
|
|
146
|
+
project.save()
|
|
133
147
|
end
|
|
148
|
+
|
|
134
149
|
end
|
|
135
150
|
|
|
136
151
|
def self.apply_flags_for_fabric(installer, fabric_enabled: false)
|
|
@@ -232,6 +247,37 @@ class ReactNativePodsUtils
|
|
|
232
247
|
end
|
|
233
248
|
end
|
|
234
249
|
|
|
250
|
+
def self.updateIphoneOSDeploymentTarget(installer)
|
|
251
|
+
pod_to_update = Set.new([
|
|
252
|
+
"boost",
|
|
253
|
+
"CocoaAsyncSocket",
|
|
254
|
+
"Flipper",
|
|
255
|
+
"Flipper-DoubleConversion",
|
|
256
|
+
"Flipper-Fmt",
|
|
257
|
+
"Flipper-Boost-iOSX",
|
|
258
|
+
"Flipper-Folly",
|
|
259
|
+
"Flipper-Glog",
|
|
260
|
+
"Flipper-PeerTalk",
|
|
261
|
+
"FlipperKit",
|
|
262
|
+
"fmt",
|
|
263
|
+
"libevent",
|
|
264
|
+
"OpenSSL-Universal",
|
|
265
|
+
"RCT-Folly",
|
|
266
|
+
"SocketRocket",
|
|
267
|
+
"YogaKit"
|
|
268
|
+
])
|
|
269
|
+
|
|
270
|
+
installer.target_installation_results.pod_target_installation_results
|
|
271
|
+
.each do |pod_name, target_installation_result|
|
|
272
|
+
unless pod_to_update.include?(pod_name)
|
|
273
|
+
next
|
|
274
|
+
end
|
|
275
|
+
target_installation_result.native_target.build_configurations.each do |config|
|
|
276
|
+
config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = Helpers::Constants.min_ios_version_supported
|
|
277
|
+
end
|
|
278
|
+
end
|
|
279
|
+
end
|
|
280
|
+
|
|
235
281
|
# ========= #
|
|
236
282
|
# Utilities #
|
|
237
283
|
# ========= #
|
|
@@ -243,6 +289,55 @@ class ReactNativePodsUtils
|
|
|
243
289
|
.push(installer.pods_project)
|
|
244
290
|
end
|
|
245
291
|
|
|
292
|
+
def self.safe_init(config, setting_name)
|
|
293
|
+
old_config = config.build_settings[setting_name]
|
|
294
|
+
if old_config == nil
|
|
295
|
+
config.build_settings[setting_name] ||= '$(inherited) '
|
|
296
|
+
end
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
def self.add_value_to_setting_if_missing(config, setting_name, value)
|
|
300
|
+
old_config = config.build_settings[setting_name]
|
|
301
|
+
if old_config.is_a?(Array)
|
|
302
|
+
old_config = old_config.join(" ")
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
trimmed_value = value.strip()
|
|
306
|
+
if !old_config.include?(trimmed_value)
|
|
307
|
+
config.build_settings[setting_name] = "#{old_config.strip()} #{trimmed_value}".strip()
|
|
308
|
+
end
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
def self.remove_value_from_setting_if_present(config, setting_name, value)
|
|
312
|
+
old_config = config.build_settings[setting_name]
|
|
313
|
+
if old_config.is_a?(Array)
|
|
314
|
+
old_config = old_config.join(" ")
|
|
315
|
+
end
|
|
316
|
+
|
|
317
|
+
trimmed_value = value.strip()
|
|
318
|
+
if old_config.include?(trimmed_value)
|
|
319
|
+
new_config = old_config.gsub(trimmed_value, "")
|
|
320
|
+
config.build_settings[setting_name] = new_config.strip()
|
|
321
|
+
end
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
def self.is_using_xcode15_or_greter(xcodebuild_manager: Xcodebuild)
|
|
325
|
+
xcodebuild_version = xcodebuild_manager.version
|
|
326
|
+
|
|
327
|
+
# The output of xcodebuild -version is something like
|
|
328
|
+
# Xcode 15.0
|
|
329
|
+
# or
|
|
330
|
+
# Xcode 14.3.1
|
|
331
|
+
# We want to capture the version digits
|
|
332
|
+
regex = /(\d+)\.(\d+)(?:\.(\d+))?/
|
|
333
|
+
if match_data = xcodebuild_version.match(regex)
|
|
334
|
+
major = match_data[1].to_i
|
|
335
|
+
return major >= 15
|
|
336
|
+
end
|
|
337
|
+
|
|
338
|
+
return false
|
|
339
|
+
end
|
|
340
|
+
|
|
246
341
|
def self.add_compiler_flag_to_project(installer, flag, configuration: nil)
|
|
247
342
|
projects = self.extract_projects(installer)
|
|
248
343
|
|
|
@@ -15,6 +15,7 @@ require_relative './cocoapods/codegen_utils.rb'
|
|
|
15
15
|
require_relative './cocoapods/utils.rb'
|
|
16
16
|
require_relative './cocoapods/new_architecture.rb'
|
|
17
17
|
require_relative './cocoapods/local_podspec_patch.rb'
|
|
18
|
+
require_relative './cocoapods/helpers.rb'
|
|
18
19
|
|
|
19
20
|
$CODEGEN_OUTPUT_DIR = 'build/generated/ios'
|
|
20
21
|
$CODEGEN_COMPONENT_DIR = 'react/renderer/components'
|
|
@@ -34,11 +35,12 @@ require Pod::Executable.execute_command('node', ['-p',
|
|
|
34
35
|
{paths: [process.argv[1]]},
|
|
35
36
|
)', __dir__]).strip
|
|
36
37
|
|
|
37
|
-
|
|
38
|
+
|
|
39
|
+
# This function returns the min supported OS versions supported by React Native
|
|
38
40
|
# By using this function, you won't have to manually change your Podfile
|
|
39
41
|
# when we change the minimum version supported by the framework.
|
|
40
42
|
def min_ios_version_supported
|
|
41
|
-
return
|
|
43
|
+
return Helpers::Constants.min_ios_version_supported
|
|
42
44
|
end
|
|
43
45
|
|
|
44
46
|
# This function prepares the project for React Native, before processing
|
|
@@ -245,11 +247,13 @@ def react_native_post_install(
|
|
|
245
247
|
ReactNativePodsUtils.set_node_modules_user_settings(installer, react_native_path)
|
|
246
248
|
ReactNativePodsUtils.apply_flags_for_fabric(installer, fabric_enabled: fabric_enabled)
|
|
247
249
|
ReactNativePodsUtils.apply_xcode_15_patch(installer)
|
|
250
|
+
ReactNativePodsUtils.updateIphoneOSDeploymentTarget(installer)
|
|
248
251
|
|
|
249
252
|
NewArchitectureHelper.set_clang_cxx_language_standard_if_needed(installer)
|
|
250
253
|
is_new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == "1"
|
|
251
254
|
NewArchitectureHelper.modify_flags_for_new_architecture(installer, is_new_arch_enabled)
|
|
252
255
|
|
|
256
|
+
|
|
253
257
|
Pod::UI.puts "Pod install took #{Time.now.to_i - $START_TIME} [s] to run".green
|
|
254
258
|
end
|
|
255
259
|
|
|
@@ -52,7 +52,7 @@ function build_host_hermesc {
|
|
|
52
52
|
|
|
53
53
|
# Utility function to configure an Apple framework
|
|
54
54
|
function configure_apple_framework {
|
|
55
|
-
local build_cli_tools enable_bitcode enable_debugger cmake_build_type
|
|
55
|
+
local build_cli_tools enable_bitcode enable_debugger cmake_build_type xcode_15_flags xcode_major_version
|
|
56
56
|
|
|
57
57
|
if [[ $1 == iphoneos || $1 == catalyst ]]; then
|
|
58
58
|
enable_bitcode="true"
|
|
@@ -77,8 +77,15 @@ function configure_apple_framework {
|
|
|
77
77
|
cmake_build_type="MinSizeRel"
|
|
78
78
|
fi
|
|
79
79
|
|
|
80
|
+
xcode_15_flags=""
|
|
81
|
+
xcode_major_version=$(xcodebuild -version | grep -oE '[0-9]*' | head -n 1)
|
|
82
|
+
if [[ $xcode_major_version -ge 15 ]]; then
|
|
83
|
+
xcode_15_flags="LINKER:-ld_classic"
|
|
84
|
+
fi
|
|
85
|
+
|
|
80
86
|
pushd "$HERMES_PATH" > /dev/null || exit 1
|
|
81
87
|
cmake -S . -B "build_$1" \
|
|
88
|
+
-DHERMES_EXTRA_LINKER_FLAGS="$xcode_15_flags" \
|
|
82
89
|
-DHERMES_APPLE_TARGET_PLATFORM:STRING="$1" \
|
|
83
90
|
-DCMAKE_OSX_ARCHITECTURES:STRING="$2" \
|
|
84
91
|
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING="$3" \
|
|
@@ -33,6 +33,13 @@ if [ -z "$deployment_target" ]; then
|
|
|
33
33
|
deployment_target=${MACOSX_DEPLOYMENT_TARGET}
|
|
34
34
|
fi
|
|
35
35
|
|
|
36
|
+
xcode_15_flags=""
|
|
37
|
+
xcode_major_version=$(xcodebuild -version | grep -oE '[0-9]*' | head -n 1)
|
|
38
|
+
if [[ $xcode_major_version -ge 15 ]]; then
|
|
39
|
+
echo "########### Using LINKER:-ld_classic ###########"
|
|
40
|
+
xcode_15_flags="LINKER:-ld_classic"
|
|
41
|
+
fi
|
|
42
|
+
|
|
36
43
|
architectures=$( echo "$ARCHS" | tr " " ";" )
|
|
37
44
|
|
|
38
45
|
echo "Configure Apple framework"
|
|
@@ -40,6 +47,7 @@ echo "Configure Apple framework"
|
|
|
40
47
|
"$CMAKE_BINARY" \
|
|
41
48
|
-S "${PODS_ROOT}/hermes-engine" \
|
|
42
49
|
-B "${PODS_ROOT}/hermes-engine/build/${PLATFORM_NAME}" \
|
|
50
|
+
-DHERMES_EXTRA_LINKER_FLAGS="$xcode_15_flags" \
|
|
43
51
|
-DHERMES_APPLE_TARGET_PLATFORM:STRING="$PLATFORM_NAME" \
|
|
44
52
|
-DCMAKE_OSX_ARCHITECTURES:STRING="$architectures" \
|
|
45
53
|
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING="$deployment_target" \
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/template/Gemfile
CHANGED