mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b5f1b26a8f | ||
|
|
48113b5635 | ||
|
|
faaf2560cd | ||
|
|
387ee70e72 | ||
|
|
3fd3fe04da | ||
|
|
fdd7848454 | ||
|
|
1f48b7b0a2 | ||
|
|
6268836c74 | ||
|
|
9efcaffe17 | ||
|
|
8400590abe | ||
|
|
a5c44e622e | ||
|
|
44ee801c29 | ||
|
|
5a8033df98 | ||
|
|
51f5ea15aa | ||
|
|
a4a6e23dec | ||
|
|
e645629323 | ||
|
|
b3f19d7f1f | ||
|
|
cb28a269f0 | ||
|
|
4163386aee | ||
|
|
ccd1708096 | ||
|
|
4e34e6c4fb | ||
|
|
3e69592c5a | ||
|
|
5fd04faf1e | ||
|
|
a761b79ad8 | ||
|
|
d7d33c7ef3 | ||
|
|
7b33f20546 | ||
|
|
4b370ceeb7 | ||
|
|
63e4bd655a | ||
|
|
762db49ded | ||
|
|
65e4d98a71 | ||
|
|
66b82aec55 | ||
|
|
2cd3173991 | ||
|
|
61f0d1a7d1 | ||
|
|
57cc524e93 | ||
|
|
bca4cf023a | ||
|
|
f5d371a2f9 | ||
|
|
b1c30f8f8a | ||
|
|
54f5c8c26c | ||
|
|
48f9733867 | ||
|
|
43d67cd1ec | ||
|
|
805afe4847 | ||
|
|
0924a28b19 | ||
|
|
1b2b2198e1 | ||
|
|
319e4df458 | ||
|
|
71548ffd69 | ||
|
|
58eb8b13a0 | ||
|
|
5ba5ff6eba | ||
|
|
a2a7032477 | ||
|
|
f06df0ef2b | ||
|
|
0fd6ade862 |
+9
-14
@@ -569,20 +569,18 @@ jobs:
|
||||
steps:
|
||||
- checkout
|
||||
- run_yarn
|
||||
- attach_workspace:
|
||||
at: .
|
||||
|
||||
- run:
|
||||
name: Setup the Android Template
|
||||
name: Create Android template project
|
||||
command: |
|
||||
REPO_ROOT=$(pwd)
|
||||
PACKAGE=$(cat build/react-native-package-version)
|
||||
PATH_TO_PACKAGE="$REPO_ROOT/build/$PACKAGE"
|
||||
cd template
|
||||
# We replace the "react-native" dependency version with file:.. so we use it from source.
|
||||
sed -i 's/\"react-native\"\:.*/\"react-native\"\: \"file\:\.\.\"/g' package.json
|
||||
npm add $PATH_TO_PACKAGE
|
||||
npm install
|
||||
# react-native-community/cli is needed as the Android template is referencing a .gradle file inside it.
|
||||
npm i @react-native-community/cli
|
||||
|
||||
- run:
|
||||
name: Bundle the latest version of ReactAndroid
|
||||
command: ./gradlew :ReactAndroid:publishReleasePublicationToNpmRepository
|
||||
|
||||
- run:
|
||||
name: Build the template application
|
||||
@@ -866,11 +864,6 @@ workflows:
|
||||
- build_npm_package:
|
||||
# Build a release package on every untagged commit, but do not publish to npm.
|
||||
publish_npm_args: --dry-run
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
- main
|
||||
- /^pull\/.*$/
|
||||
- test_js:
|
||||
run_disabled_tests: false
|
||||
filters:
|
||||
@@ -882,6 +875,8 @@ workflows:
|
||||
branches:
|
||||
ignore: gh-pages
|
||||
- test_android_template:
|
||||
requires:
|
||||
- build_npm_package
|
||||
filters:
|
||||
branches:
|
||||
ignore: gh-pages
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
; Flow doesn't support platforms
|
||||
.*/Libraries/Utilities/LoadingView.js
|
||||
|
||||
.*/node_modules/resolve/test/resolver/malformed_package_json/package\.json$
|
||||
|
||||
[untyped]
|
||||
.*/node_modules/@react-native-community/cli/.*/.*
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
; Flow doesn't support platforms
|
||||
.*/Libraries/Utilities/LoadingView.js
|
||||
|
||||
.*/node_modules/resolve/test/resolver/malformed_package_json/package\.json$
|
||||
|
||||
[untyped]
|
||||
.*/node_modules/@react-native-community/cli/.*/.*
|
||||
|
||||
|
||||
+15
-15
@@ -1,9 +1,9 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
CFPropertyList (3.0.4)
|
||||
CFPropertyList (3.0.5)
|
||||
rexml
|
||||
activesupport (6.1.4.1)
|
||||
activesupport (6.1.5)
|
||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||
i18n (>= 1.6, < 2)
|
||||
minitest (>= 5.1)
|
||||
@@ -15,11 +15,11 @@ GEM
|
||||
httpclient (~> 2.8, >= 2.8.3)
|
||||
json (>= 1.5.1)
|
||||
atomos (0.1.3)
|
||||
claide (1.0.3)
|
||||
cocoapods (1.11.2)
|
||||
claide (1.1.0)
|
||||
cocoapods (1.11.3)
|
||||
addressable (~> 2.8)
|
||||
claide (>= 1.0.2, < 2.0)
|
||||
cocoapods-core (= 1.11.2)
|
||||
cocoapods-core (= 1.11.3)
|
||||
cocoapods-deintegrate (>= 1.0.3, < 2.0)
|
||||
cocoapods-downloader (>= 1.4.0, < 2.0)
|
||||
cocoapods-plugins (>= 1.0.0, < 2.0)
|
||||
@@ -34,7 +34,7 @@ GEM
|
||||
nap (~> 1.0)
|
||||
ruby-macho (>= 1.0, < 3.0)
|
||||
xcodeproj (>= 1.21.0, < 2.0)
|
||||
cocoapods-core (1.11.2)
|
||||
cocoapods-core (1.11.3)
|
||||
activesupport (>= 5.0, < 7)
|
||||
addressable (~> 2.8)
|
||||
algoliasearch (~> 1.0)
|
||||
@@ -45,7 +45,7 @@ GEM
|
||||
public_suffix (~> 4.0)
|
||||
typhoeus (~> 1.0)
|
||||
cocoapods-deintegrate (1.0.5)
|
||||
cocoapods-downloader (1.5.1)
|
||||
cocoapods-downloader (1.6.3)
|
||||
cocoapods-plugins (1.0.0)
|
||||
nap
|
||||
cocoapods-search (1.0.1)
|
||||
@@ -54,24 +54,24 @@ GEM
|
||||
netrc (~> 0.11)
|
||||
cocoapods-try (1.2.0)
|
||||
colored2 (3.1.2)
|
||||
concurrent-ruby (1.1.9)
|
||||
concurrent-ruby (1.1.10)
|
||||
escape (0.0.4)
|
||||
ethon (0.15.0)
|
||||
ffi (>= 1.15.0)
|
||||
ffi (1.15.4)
|
||||
ffi (1.15.5)
|
||||
fourflusher (2.3.1)
|
||||
fuzzy_match (2.0.4)
|
||||
gh_inspector (1.1.3)
|
||||
httpclient (2.8.3)
|
||||
i18n (1.8.10)
|
||||
i18n (1.10.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
json (2.6.0)
|
||||
minitest (5.14.4)
|
||||
json (2.6.1)
|
||||
minitest (5.15.0)
|
||||
molinillo (0.8.0)
|
||||
nanaimo (0.3.0)
|
||||
nap (1.1.0)
|
||||
netrc (0.11.0)
|
||||
public_suffix (4.0.6)
|
||||
public_suffix (4.0.7)
|
||||
rexml (3.2.5)
|
||||
ruby-macho (2.5.1)
|
||||
typhoeus (1.4.0)
|
||||
@@ -85,7 +85,7 @@ GEM
|
||||
colored2 (~> 3.1)
|
||||
nanaimo (~> 0.3.0)
|
||||
rexml (~> 3.2.4)
|
||||
zeitwerk (2.5.1)
|
||||
zeitwerk (2.5.4)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
@@ -97,4 +97,4 @@ RUBY VERSION
|
||||
ruby 2.7.4p191
|
||||
|
||||
BUNDLED WITH
|
||||
2.2.29
|
||||
2.2.27
|
||||
|
||||
@@ -35,7 +35,7 @@ Pod::Spec.new do |s|
|
||||
s.pod_target_xcconfig = {
|
||||
"USE_HEADERMAP" => "YES",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
|
||||
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\""
|
||||
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\""
|
||||
}
|
||||
|
||||
s.dependency "RCT-Folly", folly_version
|
||||
|
||||
@@ -170,7 +170,8 @@ const SwitchWithForwardedRef: React.AbstractComponent<
|
||||
// that the update should be ignored and we should stick with the value
|
||||
// that we have in JS.
|
||||
const jsValue = value === true;
|
||||
const shouldUpdateNativeSwitch = native.value !== jsValue;
|
||||
const shouldUpdateNativeSwitch =
|
||||
native.value != null && native.value !== jsValue;
|
||||
if (
|
||||
shouldUpdateNativeSwitch &&
|
||||
nativeSwitchRef.current?.setNativeProps != null
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/**
|
||||
* @generated by scripts/set-rn-version.js
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* @format
|
||||
* @generated by scripts/set-rn-version.js
|
||||
* @flow strict
|
||||
*/
|
||||
|
||||
exports.version = {
|
||||
major: 0,
|
||||
minor: 0,
|
||||
patch: 0,
|
||||
minor: 68,
|
||||
patch: 1,
|
||||
prerelease: null,
|
||||
};
|
||||
|
||||
@@ -36,7 +36,7 @@ Pod::Spec.new do |s|
|
||||
s.pod_target_xcconfig = {
|
||||
"USE_HEADERMAP" => "YES",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
|
||||
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\""
|
||||
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\""
|
||||
}
|
||||
|
||||
s.dependency "RCT-Folly", folly_version
|
||||
|
||||
@@ -36,7 +36,7 @@ Pod::Spec.new do |s|
|
||||
s.pod_target_xcconfig = {
|
||||
"USE_HEADERMAP" => "YES",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
|
||||
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\""
|
||||
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\""
|
||||
}
|
||||
|
||||
s.dependency "React-Codegen", version
|
||||
|
||||
@@ -35,7 +35,7 @@ Pod::Spec.new do |s|
|
||||
s.pod_target_xcconfig = {
|
||||
"USE_HEADERMAP" => "YES",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
|
||||
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\""
|
||||
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\""
|
||||
}
|
||||
|
||||
s.dependency "RCT-Folly", folly_version
|
||||
|
||||
@@ -35,7 +35,7 @@ Pod::Spec.new do |s|
|
||||
s.pod_target_xcconfig = {
|
||||
"USE_HEADERMAP" => "YES",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
|
||||
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\""
|
||||
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\""
|
||||
}
|
||||
s.frameworks = "MobileCoreServices"
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ Pod::Spec.new do |s|
|
||||
s.pod_target_xcconfig = {
|
||||
"USE_HEADERMAP" => "YES",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
|
||||
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\""
|
||||
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\""
|
||||
}
|
||||
s.framework = "UserNotifications"
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ Pod::Spec.new do |s|
|
||||
s.pod_target_xcconfig = {
|
||||
"USE_HEADERMAP" => "YES",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
|
||||
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\""
|
||||
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\""
|
||||
}
|
||||
|
||||
s.dependency "RCT-Folly", folly_version
|
||||
|
||||
@@ -147,21 +147,7 @@ static UIColor *defaultPlaceholderColor()
|
||||
|
||||
- (void)setAttributedText:(NSAttributedString *)attributedText
|
||||
{
|
||||
// Using `setAttributedString:` while user is typing breaks some internal mechanics
|
||||
// when entering complex input languages such as Chinese, Korean or Japanese.
|
||||
// see: https://github.com/facebook/react-native/issues/19339
|
||||
|
||||
// We try to avoid calling this method as much as we can.
|
||||
// If the text has changed, there is nothing we can do.
|
||||
if (![super.attributedText.string isEqualToString:attributedText.string]) {
|
||||
[super setAttributedText:attributedText];
|
||||
} else {
|
||||
// But if the text is preserved, we just copying the attributes from the source string.
|
||||
if (![super.attributedText isEqualToAttributedString:attributedText]) {
|
||||
[self copyTextAttributesFrom:attributedText];
|
||||
}
|
||||
}
|
||||
|
||||
[super setAttributedText:attributedText];
|
||||
[self textDidChange];
|
||||
}
|
||||
|
||||
@@ -311,18 +297,4 @@ static UIColor *defaultPlaceholderColor()
|
||||
|
||||
#pragma mark - Utility Methods
|
||||
|
||||
- (void)copyTextAttributesFrom:(NSAttributedString *)sourceString
|
||||
{
|
||||
[self.textStorage beginEditing];
|
||||
|
||||
NSTextStorage *textStorage = self.textStorage;
|
||||
[sourceString enumerateAttributesInRange:NSMakeRange(0, sourceString.length)
|
||||
options:NSAttributedStringEnumerationReverse
|
||||
usingBlock:^(NSDictionary<NSAttributedStringKey,id> * _Nonnull attrs, NSRange range, BOOL * _Nonnull stop) {
|
||||
[textStorage setAttributes:attrs range:range];
|
||||
}];
|
||||
|
||||
[self.textStorage endEditing];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -104,6 +104,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)
|
||||
// Similarly, when the user is in the middle of inputting some text in Japanese/Chinese, there will be styling on the
|
||||
// text that we should disregard. See https://developer.apple.com/documentation/uikit/uitextinput/1614489-markedtextrange?language=objc
|
||||
// for more info.
|
||||
// Also, updating the attributed text while inputting Korean language will break input mechanism.
|
||||
// If the user added an emoji, the system adds a font attribute for the emoji and stores the original font in NSOriginalFont.
|
||||
// Lastly, when entering a password, etc., there will be additional styling on the field as the native text view
|
||||
// handles showing the last character for a split second.
|
||||
@@ -116,6 +117,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)
|
||||
|
||||
BOOL shouldFallbackToBareTextComparison =
|
||||
[self.backedTextInputView.textInputMode.primaryLanguage isEqualToString:@"dictation"] ||
|
||||
[self.backedTextInputView.textInputMode.primaryLanguage isEqualToString:@"ko-KR"] ||
|
||||
self.backedTextInputView.markedTextRange ||
|
||||
self.backedTextInputView.isSecureTextEntry ||
|
||||
fontHasBeenUpdatedBySystem;
|
||||
|
||||
@@ -36,7 +36,7 @@ Pod::Spec.new do |s|
|
||||
s.pod_target_xcconfig = {
|
||||
"USE_HEADERMAP" => "YES",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
|
||||
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\""
|
||||
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\""
|
||||
}
|
||||
s.frameworks = "AudioToolbox"
|
||||
|
||||
|
||||
@@ -21,11 +21,11 @@ NSDictionary* RCTGetReactNativeVersion(void)
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^(void){
|
||||
__rnVersion = @{
|
||||
RCTVersionMajor: @(0),
|
||||
RCTVersionMinor: @(0),
|
||||
RCTVersionPatch: @(0),
|
||||
RCTVersionPrerelease: [NSNull null],
|
||||
};
|
||||
RCTVersionMajor: @(0),
|
||||
RCTVersionMinor: @(68),
|
||||
RCTVersionPatch: @(1),
|
||||
RCTVersionPrerelease: [NSNull null],
|
||||
};
|
||||
});
|
||||
return __rnVersion;
|
||||
}
|
||||
|
||||
@@ -73,13 +73,10 @@ static RCTRootViewSizeFlexibility convertToRootViewSizeFlexibility(RCTSurfaceSiz
|
||||
// `RCTRootViewSizeFlexibilityNone` is the RCTRootView's default.
|
||||
RCTSurfaceSizeMeasureMode sizeMeasureMode = convertToSurfaceSizeMeasureMode(RCTRootViewSizeFlexibilityNone);
|
||||
|
||||
id<RCTSurfaceProtocol> surface = [[self class] createSurfaceWithBridge:bridge
|
||||
moduleName:moduleName
|
||||
initialProperties:initialProperties];
|
||||
[surface start];
|
||||
if (self = [super initWithSurface:surface sizeMeasureMode:sizeMeasureMode]) {
|
||||
// Nothing specific to do.
|
||||
}
|
||||
self = [super initWithBridge:bridge
|
||||
moduleName:moduleName
|
||||
initialProperties:initialProperties
|
||||
sizeMeasureMode:sizeMeasureMode];
|
||||
|
||||
RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @"");
|
||||
|
||||
|
||||
@@ -46,8 +46,10 @@ RCT_NOT_IMPLEMENTED(-(nullable instancetype)initWithCoder : (NSCoder *)coder)
|
||||
id<RCTSurfaceProtocol> surface = [[self class] createSurfaceWithBridge:bridge
|
||||
moduleName:moduleName
|
||||
initialProperties:initialProperties];
|
||||
[surface start];
|
||||
return [self initWithSurface:surface sizeMeasureMode:sizeMeasureMode];
|
||||
if (self = [self initWithSurface:surface sizeMeasureMode:sizeMeasureMode]) {
|
||||
[surface start];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)initWithSurface:(id<RCTSurfaceProtocol>)surface
|
||||
|
||||
@@ -34,7 +34,7 @@ Pod::Spec.new do |s|
|
||||
s.pod_target_xcconfig = {
|
||||
"USE_HEADERMAP" => "YES",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
|
||||
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/React/CoreModules\" \"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\""
|
||||
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/React/CoreModules\" \"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\""
|
||||
}
|
||||
|
||||
s.dependency "React-Codegen", version
|
||||
|
||||
@@ -617,8 +617,9 @@ using namespace facebook::react;
|
||||
// the settings on a dictation.
|
||||
// Similarly, when the user is in the middle of inputting some text in Japanese/Chinese, there will be styling on the
|
||||
// text that we should disregard. See
|
||||
// https://developer.apple.com/documentation/uikit/uitextinput/1614489-markedtextrange?language=objc for more info. If
|
||||
// the user added an emoji, the system adds a font attribute for the emoji and stores the original font in
|
||||
// https://developer.apple.com/documentation/uikit/uitextinput/1614489-markedtextrange?language=objc for more info.
|
||||
// Also, updating the attributed text while inputting Korean language will break input mechanism.
|
||||
// If the user added an emoji, the system adds a font attribute for the emoji and stores the original font in
|
||||
// NSOriginalFont. Lastly, when entering a password, etc., there will be additional styling on the field as the native
|
||||
// text view handles showing the last character for a split second.
|
||||
__block BOOL fontHasBeenUpdatedBySystem = false;
|
||||
@@ -633,6 +634,7 @@ using namespace facebook::react;
|
||||
|
||||
BOOL shouldFallbackToBareTextComparison =
|
||||
[_backedTextInputView.textInputMode.primaryLanguage isEqualToString:@"dictation"] ||
|
||||
[_backedTextInputView.textInputMode.primaryLanguage isEqualToString:@"ko-KR"] ||
|
||||
_backedTextInputView.markedTextRange || _backedTextInputView.isSecureTextEntry || fontHasBeenUpdatedBySystem;
|
||||
|
||||
if (shouldFallbackToBareTextComparison) {
|
||||
|
||||
@@ -36,7 +36,7 @@ Pod::Spec.new do |s|
|
||||
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
|
||||
s.header_dir = "React"
|
||||
s.framework = "JavaScriptCore"
|
||||
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/Headers/Private/React-Core\" \"$(PODS_ROOT)/Headers/Public/React-Codegen\"" }
|
||||
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/Headers/Private/React-Core\" \"$(PODS_ROOT)/Headers/Public/React-Codegen\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\"" }
|
||||
s.xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/glog\" \"$(PODS_ROOT)/RCT-Folly\"",
|
||||
"OTHER_CFLAGS" => "$(inherited) -DRN_FABRIC_ENABLED" + " " + folly_flags }
|
||||
|
||||
|
||||
@@ -281,10 +281,13 @@ task androidSourcesJar(type: Jar) {
|
||||
android {
|
||||
compileSdkVersion 31
|
||||
|
||||
// Used to override the NDK path & version on internal CI
|
||||
if (System.getenv("ANDROID_NDK") != null && System.getenv("LOCAL_ANDROID_NDK_VERSION") != null) {
|
||||
ndkPath System.getenv("ANDROID_NDK")
|
||||
ndkVersion System.getenv("LOCAL_ANDROID_NDK_VERSION")
|
||||
// Used to override the NDK path/version on internal CI or by allowing
|
||||
// users to customize the NDK path/version from their root project (e.g. for M1 support)
|
||||
if (rootProject.hasProperty("ndkPath")) {
|
||||
ndkPath rootProject.ext.ndkPath
|
||||
}
|
||||
if (rootProject.hasProperty("ndkVersion")) {
|
||||
ndkVersion rootProject.ext.ndkVersion
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
@@ -318,6 +321,20 @@ android {
|
||||
// This flag will suppress "fcntl(): Bad file descriptor" warnings on local builds.
|
||||
arguments "--output-sync=none"
|
||||
}
|
||||
|
||||
// Note: On Windows there are limits on number of character in file paths and in command lines
|
||||
// Ref: https://android.googlesource.com/platform/ndk/+/master/docs/BuildSystemMaintainers.md#Path-Length-Limits
|
||||
// NDK allows circumventing command line limits using response(RSP) files as inputs using NDK_APP_SHORT_COMMANDS flag.
|
||||
//
|
||||
// Windows can support long file paths if configured through registry or by prefixing all file paths with a special character sequence
|
||||
// The latter requires changes in NDK. And there are tools in NDK (AR) which is not able to handle long paths (>256) even after setting the registry key.
|
||||
// The new architecutre source tree is too deep, and the object file naming conventions in NDK makes the matters worse, by producing incredibly long file paths.
|
||||
// Other solutions such as symlinking source code etc. didn't work as expected, and makes the build scripts complicated and hard to manage.
|
||||
// This change temporarily works around the issue by placing the temporary build outputs as short a path as possible within the project path.
|
||||
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
||||
arguments "NDK_OUT=${rootProject.projectDir.getParent()}\\.cxx",
|
||||
"NDK_APP_SHORT_COMMANDS=true"
|
||||
}
|
||||
}
|
||||
}
|
||||
ndk {
|
||||
@@ -351,6 +368,12 @@ android {
|
||||
packagingOptions {
|
||||
exclude("META-INF/NOTICE")
|
||||
exclude("META-INF/LICENSE")
|
||||
// We intentionally don't want to bundle any JS Runtime inside the Android AAR
|
||||
// we produce. The reason behind this is that we want to allow users to pick the
|
||||
// JS engine by specifying a dependency on either `hermes-engine` or `android-jsc`
|
||||
// that will include the necessary .so files to load.
|
||||
exclude("**/libhermes.so")
|
||||
exclude("**/libjsc.so")
|
||||
}
|
||||
|
||||
configurations {
|
||||
@@ -400,7 +423,7 @@ react {
|
||||
// This should be changed to a more generic name, e.g. `ReactCoreSpec`.
|
||||
libraryName = "rncore"
|
||||
jsRootDir = file("../Libraries")
|
||||
reactRoot = file("$projectDir/..")
|
||||
reactNativeDir = file("$projectDir/..")
|
||||
useJavaGenerator = System.getenv("USE_CODEGEN_JAVAPOET")?.toBoolean() ?: false
|
||||
// We search for the codegen in either one of the `node_modules` folder or in the
|
||||
// root packages folder (that's for when we build from source without calling `yarn install`).
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
VERSION_NAME=1000.0.0-main
|
||||
VERSION_NAME=0.68.1
|
||||
GROUP=com.facebook.react
|
||||
|
||||
POM_NAME=ReactNative
|
||||
|
||||
Vendored
+4
-6
@@ -24,17 +24,15 @@
|
||||
# See http://sourceforge.net/p/proguard/bugs/466/
|
||||
-keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
|
||||
-keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
|
||||
-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
|
||||
-keep,allowobfuscation @interface com.facebook.jni.annotations.DoNotStrip
|
||||
|
||||
# Do not strip any method/class that is annotated with @DoNotStrip
|
||||
-keep @com.facebook.proguard.annotations.DoNotStrip class *
|
||||
-keep @com.facebook.common.internal.DoNotStrip class *
|
||||
-keep @com.facebook.jni.annotations.DoNotStrip class *
|
||||
-keepclassmembers class * {
|
||||
@com.facebook.proguard.annotations.DoNotStrip *;
|
||||
@com.facebook.common.internal.DoNotStrip *;
|
||||
@com.facebook.jni.annotations.DoNotStrip *;
|
||||
}
|
||||
|
||||
-keep @com.facebook.proguard.annotations.DoNotStripAny class * {
|
||||
*;
|
||||
}
|
||||
|
||||
-keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
|
||||
|
||||
@@ -27,6 +27,7 @@ import android.view.Surface;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.view.WindowInsets;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.FrameLayout;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -826,9 +827,12 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot {
|
||||
getRootView().getWindowVisibleDisplayFrame(mVisibleViewArea);
|
||||
int notchHeight = 0;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
DisplayCutout displayCutout = getRootView().getRootWindowInsets().getDisplayCutout();
|
||||
if (displayCutout != null) {
|
||||
notchHeight = displayCutout.getSafeInsetTop();
|
||||
WindowInsets insets = getRootView().getRootWindowInsets();
|
||||
if (insets != null) {
|
||||
DisplayCutout displayCutout = insets.getDisplayCutout();
|
||||
if (displayCutout != null) {
|
||||
notchHeight = displayCutout.getSafeInsetTop();
|
||||
}
|
||||
}
|
||||
}
|
||||
final int heightDiff =
|
||||
|
||||
@@ -102,9 +102,6 @@ public class ReactFeatureFlags {
|
||||
|
||||
public static boolean insertZReorderBarriersOnViewGroupChildren = true;
|
||||
|
||||
/** TODO: T103427072 Delete ReactFeatureFlags.enableNestedTextOnPressEventFix */
|
||||
public static boolean enableNestedTextOnPressEventFix = true;
|
||||
|
||||
/** TODO: T107492383 Delete this flag. Enables postprocessor for rounded corners for Image */
|
||||
public static boolean enableRoundedCornerPostprocessing = false;
|
||||
}
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@ import java.util.Map;
|
||||
public class ReactNativeVersion {
|
||||
public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
|
||||
"major", 0,
|
||||
"minor", 0,
|
||||
"patch", 0,
|
||||
"minor", 68,
|
||||
"patch", 1,
|
||||
"prerelease", null);
|
||||
}
|
||||
|
||||
@@ -343,11 +343,6 @@ public class ReactTextShadowNode extends ReactBaseTextShadowNode {
|
||||
mJustificationMode);
|
||||
uiViewOperationQueue.enqueueUpdateExtraData(getReactTag(), reactTextUpdate);
|
||||
}
|
||||
|
||||
if (mAdjustsFontSizeToFit) {
|
||||
// Nodes with `adjustsFontSizeToFit` enabled need to be remeasured on every relayout.
|
||||
markUpdated();
|
||||
}
|
||||
}
|
||||
|
||||
@ReactProp(name = "onTextLayout")
|
||||
|
||||
@@ -19,7 +19,6 @@ import android.text.TextUtils;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.text.util.Linkify;
|
||||
import android.view.Gravity;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -32,7 +31,6 @@ import com.facebook.react.bridge.ReactContext;
|
||||
import com.facebook.react.bridge.WritableArray;
|
||||
import com.facebook.react.bridge.WritableMap;
|
||||
import com.facebook.react.common.ReactConstants;
|
||||
import com.facebook.react.config.ReactFeatureFlags;
|
||||
import com.facebook.react.uimanager.PixelUtil;
|
||||
import com.facebook.react.uimanager.ReactCompoundView;
|
||||
import com.facebook.react.uimanager.UIManagerModule;
|
||||
@@ -384,16 +382,6 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
|
||||
return target;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent ev) {
|
||||
// The root view always assumes any view that was tapped wants the touch
|
||||
// and sends the event to JS as such.
|
||||
// We don't need to do bubbling in native (it's already happening in JS).
|
||||
// For an explanation of bubbling and capturing, see
|
||||
// http://javascript.info/tutorial/bubbling-and-capturing#capturing
|
||||
return ReactFeatureFlags.enableNestedTextOnPressEventFix;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean verifyDrawable(Drawable drawable) {
|
||||
if (mContainsImages && getText() instanceof Spanned) {
|
||||
|
||||
@@ -16,8 +16,8 @@ namespace facebook::react {
|
||||
|
||||
constexpr struct {
|
||||
int32_t Major = 0;
|
||||
int32_t Minor = 0;
|
||||
int32_t Patch = 0;
|
||||
int32_t Minor = 68;
|
||||
int32_t Patch = 1;
|
||||
std::string_view Prerelease = "";
|
||||
} ReactNativeVersion;
|
||||
|
||||
|
||||
@@ -33,11 +33,11 @@ MapBuffer::MapBuffer(std::vector<uint8_t> data) : bytes_(std::move(data)) {
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t MapBuffer::getKeyBucket(Key key) const {
|
||||
uint32_t lo = 0;
|
||||
uint32_t hi = count_ - 1;
|
||||
int32_t MapBuffer::getKeyBucket(Key key) const {
|
||||
int32_t lo = 0;
|
||||
int32_t hi = count_ - 1;
|
||||
while (lo <= hi) {
|
||||
uint32_t mid = (lo + hi) >> 1;
|
||||
int32_t mid = (lo + hi) >> 1;
|
||||
|
||||
Key midVal =
|
||||
*reinterpret_cast<Key const *>(bytes_.data() + bucketOffset(mid));
|
||||
@@ -112,7 +112,7 @@ MapBuffer MapBuffer::getMapBuffer(Key key) const {
|
||||
return MapBuffer(std::move(value));
|
||||
}
|
||||
|
||||
uint32_t MapBuffer::size() const {
|
||||
size_t MapBuffer::size() const {
|
||||
return bytes_.size();
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +80,8 @@ class MapBuffer {
|
||||
uint32_t bufferSize; // Amount of bytes used to store the map in memory
|
||||
};
|
||||
|
||||
struct __attribute__((__packed__)) Bucket {
|
||||
#pragma pack(push, 1)
|
||||
struct Bucket {
|
||||
Key key;
|
||||
uint16_t type;
|
||||
uint64_t data;
|
||||
@@ -88,6 +89,7 @@ class MapBuffer {
|
||||
Bucket(Key key, uint16_t type, uint64_t data)
|
||||
: key(key), type(type), data(data) {}
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
static_assert(sizeof(Header) == 8, "MapBuffer header size is incorrect.");
|
||||
static_assert(sizeof(Bucket) == 12, "MapBuffer bucket size is incorrect.");
|
||||
@@ -124,7 +126,7 @@ class MapBuffer {
|
||||
// TODO T83483191: review this declaration
|
||||
MapBuffer getMapBuffer(MapBuffer::Key key) const;
|
||||
|
||||
uint32_t size() const;
|
||||
size_t size() const;
|
||||
|
||||
uint8_t const *data() const;
|
||||
|
||||
@@ -140,7 +142,7 @@ class MapBuffer {
|
||||
// returns the relative offset of the first byte of dynamic data
|
||||
int32_t getDynamicDataOffset() const;
|
||||
|
||||
uint32_t getKeyBucket(MapBuffer::Key key) const;
|
||||
int32_t getKeyBucket(MapBuffer::Key key) const;
|
||||
|
||||
friend ReadableMapBuffer;
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace facebook {
|
||||
namespace react {
|
||||
|
||||
constexpr uint32_t INT_SIZE = sizeof(uint32_t);
|
||||
constexpr double DOUBLE_SIZE = sizeof(double);
|
||||
constexpr uint32_t DOUBLE_SIZE = sizeof(double);
|
||||
constexpr uint32_t MAX_BUCKET_VALUE_SIZE = sizeof(uint64_t);
|
||||
|
||||
MapBuffer MapBufferBuilder::EMPTY() {
|
||||
@@ -23,6 +23,8 @@ MapBuffer MapBufferBuilder::EMPTY() {
|
||||
|
||||
MapBufferBuilder::MapBufferBuilder(uint32_t initialSize) {
|
||||
buckets_.reserve(initialSize);
|
||||
header_.count = 0;
|
||||
header_.bufferSize = 0;
|
||||
}
|
||||
|
||||
void MapBufferBuilder::storeKeyValue(
|
||||
@@ -76,7 +78,7 @@ void MapBufferBuilder::putInt(MapBuffer::Key key, int32_t value) {
|
||||
}
|
||||
|
||||
void MapBufferBuilder::putString(MapBuffer::Key key, std::string const &value) {
|
||||
int32_t strSize = value.size();
|
||||
auto strSize = value.size();
|
||||
const char *strData = value.data();
|
||||
|
||||
// format [length of string (int)] + [Array of Characters in the string]
|
||||
@@ -94,7 +96,7 @@ void MapBufferBuilder::putString(MapBuffer::Key key, std::string const &value) {
|
||||
}
|
||||
|
||||
void MapBufferBuilder::putMapBuffer(MapBuffer::Key key, MapBuffer const &map) {
|
||||
int32_t mapBufferSize = map.size();
|
||||
auto mapBufferSize = map.size();
|
||||
|
||||
auto offset = dynamicData_.size();
|
||||
|
||||
@@ -122,9 +124,9 @@ MapBuffer MapBufferBuilder::build() {
|
||||
// Create buffer: [header] + [key, values] + [dynamic data]
|
||||
auto bucketSize = buckets_.size() * sizeof(MapBuffer::Bucket);
|
||||
auto headerSize = sizeof(MapBuffer::Header);
|
||||
uint32_t bufferSize = headerSize + bucketSize + dynamicData_.size();
|
||||
auto bufferSize = headerSize + bucketSize + dynamicData_.size();
|
||||
|
||||
header_.bufferSize = bufferSize;
|
||||
header_.bufferSize = static_cast<uint32_t>(bufferSize);
|
||||
|
||||
if (needsSort_) {
|
||||
std::sort(buckets_.begin(), buckets_.end(), compareBuckets);
|
||||
|
||||
@@ -38,7 +38,7 @@ class MapBufferBuilder {
|
||||
MapBuffer build();
|
||||
|
||||
private:
|
||||
MapBuffer::Header header_ = {.count = 0, .bufferSize = 0};
|
||||
MapBuffer::Header header_;
|
||||
|
||||
std::vector<MapBuffer::Bucket> buckets_{};
|
||||
|
||||
|
||||
@@ -22,6 +22,13 @@
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
// Explicitly define destructors here, as they to exist in order to act as a
|
||||
// "key function" for the ShadowNodeWrapper class -- this allow for RTTI to work
|
||||
// properly across dynamic library boundaries (i.e. dynamic_cast that is used by
|
||||
// isHostObject method)
|
||||
ShadowNodeWrapper::~ShadowNodeWrapper() = default;
|
||||
ShadowNodeListWrapper::~ShadowNodeListWrapper() = default;
|
||||
|
||||
static std::unique_ptr<LeakChecker> constructLeakCheckerIfNeeded(
|
||||
RuntimeExecutor const &runtimeExecutor) {
|
||||
#ifdef REACT_NATIVE_DEBUG
|
||||
|
||||
@@ -30,6 +30,11 @@ struct ShadowNodeWrapper : public jsi::HostObject {
|
||||
ShadowNodeWrapper(SharedShadowNode shadowNode)
|
||||
: shadowNode(std::move(shadowNode)) {}
|
||||
|
||||
// The below method needs to be implemented out-of-line in order for the class
|
||||
// to have at least one "key function" (see
|
||||
// https://itanium-cxx-abi.github.io/cxx-abi/abi.html#vague-vtable)
|
||||
~ShadowNodeWrapper() override;
|
||||
|
||||
ShadowNode::Shared shadowNode;
|
||||
};
|
||||
|
||||
@@ -37,6 +42,11 @@ struct ShadowNodeListWrapper : public jsi::HostObject {
|
||||
ShadowNodeListWrapper(SharedShadowNodeUnsharedList shadowNodeList)
|
||||
: shadowNodeList(shadowNodeList) {}
|
||||
|
||||
// The below method needs to be implemented out-of-line in order for the class
|
||||
// to have at least one "key function" (see
|
||||
// https://itanium-cxx-abi.github.io/cxx-abi/abi.html#vague-vtable)
|
||||
~ShadowNodeListWrapper() override;
|
||||
|
||||
SharedShadowNodeUnsharedList shadowNodeList;
|
||||
};
|
||||
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
val ndkPath by extra(System.getenv("ANDROID_NDK"))
|
||||
val ndkVersion by extra(System.getenv("ANDROID_NDK_VERSION"))
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
google()
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
# This is causing issue with dependencies task: https://github.com/gradle/gradle/issues/9645#issuecomment-530746758
|
||||
# org.gradle.configureondemand=true
|
||||
org.gradle.daemon=true
|
||||
org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
||||
org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8
|
||||
org.gradle.parallel=true
|
||||
|
||||
android.useAndroidX=true
|
||||
|
||||
+46
-13
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"name": "react-native",
|
||||
"private": true,
|
||||
"version": "1000.0.0",
|
||||
"version": "0.68.1",
|
||||
"bin": "./cli.js",
|
||||
"description": "A framework for building native apps using React",
|
||||
"license": "MIT",
|
||||
@@ -83,18 +82,14 @@
|
||||
"test-android-e2e": "yarn run docker-build-android && yarn run test-android-run-e2e",
|
||||
"test-ios": "./scripts/objc-test.sh test"
|
||||
},
|
||||
"workspaces": [
|
||||
"packages/!(eslint-config-react-native-community)",
|
||||
"repo-config"
|
||||
],
|
||||
"peerDependencies": {
|
||||
"react": "17.0.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@jest/create-cache-key-function": "^27.0.1",
|
||||
"@react-native-community/cli": "^6.0.0",
|
||||
"@react-native-community/cli-platform-android": "^6.0.0",
|
||||
"@react-native-community/cli-platform-ios": "^6.0.0",
|
||||
"@react-native-community/cli": "^7.0.3",
|
||||
"@react-native-community/cli-platform-android": "^7.0.1",
|
||||
"@react-native-community/cli-platform-ios": "^7.0.1",
|
||||
"@react-native/assets": "1.0.0",
|
||||
"@react-native/normalize-color": "2.0.0",
|
||||
"@react-native/polyfills": "2.0.0",
|
||||
@@ -113,18 +108,56 @@
|
||||
"pretty-format": "^26.5.2",
|
||||
"promise": "^8.0.3",
|
||||
"react-devtools-core": "^4.23.0",
|
||||
"react-native-gradle-plugin": "^0.0.6",
|
||||
"react-refresh": "^0.4.0",
|
||||
"react-shallow-renderer": "16.14.1",
|
||||
"regenerator-runtime": "^0.13.2",
|
||||
"scheduler": "^0.20.2",
|
||||
"stacktrace-parser": "^0.1.3",
|
||||
"use-subscription": "^1.0.0",
|
||||
"use-subscription": ">=1.0.0 <1.6.0",
|
||||
"whatwg-fetch": "^3.0.0",
|
||||
"ws": "^6.1.4"
|
||||
"ws": "^6.1.4",
|
||||
"react-native-codegen": "^0.0.13"
|
||||
},
|
||||
"devDependencies": {
|
||||
"flow-bin": "^0.170.0",
|
||||
"react": "17.0.2"
|
||||
"react": "17.0.2",
|
||||
"@babel/core": "^7.14.0",
|
||||
"@babel/generator": "^7.14.0",
|
||||
"@react-native-community/eslint-plugin": "*",
|
||||
"@react-native/eslint-plugin-specs": ">0.0.2",
|
||||
"@reactions/component": "^2.0.2",
|
||||
"async": "^2.4.0",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"clang-format": "^1.2.4",
|
||||
"connect": "^3.6.5",
|
||||
"coveralls": "^3.0.2",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-fb-strict": "^26.0.0",
|
||||
"eslint-config-fbjs": "^3.1.1",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-babel": "^5.3.1",
|
||||
"eslint-plugin-eslint-comments": "^3.2.0",
|
||||
"eslint-plugin-flowtype": "^7.0.0",
|
||||
"eslint-plugin-jest": "^25.2.4",
|
||||
"eslint-plugin-jsx-a11y": "^6.4.1",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"eslint-plugin-react": "^7.26.1",
|
||||
"eslint-plugin-react-hooks": "^4.2.0",
|
||||
"eslint-plugin-react-native": "^3.11.0",
|
||||
"eslint-plugin-relay": "^1.8.2",
|
||||
"inquirer": "^7.1.0",
|
||||
"jest": "^26.6.3",
|
||||
"jest-junit": "^10.0.0",
|
||||
"jscodeshift": "^0.13.1",
|
||||
"metro-babel-register": "0.67.0",
|
||||
"mkdirp": "^0.5.1",
|
||||
"prettier": "^2.4.1",
|
||||
"react-test-renderer": "17.0.2",
|
||||
"shelljs": "^0.8.4",
|
||||
"signedsource": "^1.0.0",
|
||||
"ws": "^6.1.4",
|
||||
"yargs": "^15.3.1"
|
||||
},
|
||||
"codegenConfig": {
|
||||
"libraries": [
|
||||
@@ -144,4 +177,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,8 +46,8 @@ dependencies {
|
||||
}
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-native-gradle-plugin",
|
||||
"version": "0.0.4",
|
||||
"version": "0.0.6",
|
||||
"description": "⚛️ Gradle Plugin for React Native",
|
||||
"homepage": "https://github.com/facebook/react-native/tree/HEAD/packages/react-native-gradle-plugin",
|
||||
"repository": {
|
||||
@@ -23,8 +23,6 @@
|
||||
"src/main",
|
||||
"README.md"
|
||||
],
|
||||
"dependencies": {
|
||||
"react-native-codegen": "*"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {}
|
||||
}
|
||||
|
||||
+45
-14
@@ -29,13 +29,13 @@ abstract class ReactExtension @Inject constructor(project: Project) {
|
||||
val applyAppPlugin: Property<Boolean> = objects.property(Boolean::class.java).convention(false)
|
||||
|
||||
/**
|
||||
* The path to the react root folder. This is the path to the root folder where the `node_modules`
|
||||
* folder is present. All the CLI commands will be invoked from this folder as working directory.
|
||||
* The path to the root of your project. This is the path to where the `package.json` lives. All
|
||||
* the CLI commands will be invoked from this folder as working directory.
|
||||
*
|
||||
* Default: $projectDir/../../
|
||||
* Default: ${rootProject.dir}/../
|
||||
*/
|
||||
val reactRoot: DirectoryProperty =
|
||||
objects.directoryProperty().convention(project.layout.projectDirectory.dir("../../"))
|
||||
val root: DirectoryProperty =
|
||||
objects.directoryProperty().convention(project.rootProject.layout.projectDirectory.dir("../"))
|
||||
|
||||
/**
|
||||
* The path to the JS entry file. If not specified, the plugin will try to resolve it using a list
|
||||
@@ -45,7 +45,7 @@ abstract class ReactExtension @Inject constructor(project: Project) {
|
||||
|
||||
/**
|
||||
* The path to the React Native CLI. If not specified, the plugin will try to resolve it looking
|
||||
* for `react-native` CLI inside `node_modules` in [reactRoot].
|
||||
* for `react-native` CLI inside `node_modules` in [root].
|
||||
*/
|
||||
val cliPath: Property<String> = objects.property(String::class.java)
|
||||
|
||||
@@ -56,9 +56,7 @@ abstract class ReactExtension @Inject constructor(project: Project) {
|
||||
val nodeExecutableAndArgs: ListProperty<String> =
|
||||
objects.listProperty(String::class.java).convention(listOf("node"))
|
||||
|
||||
/**
|
||||
* The command to use to invoke bundle. Default is `bundle` and will be invoked on [reactRoot].
|
||||
*/
|
||||
/** The command to use to invoke bundle. Default is `bundle` and will be invoked on [root]. */
|
||||
val bundleCommand: Property<String> = objects.property(String::class.java).convention("bundle")
|
||||
|
||||
/**
|
||||
@@ -190,19 +188,27 @@ abstract class ReactExtension @Inject constructor(project: Project) {
|
||||
/** Codegen Config */
|
||||
|
||||
/**
|
||||
* The path to the react-native-codegen folder.
|
||||
* The path to the react-native-codegen NPM package folder.
|
||||
*
|
||||
* Default: $projectDir/../../node_modules/react-native-codegen
|
||||
* Default: ${rootProject.dir}/../node_modules/react-native-codegen
|
||||
*/
|
||||
val codegenDir: DirectoryProperty =
|
||||
objects.directoryProperty().convention(reactRoot.dir("node_modules/react-native-codegen"))
|
||||
objects.directoryProperty().convention(root.dir("node_modules/react-native-codegen"))
|
||||
|
||||
/**
|
||||
* The path to the react-native NPM package folder.
|
||||
*
|
||||
* Default: ${rootProject.dir}/../node_modules/react-native-codegen
|
||||
*/
|
||||
val reactNativeDir: DirectoryProperty =
|
||||
objects.directoryProperty().convention(root.dir("node_modules/react-native"))
|
||||
|
||||
/**
|
||||
* The root directory for all JS files for the app.
|
||||
*
|
||||
* Default: $projectDir/../../
|
||||
* Default: [root] (i.e. ${rootProject.dir}/../)
|
||||
*/
|
||||
val jsRootDir: DirectoryProperty = objects.directoryProperty().convention(reactRoot.get())
|
||||
val jsRootDir: DirectoryProperty = objects.directoryProperty().convention(root.get())
|
||||
|
||||
/**
|
||||
* The library name that will be used for the codegen artifacts.
|
||||
@@ -222,4 +228,29 @@ abstract class ReactExtension @Inject constructor(project: Project) {
|
||||
|
||||
/** Whether the Java Generator (based on Javapoet) should be used or not. Default: false */
|
||||
val useJavaGenerator: Property<Boolean> = objects.property(Boolean::class.java).convention(false)
|
||||
|
||||
/**
|
||||
* The `reactRoot` property was confusing and should not be used.
|
||||
*
|
||||
* You should instead use either:
|
||||
* - [root] to point to your root project (where the package.json lives)
|
||||
* - [reactNativeDir] to point to the NPM package of react native.
|
||||
*
|
||||
* A valid configuration would look like:
|
||||
*
|
||||
* ```
|
||||
* react {
|
||||
* root = rootProject.file("..")
|
||||
* reactNativeDir = rootProject.file("../node_modules/react-native")
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* Please also note that those are the default value and you most likely don't need those at all.
|
||||
*/
|
||||
@Deprecated(
|
||||
"reactRoot was confusing and has been replace with root" +
|
||||
"to point to your root project and reactNativeDir to point to " +
|
||||
"the folder of the react-native NPM package",
|
||||
replaceWith = ReplaceWith("reactNativeRoot"))
|
||||
val reactRoot: DirectoryProperty = objects.directoryProperty()
|
||||
}
|
||||
|
||||
+23
-1
@@ -15,17 +15,38 @@ import com.facebook.react.tasks.BuildCodegenCLITask
|
||||
import com.facebook.react.tasks.GenerateCodegenArtifactsTask
|
||||
import com.facebook.react.tasks.GenerateCodegenSchemaTask
|
||||
import java.io.File
|
||||
import kotlin.system.exitProcess
|
||||
import org.gradle.api.Plugin
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.Task
|
||||
import org.gradle.internal.jvm.Jvm
|
||||
|
||||
class ReactPlugin : Plugin<Project> {
|
||||
override fun apply(project: Project) {
|
||||
checkJvmVersion(project)
|
||||
val extension = project.extensions.create("react", ReactExtension::class.java, project)
|
||||
applyAppPlugin(project, extension)
|
||||
applyCodegenPlugin(project, extension)
|
||||
}
|
||||
|
||||
private fun checkJvmVersion(project: Project) {
|
||||
val jvmVersion = Jvm.current()?.javaVersion?.majorVersion
|
||||
if ((jvmVersion?.toIntOrNull() ?: 0) <= 8) {
|
||||
project.logger.error(
|
||||
"""
|
||||
|
||||
********************************************************************************
|
||||
|
||||
ERROR: requires JDK11 or higher.
|
||||
Incompatible major version detected: '$jvmVersion'
|
||||
|
||||
********************************************************************************
|
||||
|
||||
""".trimIndent())
|
||||
exitProcess(1)
|
||||
}
|
||||
}
|
||||
|
||||
private fun applyAppPlugin(project: Project, config: ReactExtension) {
|
||||
project.afterEvaluate {
|
||||
if (config.applyAppPlugin.getOrElse(false)) {
|
||||
@@ -75,7 +96,8 @@ class ReactPlugin : Plugin<Project> {
|
||||
project.tasks.register(
|
||||
"generateCodegenArtifactsFromSchema", GenerateCodegenArtifactsTask::class.java) {
|
||||
it.dependsOn(generateCodegenSchemaTask)
|
||||
it.reactRoot.set(extension.reactRoot)
|
||||
it.reactNativeDir.set(extension.reactNativeDir)
|
||||
it.deprecatedReactRoot.set(extension.reactRoot)
|
||||
it.nodeExecutableAndArgs.set(extension.nodeExecutableAndArgs)
|
||||
it.codegenDir.set(extension.codegenDir)
|
||||
it.useJavaGenerator.set(extension.useJavaGenerator)
|
||||
|
||||
+3
-6
@@ -17,7 +17,6 @@ import com.facebook.react.utils.detectedCliPath
|
||||
import com.facebook.react.utils.detectedEntryFile
|
||||
import com.facebook.react.utils.detectedHermesCommand
|
||||
import java.io.File
|
||||
import java.util.*
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.Task
|
||||
import org.gradle.api.tasks.Copy
|
||||
@@ -56,11 +55,9 @@ internal fun Project.configureReactTasks(variant: BaseVariant, config: ReactExte
|
||||
it.group = REACT_GROUP
|
||||
it.description = "create JS bundle and assets for $targetName."
|
||||
|
||||
it.reactRoot = config.reactRoot.get().asFile
|
||||
it.reactRoot = config.root.get().asFile
|
||||
it.sources =
|
||||
fileTree(config.reactRoot) { fileTree ->
|
||||
fileTree.setExcludes(config.inputExcludes.get())
|
||||
}
|
||||
fileTree(config.root) { fileTree -> fileTree.setExcludes(config.inputExcludes.get()) }
|
||||
it.execCommand = execCommand
|
||||
it.bundleCommand = config.bundleCommand.get()
|
||||
it.devEnabled = !config.disableDevForVariant(variant)
|
||||
@@ -98,7 +95,7 @@ internal fun Project.configureReactTasks(variant: BaseVariant, config: ReactExte
|
||||
it.group = REACT_GROUP
|
||||
it.description = "bundle hermes resources for $targetName"
|
||||
|
||||
it.reactRoot = config.reactRoot.get().asFile
|
||||
it.reactRoot = config.root.get().asFile
|
||||
it.hermesCommand = detectedHermesCommand(config)
|
||||
it.hermesFlags = config.hermesFlagsForVariant(variant)
|
||||
it.jsBundleFile = jsBundleFile
|
||||
|
||||
+32
-4
@@ -8,7 +8,7 @@
|
||||
package com.facebook.react.tasks
|
||||
|
||||
import com.facebook.react.codegen.generator.JavaGenerator
|
||||
import com.facebook.react.utils.windowsAwareYarn
|
||||
import com.facebook.react.utils.windowsAwareCommandLine
|
||||
import org.gradle.api.GradleException
|
||||
import org.gradle.api.file.Directory
|
||||
import org.gradle.api.file.DirectoryProperty
|
||||
@@ -20,7 +20,7 @@ import org.gradle.api.tasks.*
|
||||
|
||||
abstract class GenerateCodegenArtifactsTask : Exec() {
|
||||
|
||||
@get:Internal abstract val reactRoot: DirectoryProperty
|
||||
@get:Internal abstract val reactNativeDir: DirectoryProperty
|
||||
|
||||
@get:Internal abstract val codegenDir: DirectoryProperty
|
||||
|
||||
@@ -34,6 +34,9 @@ abstract class GenerateCodegenArtifactsTask : Exec() {
|
||||
|
||||
@get:Input abstract val libraryName: Property<String>
|
||||
|
||||
// We're keeping this just to fire a warning at the user should they use the `reactRoot` property.
|
||||
@get:Internal abstract val deprecatedReactRoot: DirectoryProperty
|
||||
|
||||
@get:InputFile
|
||||
val combineJsToSchemaCli: Provider<RegularFile> =
|
||||
codegenDir.file("lib/cli/combine/combine-js-to-schema-cli.js")
|
||||
@@ -46,6 +49,7 @@ abstract class GenerateCodegenArtifactsTask : Exec() {
|
||||
@get:OutputDirectory val generatedJniFiles: Provider<Directory> = generatedSrcDir.dir("jni")
|
||||
|
||||
override fun exec() {
|
||||
checkForDeprecatedProperty()
|
||||
setupCommandLine()
|
||||
super.exec()
|
||||
if (useJavaGenerator.getOrElse(false)) {
|
||||
@@ -63,11 +67,35 @@ abstract class GenerateCodegenArtifactsTask : Exec() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkForDeprecatedProperty() {
|
||||
if (deprecatedReactRoot.isPresent) {
|
||||
project.logger.error(
|
||||
"""
|
||||
********************************************************************************
|
||||
The `reactRoot` property is deprecated and will be removed in
|
||||
future versions of React Native. The property is currently ignored.
|
||||
|
||||
You should instead use either:
|
||||
- [root] to point to your root project (where the package.json lives)
|
||||
- [reactNativeDir] to point to the NPM package of react native.
|
||||
|
||||
You should be fine by just removing the `reactRoot` line entirely from
|
||||
your build.gradle file. Otherwise a valid configuration would look like:
|
||||
|
||||
react {
|
||||
root = rootProject.file('..')
|
||||
reactNativeDir = rootProject.file('../node_modules/react-native')
|
||||
}
|
||||
********************************************************************************
|
||||
""".trimIndent())
|
||||
}
|
||||
}
|
||||
|
||||
internal fun setupCommandLine() {
|
||||
commandLine(
|
||||
windowsAwareYarn(
|
||||
windowsAwareCommandLine(
|
||||
*nodeExecutableAndArgs.get().toTypedArray(),
|
||||
reactRoot.file("scripts/generate-specs-cli.js").get().asFile.absolutePath,
|
||||
reactNativeDir.file("scripts/generate-specs-cli.js").get().asFile.absolutePath,
|
||||
"--platform",
|
||||
"android",
|
||||
"--schemaPath",
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@
|
||||
|
||||
package com.facebook.react.tasks
|
||||
|
||||
import com.facebook.react.utils.windowsAwareYarn
|
||||
import com.facebook.react.utils.windowsAwareCommandLine
|
||||
import org.gradle.api.file.DirectoryProperty
|
||||
import org.gradle.api.file.RegularFile
|
||||
import org.gradle.api.provider.ListProperty
|
||||
@@ -49,7 +49,7 @@ abstract class GenerateCodegenSchemaTask : Exec() {
|
||||
|
||||
internal fun setupCommandLine() {
|
||||
commandLine(
|
||||
windowsAwareYarn(
|
||||
windowsAwareCommandLine(
|
||||
*nodeExecutableAndArgs.get().toTypedArray(),
|
||||
codegenDir
|
||||
.file("lib/cli/combine/combine-js-to-schema-cli.js")
|
||||
|
||||
+18
-5
@@ -11,7 +11,6 @@ package com.facebook.react.utils
|
||||
|
||||
import com.facebook.react.ReactExtension
|
||||
import java.io.File
|
||||
import java.util.*
|
||||
import org.apache.tools.ant.taskdefs.condition.Os
|
||||
|
||||
/**
|
||||
@@ -25,7 +24,7 @@ import org.apache.tools.ant.taskdefs.condition.Os
|
||||
*/
|
||||
internal fun detectedEntryFile(config: ReactExtension): File =
|
||||
detectEntryFile(
|
||||
entryFile = config.entryFile.orNull?.asFile, reactRoot = config.reactRoot.get().asFile)
|
||||
entryFile = config.entryFile.orNull?.asFile, reactRoot = config.root.get().asFile)
|
||||
|
||||
/**
|
||||
* Computes the CLI location for React Native. The Algo follows this order:
|
||||
@@ -40,7 +39,7 @@ internal fun detectedCliPath(
|
||||
): String =
|
||||
detectCliPath(
|
||||
projectDir = projectDir,
|
||||
reactRoot = config.reactRoot.get().asFile,
|
||||
reactRoot = config.root.get().asFile,
|
||||
preconfiguredCliPath = config.cliPath.orNull)
|
||||
|
||||
/**
|
||||
@@ -68,7 +67,18 @@ private fun detectCliPath(
|
||||
): String {
|
||||
// 1. preconfigured path
|
||||
if (preconfiguredCliPath != null) {
|
||||
return File(projectDir, preconfiguredCliPath).toString()
|
||||
val preconfiguredCliJsAbsolute = File(preconfiguredCliPath)
|
||||
if (preconfiguredCliJsAbsolute.exists()) {
|
||||
return preconfiguredCliJsAbsolute.absolutePath
|
||||
}
|
||||
val preconfiguredCliJsRelativeToReactRoot = File(reactRoot, preconfiguredCliPath)
|
||||
if (preconfiguredCliJsRelativeToReactRoot.exists()) {
|
||||
return preconfiguredCliJsRelativeToReactRoot.absolutePath
|
||||
}
|
||||
val preconfiguredCliJsRelativeToProject = File(projectDir, preconfiguredCliPath)
|
||||
if (preconfiguredCliJsRelativeToProject.exists()) {
|
||||
return preconfiguredCliJsRelativeToProject.absolutePath
|
||||
}
|
||||
}
|
||||
|
||||
// 2. node module path
|
||||
@@ -82,7 +92,10 @@ private fun detectCliPath(
|
||||
val nodeProcessOutput = nodeProcess.inputStream.use { it.bufferedReader().readText().trim() }
|
||||
|
||||
if (nodeProcessOutput.isNotEmpty()) {
|
||||
return nodeProcessOutput
|
||||
val nodeModuleCliJs = File(nodeProcessOutput)
|
||||
if (nodeModuleCliJs.exists()) {
|
||||
return nodeModuleCliJs.absolutePath
|
||||
}
|
||||
}
|
||||
|
||||
// 3. cli.js in the root folder
|
||||
|
||||
-7
@@ -14,13 +14,6 @@ internal fun windowsAwareCommandLine(vararg args: Any): List<Any> =
|
||||
args.toList()
|
||||
}
|
||||
|
||||
internal fun windowsAwareYarn(vararg args: Any): List<Any> =
|
||||
if (Os.isWindows()) {
|
||||
listOf("yarn.cmd") + args
|
||||
} else {
|
||||
listOf("yarn") + args
|
||||
}
|
||||
|
||||
internal fun windowsAwareBashCommandLine(
|
||||
vararg args: String,
|
||||
bashWindowsHome: String? = null
|
||||
|
||||
+3
-3
@@ -79,13 +79,13 @@ class GenerateCodegenArtifactsTaskTest {
|
||||
@Test
|
||||
@WithOs(OS.UNIX)
|
||||
fun setupCommandLine_withoutJavaGenerator_willSetupCorrectly() {
|
||||
val reactRoot = tempFolder.newFolder("node_modules/react-native/")
|
||||
val reactNativeDir = tempFolder.newFolder("node_modules/react-native/")
|
||||
val codegenDir = tempFolder.newFolder("codegen")
|
||||
val outputDir = tempFolder.newFolder("output")
|
||||
|
||||
val task =
|
||||
createTestTask<GenerateCodegenArtifactsTask> {
|
||||
it.reactRoot.set(reactRoot)
|
||||
it.reactNativeDir.set(reactNativeDir)
|
||||
it.codegenDir.set(codegenDir)
|
||||
it.generatedSrcDir.set(outputDir)
|
||||
it.nodeExecutableAndArgs.set(listOf("--verbose"))
|
||||
@@ -99,7 +99,7 @@ class GenerateCodegenArtifactsTaskTest {
|
||||
listOf(
|
||||
"yarn",
|
||||
"--verbose",
|
||||
File(reactRoot, "scripts/generate-specs-cli.js").toString(),
|
||||
File(reactNativeDir, "scripts/generate-specs-cli.js").toString(),
|
||||
"--platform",
|
||||
"android",
|
||||
"--schemaPath",
|
||||
|
||||
+42
-5
@@ -33,7 +33,7 @@ class PathUtilsTest {
|
||||
@Test
|
||||
fun detectedEntryFile_withAndroidEntryPoint() {
|
||||
val extension = TestReactExtension(ProjectBuilder.builder().build())
|
||||
extension.reactRoot.set(tempFolder.root)
|
||||
extension.root.set(tempFolder.root)
|
||||
tempFolder.newFile("index.android.js")
|
||||
|
||||
val actual = detectedEntryFile(extension)
|
||||
@@ -44,7 +44,7 @@ class PathUtilsTest {
|
||||
@Test
|
||||
fun detectedEntryFile_withDefaultEntryPoint() {
|
||||
val extension = TestReactExtension(ProjectBuilder.builder().build())
|
||||
extension.reactRoot.set(tempFolder.root)
|
||||
extension.root.set(tempFolder.root)
|
||||
|
||||
val actual = detectedEntryFile(extension)
|
||||
|
||||
@@ -52,10 +52,47 @@ class PathUtilsTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
fun detectedCliPath_withCliPathFromExtension() {
|
||||
fun detectedCliPath_withCliPathFromExtensionAbsolute() {
|
||||
val project = ProjectBuilder.builder().build()
|
||||
val extension = TestReactExtension(project)
|
||||
val expected = File(project.projectDir, "fake-cli.sh")
|
||||
val expected =
|
||||
File(project.projectDir, "abs/fake-cli.sh").apply {
|
||||
parentFile.mkdirs()
|
||||
writeText("<!-- nothing to see here -->")
|
||||
}
|
||||
extension.cliPath.set(project.projectDir + "/abs/fake-cli.sh")
|
||||
|
||||
val actual = detectedCliPath(project.projectDir, extension)
|
||||
|
||||
assertEquals(expected.toString(), actual)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun detectedCliPath_withCliPathFromExtensionInReactFolder() {
|
||||
val project = ProjectBuilder.builder().build()
|
||||
val extension = TestReactExtension(project)
|
||||
val expected =
|
||||
File(project.projectDir, "/react-root/fake-cli.sh").apply {
|
||||
parentFile.mkdirs()
|
||||
writeText("<!-- nothing to see here -->")
|
||||
}
|
||||
extension.cliPath.set("fake-cli.sh")
|
||||
extension.reactRoot.set(project.projectDir + "/react-root")
|
||||
|
||||
val actual = detectedCliPath(project.projectDir, extension)
|
||||
|
||||
assertEquals(expected.toString(), actual)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun detectedCliPath_withCliPathFromExtensionInProjectFolder() {
|
||||
val project = ProjectBuilder.builder().build()
|
||||
val extension = TestReactExtension(project)
|
||||
val expected =
|
||||
File(project.projectDir, "fake-cli.sh").apply {
|
||||
parentFile.mkdirs()
|
||||
writeText("<!-- nothing to see here -->")
|
||||
}
|
||||
extension.cliPath.set("fake-cli.sh")
|
||||
|
||||
val actual = detectedCliPath(project.projectDir, extension)
|
||||
@@ -80,7 +117,7 @@ class PathUtilsTest {
|
||||
fun detectedCliPath_withCliFromNodeModules() {
|
||||
val project = ProjectBuilder.builder().build()
|
||||
val extension = TestReactExtension(project)
|
||||
extension.reactRoot.set(tempFolder.root)
|
||||
extension.root.set(tempFolder.root)
|
||||
val expected =
|
||||
File(tempFolder.root, "node_modules/react-native/cli.js").apply {
|
||||
parentFile.mkdirs()
|
||||
|
||||
-18
@@ -42,24 +42,6 @@ class TaskUtilsTest {
|
||||
assertEquals(listOf("cmd", "/c", "a", "b", "c"), windowsAwareCommandLine("a", "b", "c"))
|
||||
}
|
||||
|
||||
@Test
|
||||
@WithOs(OS.MAC)
|
||||
fun windowsAwareYarn_onMac_returnsTheList() {
|
||||
assertEquals(listOf("yarn", "a", "b", "c"), windowsAwareYarn("a", "b", "c"))
|
||||
}
|
||||
|
||||
@Test
|
||||
@WithOs(OS.UNIX)
|
||||
fun windowsAwareYarn_onLinux_returnsTheList() {
|
||||
assertEquals(listOf("yarn", "a", "b", "c"), windowsAwareYarn("a", "b", "c"))
|
||||
}
|
||||
|
||||
@Test
|
||||
@WithOs(OS.WIN)
|
||||
fun windowsAwareYarn_onWindows_prependsCmd() {
|
||||
assertEquals(listOf("yarn.cmd", "a", "b", "c"), windowsAwareYarn("a", "b", "c"))
|
||||
}
|
||||
|
||||
@Test
|
||||
@WithOs(OS.MAC)
|
||||
fun windowsAwareBashCommandLine_onMac_returnsTheList() {
|
||||
|
||||
@@ -24,7 +24,7 @@ Pod::Spec.new do |s|
|
||||
s.author = "Facebook, Inc. and its affiliates"
|
||||
s.source = { :git => "https://github.com/facebook/my-native-view.git", :tag => "#{s.version}" }
|
||||
s.pod_target_xcconfig = {
|
||||
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/boost\""
|
||||
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/boost\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\"",
|
||||
}
|
||||
|
||||
s.source_files = "ios/**/*.{h,m,mm,cpp}"
|
||||
|
||||
@@ -25,7 +25,7 @@ Pod::Spec.new do |s|
|
||||
s.source_files = "**/*.{h,m,mm,swift}"
|
||||
s.requires_arc = true
|
||||
|
||||
s.dependency "React"
|
||||
s.dependency "React-Core"
|
||||
s.dependency "RCT-Folly", folly_version
|
||||
|
||||
# s.dependency "..."
|
||||
|
||||
+536
-536
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,7 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
0F021603D2C26FA0056F1BD8 /* libPods-RNTesterIntegrationTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C965FA03CA5E5DAD035D156C /* libPods-RNTesterIntegrationTests.a */; };
|
||||
05C2F7DDC87A628A70C2D06C /* libPods-RNTesterIntegrationTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 65B6EA573FF170102920BEF4 /* libPods-RNTesterIntegrationTests.a */; };
|
||||
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
|
||||
272E6B3F1BEA849E001FCF37 /* UpdatePropertiesExampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 272E6B3C1BEA849E001FCF37 /* UpdatePropertiesExampleView.m */; };
|
||||
27F441EC1BEBE5030039B79C /* FlexibleSizeExampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 27F441E81BEBE5030039B79C /* FlexibleSizeExampleView.m */; };
|
||||
@@ -16,9 +16,9 @@
|
||||
3D2AFAF51D646CF80089D1A3 /* legacy_image@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3D2AFAF41D646CF80089D1A3 /* legacy_image@2x.png */; };
|
||||
5C60EB1C226440DB0018C04F /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C60EB1B226440DB0018C04F /* AppDelegate.mm */; };
|
||||
5CB07C9B226467E60039471C /* RNTesterTurboModuleProvider.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CB07C99226467E60039471C /* RNTesterTurboModuleProvider.mm */; };
|
||||
606C582DFD50595CEE33C07F /* libPods-RNTesterUnitTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B3B45782C648174786D3883A /* libPods-RNTesterUnitTests.a */; };
|
||||
8145AE06241172D900A3F8DA /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8145AE05241172D900A3F8DA /* LaunchScreen.storyboard */; };
|
||||
D7017CD9E6ECFF49B1DE42F1 /* libPods-RNTester.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA78234A2C4A4512CE754F9A /* libPods-RNTester.a */; };
|
||||
D19DB1AC8A1EBBFA0D14DB66 /* libPods-RNTester.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 25B78D39CC03C49968A739B2 /* libPods-RNTester.a */; };
|
||||
DCD006323AC907670B0D60A1 /* libPods-RNTesterUnitTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D4E0A9AD185CE086FAC9BD09 /* libPods-RNTesterUnitTests.a */; };
|
||||
E7C1241A22BEC44B00DA25C0 /* RNTesterIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E7C1241922BEC44B00DA25C0 /* RNTesterIntegrationTests.m */; };
|
||||
E7DB20D122B2BAA6005AC45F /* RCTBundleURLProviderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E7DB20A922B2BAA3005AC45F /* RCTBundleURLProviderTests.m */; };
|
||||
E7DB20D222B2BAA6005AC45F /* RCTModuleInitNotificationRaceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E7DB20AA22B2BAA3005AC45F /* RCTModuleInitNotificationRaceTests.m */; };
|
||||
@@ -82,25 +82,25 @@
|
||||
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = RNTester/AppDelegate.h; sourceTree = "<group>"; };
|
||||
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = RNTester/Info.plist; sourceTree = "<group>"; };
|
||||
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = RNTester/main.m; sourceTree = "<group>"; };
|
||||
219F884479D3685B92672D22 /* Pods-RNTesterIntegrationTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterIntegrationTests.release.xcconfig"; path = "Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests.release.xcconfig"; sourceTree = "<group>"; };
|
||||
247CDE6543C07B3CB6A2598F /* Pods-RNTester.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTester.debug.xcconfig"; path = "Target Support Files/Pods-RNTester/Pods-RNTester.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
25B78D39CC03C49968A739B2 /* libPods-RNTester.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTester.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
272E6B3B1BEA849E001FCF37 /* UpdatePropertiesExampleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UpdatePropertiesExampleView.h; path = RNTester/NativeExampleViews/UpdatePropertiesExampleView.h; sourceTree = "<group>"; };
|
||||
272E6B3C1BEA849E001FCF37 /* UpdatePropertiesExampleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = UpdatePropertiesExampleView.m; path = RNTester/NativeExampleViews/UpdatePropertiesExampleView.m; sourceTree = "<group>"; };
|
||||
27F441E81BEBE5030039B79C /* FlexibleSizeExampleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FlexibleSizeExampleView.m; path = RNTester/NativeExampleViews/FlexibleSizeExampleView.m; sourceTree = "<group>"; };
|
||||
27F441EA1BEBE5030039B79C /* FlexibleSizeExampleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FlexibleSizeExampleView.h; path = RNTester/NativeExampleViews/FlexibleSizeExampleView.h; sourceTree = "<group>"; };
|
||||
2DDEF00F1F84BF7B00DBDF73 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = RNTester/Images.xcassets; sourceTree = "<group>"; };
|
||||
383889D923A7398900D06C3E /* RCTConvert_UIColorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTConvert_UIColorTests.m; sourceTree = "<group>"; };
|
||||
3CD3706443F2188E09CBF2D2 /* Pods-RNTesterIntegrationTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterIntegrationTests.debug.xcconfig"; path = "Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
3AC456957EC0E18B006F4CA3 /* Pods-RNTesterUnitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterUnitTests.debug.xcconfig"; path = "Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
3D2AFAF41D646CF80089D1A3 /* legacy_image@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "legacy_image@2x.png"; path = "RNTester/legacy_image@2x.png"; sourceTree = "<group>"; };
|
||||
3DC317D3EE16C63CD9243667 /* Pods-RNTester.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTester.release.xcconfig"; path = "Target Support Files/Pods-RNTester/Pods-RNTester.release.xcconfig"; sourceTree = "<group>"; };
|
||||
4660B567F95EFA8D6DC14F6C /* Pods-RNTester.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTester.release.xcconfig"; path = "Target Support Files/Pods-RNTester/Pods-RNTester.release.xcconfig"; sourceTree = "<group>"; };
|
||||
5C60EB1B226440DB0018C04F /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = RNTester/AppDelegate.mm; sourceTree = "<group>"; };
|
||||
5CB07C99226467E60039471C /* RNTesterTurboModuleProvider.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = RNTesterTurboModuleProvider.mm; path = RNTester/RNTesterTurboModuleProvider.mm; sourceTree = "<group>"; };
|
||||
5CB07C9A226467E60039471C /* RNTesterTurboModuleProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RNTesterTurboModuleProvider.h; path = RNTester/RNTesterTurboModuleProvider.h; sourceTree = "<group>"; };
|
||||
6D3E7ECE8F9BEC26E5786555 /* Pods-RNTester.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTester.debug.xcconfig"; path = "Target Support Files/Pods-RNTester/Pods-RNTester.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
65B6EA573FF170102920BEF4 /* libPods-RNTesterIntegrationTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTesterIntegrationTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
8145AE05241172D900A3F8DA /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = RNTester/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
8735BC063632C9712E25C7D9 /* Pods-RNTesterUnitTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterUnitTests.release.xcconfig"; path = "Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests.release.xcconfig"; sourceTree = "<group>"; };
|
||||
AA78234A2C4A4512CE754F9A /* libPods-RNTester.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTester.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
B3B45782C648174786D3883A /* libPods-RNTesterUnitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTesterUnitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
C38CB0C2095A8FFDE13321E5 /* Pods-RNTesterUnitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterUnitTests.debug.xcconfig"; path = "Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
C965FA03CA5E5DAD035D156C /* libPods-RNTesterIntegrationTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTesterIntegrationTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
8A0B7257DD8B2945456B0F61 /* Pods-RNTesterUnitTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterUnitTests.release.xcconfig"; path = "Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests.release.xcconfig"; sourceTree = "<group>"; };
|
||||
D4E0A9AD185CE086FAC9BD09 /* libPods-RNTesterUnitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTesterUnitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
E771AEEA22B44E3100EA1189 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = RNTester/Info.plist; sourceTree = "<group>"; };
|
||||
E7C1241922BEC44B00DA25C0 /* RNTesterIntegrationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNTesterIntegrationTests.m; sourceTree = "<group>"; };
|
||||
E7DB209F22B2BA84005AC45F /* RNTesterUnitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RNTesterUnitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
@@ -173,7 +173,7 @@
|
||||
E7DB216022B2F3EC005AC45F /* RNTesterSnapshotTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNTesterSnapshotTests.m; sourceTree = "<group>"; };
|
||||
E7DB216122B2F3EC005AC45F /* RCTRootViewIntegrationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRootViewIntegrationTests.m; sourceTree = "<group>"; };
|
||||
E7DB218B22B41FCD005AC45F /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = XCTest.framework; sourceTree = DEVELOPER_DIR; };
|
||||
E88C98CC10E157202A961408 /* Pods-RNTesterIntegrationTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterIntegrationTests.release.xcconfig"; path = "Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests.release.xcconfig"; sourceTree = "<group>"; };
|
||||
EDF27040BB5969AF2B1103C9 /* Pods-RNTesterIntegrationTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterIntegrationTests.debug.xcconfig"; path = "Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -181,7 +181,7 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
D7017CD9E6ECFF49B1DE42F1 /* libPods-RNTester.a in Frameworks */,
|
||||
D19DB1AC8A1EBBFA0D14DB66 /* libPods-RNTester.a in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -191,7 +191,7 @@
|
||||
files = (
|
||||
E7DB213122B2C649005AC45F /* JavaScriptCore.framework in Frameworks */,
|
||||
E7DB213222B2C67D005AC45F /* libOCMock.a in Frameworks */,
|
||||
606C582DFD50595CEE33C07F /* libPods-RNTesterUnitTests.a in Frameworks */,
|
||||
DCD006323AC907670B0D60A1 /* libPods-RNTesterUnitTests.a in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -201,7 +201,7 @@
|
||||
files = (
|
||||
E7DB218C22B41FCD005AC45F /* XCTest.framework in Frameworks */,
|
||||
E7DB216722B2F69F005AC45F /* JavaScriptCore.framework in Frameworks */,
|
||||
0F021603D2C26FA0056F1BD8 /* libPods-RNTesterIntegrationTests.a in Frameworks */,
|
||||
05C2F7DDC87A628A70C2D06C /* libPods-RNTesterIntegrationTests.a in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -272,9 +272,9 @@
|
||||
E7DB211822B2BD53005AC45F /* libReact-RCTText.a */,
|
||||
E7DB211A22B2BD53005AC45F /* libReact-RCTVibration.a */,
|
||||
E7DB212222B2BD53005AC45F /* libyoga.a */,
|
||||
AA78234A2C4A4512CE754F9A /* libPods-RNTester.a */,
|
||||
C965FA03CA5E5DAD035D156C /* libPods-RNTesterIntegrationTests.a */,
|
||||
B3B45782C648174786D3883A /* libPods-RNTesterUnitTests.a */,
|
||||
25B78D39CC03C49968A739B2 /* libPods-RNTester.a */,
|
||||
65B6EA573FF170102920BEF4 /* libPods-RNTesterIntegrationTests.a */,
|
||||
D4E0A9AD185CE086FAC9BD09 /* libPods-RNTesterUnitTests.a */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
@@ -314,12 +314,12 @@
|
||||
E23BD6487B06BD71F1A86914 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6D3E7ECE8F9BEC26E5786555 /* Pods-RNTester.debug.xcconfig */,
|
||||
3DC317D3EE16C63CD9243667 /* Pods-RNTester.release.xcconfig */,
|
||||
3CD3706443F2188E09CBF2D2 /* Pods-RNTesterIntegrationTests.debug.xcconfig */,
|
||||
E88C98CC10E157202A961408 /* Pods-RNTesterIntegrationTests.release.xcconfig */,
|
||||
C38CB0C2095A8FFDE13321E5 /* Pods-RNTesterUnitTests.debug.xcconfig */,
|
||||
8735BC063632C9712E25C7D9 /* Pods-RNTesterUnitTests.release.xcconfig */,
|
||||
247CDE6543C07B3CB6A2598F /* Pods-RNTester.debug.xcconfig */,
|
||||
4660B567F95EFA8D6DC14F6C /* Pods-RNTester.release.xcconfig */,
|
||||
EDF27040BB5969AF2B1103C9 /* Pods-RNTesterIntegrationTests.debug.xcconfig */,
|
||||
219F884479D3685B92672D22 /* Pods-RNTesterIntegrationTests.release.xcconfig */,
|
||||
3AC456957EC0E18B006F4CA3 /* Pods-RNTesterUnitTests.debug.xcconfig */,
|
||||
8A0B7257DD8B2945456B0F61 /* Pods-RNTesterUnitTests.release.xcconfig */,
|
||||
);
|
||||
path = Pods;
|
||||
sourceTree = "<group>";
|
||||
@@ -401,14 +401,14 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "RNTester" */;
|
||||
buildPhases = (
|
||||
26198F645226F4B3EB853CD1 /* [CP] Check Pods Manifest.lock */,
|
||||
161EF0F0977844159431F6A5 /* [CP] Check Pods Manifest.lock */,
|
||||
13B07F871A680F5B00A75B9A /* Sources */,
|
||||
13B07F8C1A680F5B00A75B9A /* Frameworks */,
|
||||
13B07F8E1A680F5B00A75B9A /* Resources */,
|
||||
68CD48B71D2BCB2C007E06A9 /* Build JS Bundle */,
|
||||
5CF0FD27207FC6EC00C13D65 /* Start Metro */,
|
||||
4C8C07C0E5F2E32A7AAB5757 /* [CP] Embed Pods Frameworks */,
|
||||
FA8D4E92C71D381C484B8772 /* [CP] Copy Pods Resources */,
|
||||
2FCDFB64B37634EC8EC3139B /* [CP] Embed Pods Frameworks */,
|
||||
A8DE6393E2BB72D8FBBF6C27 /* [CP] Copy Pods Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -423,11 +423,11 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = E7DB20A622B2BA84005AC45F /* Build configuration list for PBXNativeTarget "RNTesterUnitTests" */;
|
||||
buildPhases = (
|
||||
A2FBDDDD0C26B4EFA3726B6C /* [CP] Check Pods Manifest.lock */,
|
||||
4930FC87997EBCAD361CEF12 /* [CP] Check Pods Manifest.lock */,
|
||||
E7DB209B22B2BA84005AC45F /* Sources */,
|
||||
E7DB209C22B2BA84005AC45F /* Frameworks */,
|
||||
E7DB209D22B2BA84005AC45F /* Resources */,
|
||||
C2DB5D8205AD0B9A884AEA32 /* [CP] Copy Pods Resources */,
|
||||
9A596313B3964A4DEB794409 /* [CP] Copy Pods Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -443,11 +443,11 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = E7DB215A22B2F332005AC45F /* Build configuration list for PBXNativeTarget "RNTesterIntegrationTests" */;
|
||||
buildPhases = (
|
||||
BCB4082E5032C2EB206C860A /* [CP] Check Pods Manifest.lock */,
|
||||
6258A17990E8F7801AF1C4FE /* [CP] Check Pods Manifest.lock */,
|
||||
E7DB214F22B2F332005AC45F /* Sources */,
|
||||
E7DB215022B2F332005AC45F /* Frameworks */,
|
||||
E7DB215122B2F332005AC45F /* Resources */,
|
||||
205E2BCA6FE5F91C79346A1A /* [CP] Copy Pods Resources */,
|
||||
98E057AC8860597818FB485A /* [CP] Copy Pods Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -526,24 +526,7 @@
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
205E2BCA6FE5F91C79346A1A /* [CP] Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-resources-${CONFIGURATION}-input-files.xcfilelist",
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-resources-${CONFIGURATION}-output-files.xcfilelist",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
26198F645226F4B3EB853CD1 /* [CP] Check Pods Manifest.lock */ = {
|
||||
161EF0F0977844159431F6A5 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
@@ -565,7 +548,7 @@
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
4C8C07C0E5F2E32A7AAB5757 /* [CP] Embed Pods Frameworks */ = {
|
||||
2FCDFB64B37634EC8EC3139B /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
@@ -582,36 +565,7 @@
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
5CF0FD27207FC6EC00C13D65 /* Start Metro */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Start Metro";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "set -x\n\nexport RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../../scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open -n \"$SRCROOT/../../scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
68CD48B71D2BCB2C007E06A9 /* Build JS Bundle */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Build JS Bundle";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "set -e\n\nexport NODE_BINARY=node\nexport PROJECT_ROOT=\"$SRCROOT/../../\"\nexport ENTRY_FILE=\"$SRCROOT/js/RNTesterApp.ios.js\"\nexport SOURCEMAP_FILE=../sourcemap.ios.map\n# export FORCE_BUNDLING=true\n\"$SRCROOT/../../scripts/react-native-xcode.sh\"\n";
|
||||
};
|
||||
A2FBDDDD0C26B4EFA3726B6C /* [CP] Check Pods Manifest.lock */ = {
|
||||
4930FC87997EBCAD361CEF12 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
@@ -633,7 +587,22 @@
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
BCB4082E5032C2EB206C860A /* [CP] Check Pods Manifest.lock */ = {
|
||||
5CF0FD27207FC6EC00C13D65 /* Start Metro */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Start Metro";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "set -x\n\nexport RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../../scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open -n \"$SRCROOT/../../scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
6258A17990E8F7801AF1C4FE /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
@@ -655,7 +624,38 @@
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
C2DB5D8205AD0B9A884AEA32 /* [CP] Copy Pods Resources */ = {
|
||||
68CD48B71D2BCB2C007E06A9 /* Build JS Bundle */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Build JS Bundle";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "set -e\n\nexport NODE_BINARY=node\nexport PROJECT_ROOT=\"$SRCROOT/../../\"\nexport ENTRY_FILE=\"$SRCROOT/js/RNTesterApp.ios.js\"\nexport SOURCEMAP_FILE=../sourcemap.ios.map\n# export FORCE_BUNDLING=true\n\"$SRCROOT/../../scripts/react-native-xcode.sh\"\n";
|
||||
};
|
||||
98E057AC8860597818FB485A /* [CP] Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-resources-${CONFIGURATION}-input-files.xcfilelist",
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-resources-${CONFIGURATION}-output-files.xcfilelist",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
9A596313B3964A4DEB794409 /* [CP] Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
@@ -672,7 +672,7 @@
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
FA8D4E92C71D381C484B8772 /* [CP] Copy Pods Resources */ = {
|
||||
A8DE6393E2BB72D8FBBF6C27 /* [CP] Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
@@ -770,7 +770,7 @@
|
||||
/* Begin XCBuildConfiguration section */
|
||||
13B07F941A680F5B00A75B9A /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 6D3E7ECE8F9BEC26E5786555 /* Pods-RNTester.debug.xcconfig */;
|
||||
baseConfigurationReference = 247CDE6543C07B3CB6A2598F /* Pods-RNTester.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_ENTITLEMENTS = RNTester/RNTester.entitlements;
|
||||
@@ -802,7 +802,7 @@
|
||||
};
|
||||
13B07F951A680F5B00A75B9A /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 3DC317D3EE16C63CD9243667 /* Pods-RNTester.release.xcconfig */;
|
||||
baseConfigurationReference = 4660B567F95EFA8D6DC14F6C /* Pods-RNTester.release.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_ENTITLEMENTS = RNTester/RNTester.entitlements;
|
||||
@@ -995,7 +995,7 @@
|
||||
};
|
||||
E7DB20A722B2BA84005AC45F /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = C38CB0C2095A8FFDE13321E5 /* Pods-RNTesterUnitTests.debug.xcconfig */;
|
||||
baseConfigurationReference = 3AC456957EC0E18B006F4CA3 /* Pods-RNTesterUnitTests.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
@@ -1031,7 +1031,7 @@
|
||||
};
|
||||
E7DB20A822B2BA84005AC45F /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 8735BC063632C9712E25C7D9 /* Pods-RNTesterUnitTests.release.xcconfig */;
|
||||
baseConfigurationReference = 8A0B7257DD8B2945456B0F61 /* Pods-RNTesterUnitTests.release.xcconfig */;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
@@ -1067,7 +1067,7 @@
|
||||
};
|
||||
E7DB215B22B2F332005AC45F /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 3CD3706443F2188E09CBF2D2 /* Pods-RNTesterIntegrationTests.debug.xcconfig */;
|
||||
baseConfigurationReference = EDF27040BB5969AF2B1103C9 /* Pods-RNTesterIntegrationTests.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
@@ -1105,7 +1105,7 @@
|
||||
};
|
||||
E7DB215C22B2F332005AC45F /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = E88C98CC10E157202A961408 /* Pods-RNTesterIntegrationTests.release.xcconfig */;
|
||||
baseConfigurationReference = 219F884479D3685B92672D22 /* Pods-RNTesterIntegrationTests.release.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
LastUpgradeVersion = "1210"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "NO"
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
LastUpgradeVersion = "1210"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "NO"
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
LastUpgradeVersion = "1210"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "NO"
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
|
||||
@@ -80,7 +80,7 @@ react {
|
||||
cliPath = "../../../../cli.js"
|
||||
bundleAssetName = "RNTesterApp.android.bundle"
|
||||
entryFile = file("../../js/RNTesterApp.android.js")
|
||||
reactRoot = rootDir
|
||||
root = rootDir
|
||||
inputExcludes = ["android/**", "./**", ".gradle/**"]
|
||||
composeSourceMapsPath = "$rootDir/scripts/compose-source-maps.js"
|
||||
hermesCommand = "$rootDir/node_modules/hermes-engine/%OS-BIN%/hermesc"
|
||||
@@ -88,6 +88,7 @@ react {
|
||||
|
||||
// Codegen Configs
|
||||
jsRootDir = file("$rootDir/packages/rn-tester")
|
||||
reactNativeDir = rootDir
|
||||
libraryName = "rntester"
|
||||
useJavaGenerator = System.getenv("USE_CODEGEN_JAVAPOET")?.toBoolean() ?: false
|
||||
}
|
||||
@@ -144,10 +145,13 @@ def reactNativeArchitectures() {
|
||||
android {
|
||||
compileSdkVersion 31
|
||||
|
||||
// Used to override the NDK path & version on internal CI
|
||||
if (System.getenv("ANDROID_NDK") != null && System.getenv("LOCAL_ANDROID_NDK_VERSION") != null) {
|
||||
ndkPath System.getenv("ANDROID_NDK")
|
||||
ndkVersion System.getenv("LOCAL_ANDROID_NDK_VERSION")
|
||||
// Used to override the NDK path/version on internal CI or by allowing
|
||||
// users to customize the NDK path/version from their root project (e.g. for M1 support)
|
||||
if (rootProject.hasProperty("ndkPath")) {
|
||||
ndkPath rootProject.ext.ndkPath
|
||||
}
|
||||
if (rootProject.hasProperty("ndkVersion")) {
|
||||
ndkVersion rootProject.ext.ndkVersion
|
||||
}
|
||||
|
||||
flavorDimensions "vm"
|
||||
|
||||
+52
-15
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
import org.apache.tools.ant.taskdefs.condition.Os
|
||||
import org.gradle.internal.jvm.Jvm
|
||||
|
||||
def config = project.hasProperty("react") ? project.react : [:];
|
||||
|
||||
@@ -21,20 +22,6 @@ def detectEntryFile(config) {
|
||||
return "index.js";
|
||||
}
|
||||
|
||||
/**
|
||||
* Detects CLI location in a similar fashion to the React Native CLI
|
||||
*/
|
||||
def detectCliPath(config) {
|
||||
if (config.cliPath) {
|
||||
return "${projectDir}/${config.cliPath}"
|
||||
}
|
||||
if (new File("${projectDir}/../../node_modules/react-native/cli.js").exists()) {
|
||||
return "${projectDir}/../../node_modules/react-native/cli.js"
|
||||
}
|
||||
throw new Exception("Couldn't determine CLI location. " +
|
||||
"Please set `project.ext.react.cliPath` to the path of the react-native cli.js file. This file typically resides in `node_modules/react-native/cli.js`");
|
||||
}
|
||||
|
||||
def composeSourceMapsPath = config.composeSourceMapsPath ?: "node_modules/react-native/scripts/compose-source-maps.js"
|
||||
def bundleAssetName = config.bundleAssetName ?: "index.android.bundle"
|
||||
def entryFile = detectEntryFile(config)
|
||||
@@ -45,6 +32,43 @@ def bundleConfig = config.bundleConfig ? "${reactRoot}/${config.bundleConfig}" :
|
||||
def enableVmCleanup = config.enableVmCleanup == null ? true : config.enableVmCleanup
|
||||
def hermesCommand = config.hermesCommand ?: "../../node_modules/hermes-engine/%OS-BIN%/hermesc"
|
||||
|
||||
/**
|
||||
* Detects CLI location in a similar fashion to the React Native CLI
|
||||
*/
|
||||
def detectCliPath(config, reactRoot) {
|
||||
// 1. preconfigured path
|
||||
if (config.cliPath) {
|
||||
def cliJsAbsolute = new File(config.cliPath)
|
||||
if (cliJsAbsolute.exists()) {
|
||||
return cliJsAbsolute.getAbsolutePath()
|
||||
}
|
||||
def cliJsRelativeToRoot = new File("${rootDir}/${config.cliPath}")
|
||||
if (cliJsRelativeToRoot.exists()) {
|
||||
return cliJsRelativeToRoot.getAbsolutePath()
|
||||
}
|
||||
def cliJsRelativeToProject = new File("${projectDir}/${config.cliPath}")
|
||||
if (cliJsRelativeToProject.exists()) {
|
||||
return cliJsRelativeToProject.getAbsolutePath()
|
||||
}
|
||||
}
|
||||
|
||||
// 2. node module path
|
||||
def cliJsFromNode = new File(["node", "--print", "require.resolve('react-native/cli').bin"].execute(null, rootDir).text.trim())
|
||||
if (cliJsFromNode.exists()) {
|
||||
return cliJsFromNode.getAbsolutePath()
|
||||
}
|
||||
|
||||
// 3. cli.js in the root folder
|
||||
def rootCliJs = new File(reactRoot, "node_modules/react-native/cli.js")
|
||||
if (rootCliJs.exists()) {
|
||||
return rootCliJs.getAbsolutePath()
|
||||
}
|
||||
|
||||
throw new Exception("Couldn't determine CLI location. " +
|
||||
"Please set `project.ext.react.cliPath` to the path of the react-native cli.js file. " +
|
||||
"This file typically resides in `node_modules/react-native/cli.js`");
|
||||
}
|
||||
|
||||
def reactNativeDevServerPort() {
|
||||
def value = project.getProperties().get("reactNativeDevServerPort")
|
||||
return value != null ? value : "8081"
|
||||
@@ -129,6 +153,19 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
def jvmVersion = Jvm.current().javaVersion.majorVersion
|
||||
if (jvmVersion.toInteger() <= 8) {
|
||||
println "\n\n\n"
|
||||
println "**************************************************************************************************************"
|
||||
println "\n\n"
|
||||
println "ERROR: requires JDK11 or higher."
|
||||
println "Incompatible major version detected: '" + jvmVersion + "'"
|
||||
println "\n\n"
|
||||
println "**************************************************************************************************************"
|
||||
println "\n\n\n"
|
||||
System.exit(1)
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
def isAndroidLibrary = plugins.hasPlugin("com.android.library")
|
||||
def variants = isAndroidLibrary ? android.libraryVariants : android.applicationVariants
|
||||
@@ -150,7 +187,7 @@ afterEvaluate {
|
||||
|
||||
// Additional node and packager commandline arguments
|
||||
def nodeExecutableAndArgs = config.nodeExecutableAndArgs ?: ["node"]
|
||||
def cliPath = detectCliPath(config)
|
||||
def cliPath = detectCliPath(config, reactRoot)
|
||||
|
||||
def execCommand = []
|
||||
|
||||
|
||||
@@ -131,10 +131,10 @@ end
|
||||
def use_flipper!(versions = {}, configurations: ['Debug'])
|
||||
versions['Flipper'] ||= '0.125.0'
|
||||
versions['Flipper-Boost-iOSX'] ||= '1.76.0.1.11'
|
||||
versions['Flipper-DoubleConversion'] ||= '3.1.7'
|
||||
versions['Flipper-DoubleConversion'] ||= '3.2.0'
|
||||
versions['Flipper-Fmt'] ||= '7.1.7'
|
||||
versions['Flipper-Folly'] ||= '2.6.10'
|
||||
versions['Flipper-Glog'] ||= '0.3.9'
|
||||
versions['Flipper-Glog'] ||= '0.5.0.4'
|
||||
versions['Flipper-PeerTalk'] ||= '0.0.4'
|
||||
versions['Flipper-RSocket'] ||= '1.4.3'
|
||||
versions['OpenSSL-Universal'] ||= '1.1.1100'
|
||||
@@ -176,6 +176,15 @@ def flipper_post_install(installer)
|
||||
config.build_settings['SWIFT_VERSION'] = '4.1'
|
||||
end
|
||||
end
|
||||
|
||||
# Enable flipper for React-Core Debug configuration
|
||||
if target.name == 'React-Core'
|
||||
target.build_configurations.each do |config|
|
||||
if config.name == 'Debug'
|
||||
config.build_settings['OTHER_CFLAGS'] = "$(inherited) -DFB_SONARKIT_ENABLED=1"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -271,8 +280,9 @@ def modify_flags_for_new_architecture(installer, cpp_flags)
|
||||
end
|
||||
|
||||
def build_codegen!(react_native_path)
|
||||
codegen_repo_path = "#{react_native_path}/packages/react-native-codegen";
|
||||
codegen_npm_path = "#{react_native_path}/../react-native-codegen";
|
||||
relative_installation_root = Pod::Config.instance.installation_root.relative_path_from(Pathname.pwd)
|
||||
codegen_repo_path = "#{relative_installation_root}/#{react_native_path}/packages/react-native-codegen";
|
||||
codegen_npm_path = "#{relative_installation_root}/#{react_native_path}/../react-native-codegen";
|
||||
codegen_cli_path = ""
|
||||
if Dir.exist?(codegen_repo_path)
|
||||
codegen_cli_path = codegen_repo_path
|
||||
@@ -313,7 +323,7 @@ def checkAndGenerateEmptyThirdPartyProvider!(react_native_path)
|
||||
Pod::Executable.execute_command(
|
||||
'node',
|
||||
[
|
||||
"#{react_native_path}/scripts/generate-provider-cli.js",
|
||||
"#{relative_installation_root}/#{react_native_path}/scripts/generate-provider-cli.js",
|
||||
"--platform", 'ios',
|
||||
"--schemaListPath", temp_schema_list_path,
|
||||
"--outputDir", "#{output_dir}"
|
||||
@@ -503,6 +513,7 @@ def use_react_native_codegen_discovery!(options={})
|
||||
app_path = options[:app_path]
|
||||
fabric_enabled = options[:fabric_enabled] ||= false
|
||||
config_file_dir = options[:config_file_dir] ||= ''
|
||||
relative_installation_root = Pod::Config.instance.installation_root.relative_path_from(Pathname.pwd)
|
||||
|
||||
if !app_path
|
||||
Pod::UI.warn '[Codegen] Error: app_path is required for use_react_native_codegen_discovery.'
|
||||
@@ -518,7 +529,7 @@ def use_react_native_codegen_discovery!(options={})
|
||||
out = Pod::Executable.execute_command(
|
||||
'node',
|
||||
[
|
||||
"#{react_native_path}/scripts/generate-artifacts.js",
|
||||
"#{relative_installation_root}/#{react_native_path}/scripts/generate-artifacts.js",
|
||||
"-p", "#{app_path}",
|
||||
"-o", Pod::Config.instance.installation_root,
|
||||
"-e", "#{fabric_enabled}",
|
||||
@@ -540,6 +551,7 @@ def use_react_native_codegen!(spec, options={})
|
||||
library_name = options[:library_name] ||= "#{spec.name.gsub('_','-').split('-').collect(&:capitalize).join}Spec"
|
||||
Pod::UI.puts "[Codegen] Found #{library_name}"
|
||||
|
||||
relative_installation_root = Pod::Config.instance.installation_root.relative_path_from(Pathname.pwd)
|
||||
output_dir = options[:output_dir] ||= $CODEGEN_OUTPUT_DIR
|
||||
output_dir_module = "#{output_dir}/#{$CODEGEN_MODULE_DIR}"
|
||||
output_dir_component = "#{output_dir}/#{$CODEGEN_COMPONENT_DIR}"
|
||||
@@ -547,7 +559,7 @@ def use_react_native_codegen!(spec, options={})
|
||||
codegen_config = {
|
||||
"modules" => {
|
||||
:js_srcs_pattern => "Native*.js",
|
||||
:generated_dir => "#{Pod::Config.instance.installation_root}/#{output_dir_module}/#{library_name}",
|
||||
:generated_dir => "#{relative_installation_root}/#{output_dir_module}/#{library_name}",
|
||||
:generated_files => [
|
||||
"#{library_name}.h",
|
||||
"#{library_name}-generated.mm"
|
||||
@@ -555,7 +567,7 @@ def use_react_native_codegen!(spec, options={})
|
||||
},
|
||||
"components" => {
|
||||
:js_srcs_pattern => "*NativeComponent.js",
|
||||
:generated_dir => "#{Pod::Config.instance.installation_root}/#{output_dir_component}/#{library_name}",
|
||||
:generated_dir => "#{relative_installation_root}/#{output_dir_component}/#{library_name}",
|
||||
:generated_files => [
|
||||
"ComponentDescriptors.h",
|
||||
"EventEmitters.cpp",
|
||||
@@ -604,7 +616,7 @@ def use_react_native_codegen!(spec, options={})
|
||||
spec.script_phase = {
|
||||
:name => 'Generate Specs',
|
||||
:input_files => input_files, # This also needs to be relative to Xcode
|
||||
:output_files => ["${DERIVED_FILE_DIR}/codegen-#{library_name}.log"].concat(generated_files.map { |filename| " ${PODS_TARGET_SRCROOT}/#{filename}"} ),
|
||||
:output_files => ["${DERIVED_FILE_DIR}/codegen-#{library_name}.log"].concat(generated_files.map { |filename| "${PODS_TARGET_SRCROOT}/#{filename}"} ),
|
||||
# The final generated files will be created when this script is invoked at Xcode build time.
|
||||
:script => get_script_phases_no_codegen_discovery(
|
||||
react_native_path: react_native_path,
|
||||
|
||||
+15
-15
@@ -1,9 +1,9 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
CFPropertyList (3.0.4)
|
||||
CFPropertyList (3.0.5)
|
||||
rexml
|
||||
activesupport (6.1.4.1)
|
||||
activesupport (6.1.5)
|
||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||
i18n (>= 1.6, < 2)
|
||||
minitest (>= 5.1)
|
||||
@@ -15,11 +15,11 @@ GEM
|
||||
httpclient (~> 2.8, >= 2.8.3)
|
||||
json (>= 1.5.1)
|
||||
atomos (0.1.3)
|
||||
claide (1.0.3)
|
||||
cocoapods (1.11.2)
|
||||
claide (1.1.0)
|
||||
cocoapods (1.11.3)
|
||||
addressable (~> 2.8)
|
||||
claide (>= 1.0.2, < 2.0)
|
||||
cocoapods-core (= 1.11.2)
|
||||
cocoapods-core (= 1.11.3)
|
||||
cocoapods-deintegrate (>= 1.0.3, < 2.0)
|
||||
cocoapods-downloader (>= 1.4.0, < 2.0)
|
||||
cocoapods-plugins (>= 1.0.0, < 2.0)
|
||||
@@ -34,7 +34,7 @@ GEM
|
||||
nap (~> 1.0)
|
||||
ruby-macho (>= 1.0, < 3.0)
|
||||
xcodeproj (>= 1.21.0, < 2.0)
|
||||
cocoapods-core (1.11.2)
|
||||
cocoapods-core (1.11.3)
|
||||
activesupport (>= 5.0, < 7)
|
||||
addressable (~> 2.8)
|
||||
algoliasearch (~> 1.0)
|
||||
@@ -45,7 +45,7 @@ GEM
|
||||
public_suffix (~> 4.0)
|
||||
typhoeus (~> 1.0)
|
||||
cocoapods-deintegrate (1.0.5)
|
||||
cocoapods-downloader (1.5.1)
|
||||
cocoapods-downloader (1.6.3)
|
||||
cocoapods-plugins (1.0.0)
|
||||
nap
|
||||
cocoapods-search (1.0.1)
|
||||
@@ -54,24 +54,24 @@ GEM
|
||||
netrc (~> 0.11)
|
||||
cocoapods-try (1.2.0)
|
||||
colored2 (3.1.2)
|
||||
concurrent-ruby (1.1.9)
|
||||
concurrent-ruby (1.1.10)
|
||||
escape (0.0.4)
|
||||
ethon (0.15.0)
|
||||
ffi (>= 1.15.0)
|
||||
ffi (1.15.4)
|
||||
ffi (1.15.5)
|
||||
fourflusher (2.3.1)
|
||||
fuzzy_match (2.0.4)
|
||||
gh_inspector (1.1.3)
|
||||
httpclient (2.8.3)
|
||||
i18n (1.8.10)
|
||||
i18n (1.10.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
json (2.6.0)
|
||||
minitest (5.14.4)
|
||||
json (2.6.1)
|
||||
minitest (5.15.0)
|
||||
molinillo (0.8.0)
|
||||
nanaimo (0.3.0)
|
||||
nap (1.1.0)
|
||||
netrc (0.11.0)
|
||||
public_suffix (4.0.6)
|
||||
public_suffix (4.0.7)
|
||||
rexml (3.2.5)
|
||||
ruby-macho (2.5.1)
|
||||
typhoeus (1.4.0)
|
||||
@@ -85,7 +85,7 @@ GEM
|
||||
colored2 (~> 3.1)
|
||||
nanaimo (~> 0.3.0)
|
||||
rexml (~> 3.2.4)
|
||||
zeitwerk (2.5.1)
|
||||
zeitwerk (2.5.4)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
@@ -97,4 +97,4 @@ RUBY VERSION
|
||||
ruby 2.7.4p191
|
||||
|
||||
BUNDLED WITH
|
||||
2.2.29
|
||||
2.2.27
|
||||
|
||||
@@ -11,6 +11,8 @@ node_modules/react-native/Libraries/polyfills/.*
|
||||
; Flow doesn't support platforms
|
||||
.*/Libraries/Utilities/LoadingView.js
|
||||
|
||||
.*/node_modules/resolve/test/resolver/malformed_package_json/package\.json$
|
||||
|
||||
[untyped]
|
||||
.*/node_modules/@react-native-community/cli/.*/.*
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
apply plugin: "com.android.application"
|
||||
|
||||
import com.android.build.OutputFile
|
||||
import org.apache.tools.ant.taskdefs.condition.Os
|
||||
|
||||
/**
|
||||
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
|
||||
@@ -157,6 +158,17 @@ android {
|
||||
// Make sure this target name is the same you specify inside the
|
||||
// src/main/jni/Android.mk file for the `LOCAL_MODULE` variable.
|
||||
targets "helloworld_appmodules"
|
||||
|
||||
// Fix for windows limit on number of character in file paths and in command lines
|
||||
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
||||
arguments "NDK_OUT=${rootProject.projectDir.getParent()}\\.cxx",
|
||||
"NDK_APP_SHORT_COMMANDS=true"
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!enableSeparateBuildPerCPUArchitecture) {
|
||||
ndk {
|
||||
abiFilters (*reactNativeArchitectures())
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -186,6 +198,20 @@ android {
|
||||
// preBuild.dependsOn("generateCodegenArtifactsFromSchema")
|
||||
preDebugBuild.dependsOn(packageReactNdkDebugLibs)
|
||||
preReleaseBuild.dependsOn(packageReactNdkReleaseLibs)
|
||||
|
||||
// Due to a bug inside AGP, we have to explicitly set a dependency
|
||||
// between configureNdkBuild* tasks and the preBuild tasks.
|
||||
// This can be removed once this is solved: https://issuetracker.google.com/issues/207403732
|
||||
configureNdkBuildRelease.dependsOn(preReleaseBuild)
|
||||
configureNdkBuildDebug.dependsOn(preDebugBuild)
|
||||
reactNativeArchitectures().each { architecture ->
|
||||
tasks.findByName("configureNdkBuildDebug[${architecture}]")?.configure {
|
||||
dependsOn("preDebugBuild")
|
||||
}
|
||||
tasks.findByName("configureNdkBuildRelease[${architecture}]")?.configure {
|
||||
dependsOn("preReleaseBuild")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,24 +259,13 @@ android {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
packagingOptions {
|
||||
pickFirst '**/libhermes.so'
|
||||
pickFirst '**/libjsc.so'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: "libs", include: ["*.jar"])
|
||||
|
||||
// If new architecture is enabled, we let you build RN from source
|
||||
// Otherwise we fallback to a prebuilt .aar bundled in the NPM package.
|
||||
if (isNewArchitectureEnabled()) {
|
||||
implementation project(":ReactAndroid")
|
||||
} else {
|
||||
//noinspection GradleDynamicVersion
|
||||
implementation "com.facebook.react:react-native:+" // From node_modules
|
||||
}
|
||||
//noinspection GradleDynamicVersion
|
||||
implementation "com.facebook.react:react-native:+" // From node_modules
|
||||
|
||||
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
|
||||
|
||||
@@ -276,6 +291,18 @@ dependencies {
|
||||
}
|
||||
}
|
||||
|
||||
if (isNewArchitectureEnabled()) {
|
||||
// If new architecture is enabled, we let you build RN from source
|
||||
// Otherwise we fallback to a prebuilt .aar bundled in the NPM package.
|
||||
// This will be applied to all the imported transtitive dependency.
|
||||
configurations.all {
|
||||
resolutionStrategy.dependencySubstitution {
|
||||
substitute(module("com.facebook.react:react-native"))
|
||||
.using(project(":ReactAndroid")).because("On New Architecture we're building React Native from source")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Run this once to be able to run the application with BUCK
|
||||
// puts all compile dependencies into folder libs for BUCK to use
|
||||
task copyDownloadableDepsToLibs(type: Copy) {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import org.apache.tools.ant.taskdefs.condition.Os
|
||||
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
@@ -6,7 +8,18 @@ buildscript {
|
||||
minSdkVersion = 21
|
||||
compileSdkVersion = 31
|
||||
targetSdkVersion = 31
|
||||
ndkVersion = "21.4.7075529"
|
||||
|
||||
if (System.properties['os.arch'] == "aarch64") {
|
||||
// For M1 Users we need to use the NDK 24 which added support for aarch64
|
||||
ndkVersion = "24.0.8215888"
|
||||
} else if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
||||
// For Android Users, we need to use NDK 23, otherwise the build will
|
||||
// fail due to paths longer than the OS limit
|
||||
ndkVersion = "23.1.7779620"
|
||||
} else {
|
||||
// Otherwise we default to the side-by-side NDK version from AGP.
|
||||
ndkVersion = "21.4.7075529"
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
google()
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
# Specifies the JVM arguments used for the daemon process.
|
||||
# The setting is particularly useful for tweaking memory settings.
|
||||
# Default value: -Xmx1024m -XX:MaxPermSize=256m
|
||||
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
||||
# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
|
||||
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
|
||||
|
||||
# When configured, Gradle will run in incubating parallel mode.
|
||||
# This option should only be used with decoupled projects. More details, visit
|
||||
|
||||
@@ -15,8 +15,8 @@ target 'HelloWorld' do
|
||||
# to enable hermes on iOS, change `false` to `true` and then install pods
|
||||
:hermes_enabled => flags[:hermes_enabled],
|
||||
:fabric_enabled => flags[:fabric_enabled],
|
||||
# An abosolute path to your application root.
|
||||
:app_path => "#{Dir.pwd}/.."
|
||||
# An absolute path to your application root.
|
||||
:app_path => "#{Pod::Config.instance.installation_root}/.."
|
||||
)
|
||||
|
||||
target 'HelloWorldTests' do
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "17.0.2",
|
||||
"react-native": "1000.0.0"
|
||||
"react-native": "0.68.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.12.9",
|
||||
@@ -21,13 +21,9 @@
|
||||
"eslint": "^7.32.0",
|
||||
"jest": "^26.6.3",
|
||||
"metro-react-native-babel-preset": "^0.67.0",
|
||||
"react-native-gradle-plugin": "^0.0.4",
|
||||
"react-test-renderer": "17.0.2"
|
||||
},
|
||||
"jest": {
|
||||
"preset": "react-native"
|
||||
},
|
||||
"codegenConfig": {
|
||||
"libraries": []
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +91,11 @@ Pod::Spec.new do |spec|
|
||||
'folly/concurrency/CacheLocality.cpp',
|
||||
'folly/detail/Futex.cpp',
|
||||
'folly/synchronization/ParkingLot.cpp',
|
||||
'folly/portability/Malloc.cpp'
|
||||
'folly/portability/Malloc.cpp',
|
||||
'folly/concurrency/CacheLocality.h',
|
||||
'folly/synchronization/ParkingLot.h',
|
||||
'folly/synchronization/SanitizeThread.h',
|
||||
'folly/system/ThreadId.h'
|
||||
|
||||
fabric.preserve_paths = 'folly/concurrency/CacheLocality.h',
|
||||
'folly/synchronization/ParkingLot.h',
|
||||
|
||||
Reference in New Issue
Block a user