react-native-tvos 0.88.0-0 → 0.88.1-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Libraries/AppDelegate/RCTDefaultReactNativeFactoryDelegate.mm +26 -1
- package/Libraries/AppDelegate/RCTUIConfiguratorProtocol.h +1 -1
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/LogBox/LogBoxNotificationContainer.js +7 -1
- package/Libraries/LogBox/UI/LogBoxNotificationDismissButton.js +3 -3
- package/React/Base/RCTStatusBarAppearance.h +30 -0
- package/React/Base/RCTStatusBarAppearance.mm +66 -0
- package/React/Base/RCTVersion.m +1 -1
- package/React/CoreModules/RCTStatusBarManager.mm +34 -9
- package/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm +13 -5
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm +30 -2
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +9 -0
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +8 -1
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTypefaceUtils.kt +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextDecorationStyle.kt +32 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.kt +4 -0
- package/ReactApple/RCTSwiftUI/RCTSwiftUIContainerView.swift +4 -0
- package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
- package/ReactCommon/jsi/jsi/decorator.h +64 -0
- package/ReactCommon/jsi/jsi/jsi.cpp +2 -4
- package/ReactCommon/jsi/jsi/test/testlib.cpp +285 -8
- package/ReactCommon/jsi/jsi/test/testlib.h +1 -0
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +2 -1
- package/ReactCommon/yoga/yoga/algorithm/CalculateLayout.cpp +6 -2
- package/ReactCommon/yoga/yoga/algorithm/PixelGrid.cpp +49 -19
- package/package.json +8 -8
- package/scripts/cocoapods/utils.rb +51 -0
- package/scripts/codegen/templates/Package.swift.spm-template +13 -2
- package/scripts/react_native_pods.rb +1 -0
- package/scripts/setup-apple-spm.js +10 -5
- package/scripts/spm/autolinking-plugins.js +2 -1
- package/scripts/spm/flavored-frameworks.js +1 -0
- package/scripts/spm/generate-spm-autolinking.js +34 -96
- package/scripts/spm/generate-spm-xcodeproj.js +798 -285
- package/scripts/spm/ios-deployment-target.js +16 -63
- package/scripts/spm/spm-pbxproj.js +8 -3
- package/scripts/spm/spm-types.js +2 -15
- package/scripts/spm/sync-spm-autolinking.js +57 -23
- package/scripts/spm/xcconfig-files.js +149 -0
- package/sdks/.hermesv1version +1 -1
- package/sdks/hermes-engine/version.properties +1 -1
|
@@ -23,9 +23,12 @@ const {
|
|
|
23
23
|
findField,
|
|
24
24
|
findObjectByUuid,
|
|
25
25
|
findProjectObject,
|
|
26
|
-
forEachObjectInSection,
|
|
27
|
-
uuidsInArray,
|
|
28
26
|
} = require('./spm-pbxproj');
|
|
27
|
+
const {
|
|
28
|
+
readXcconfig,
|
|
29
|
+
xcconfigIncludePath,
|
|
30
|
+
xcconfigReferencePaths,
|
|
31
|
+
} = require('./xcconfig-files');
|
|
29
32
|
const fs = require('node:fs');
|
|
30
33
|
const path = require('node:path');
|
|
31
34
|
|
|
@@ -87,14 +90,6 @@ function sanitizeIosDeploymentTarget(raw /*: ?string */) /*: string */ {
|
|
|
87
90
|
: MIN_IOS_VERSION_SUPPORTED;
|
|
88
91
|
}
|
|
89
92
|
|
|
90
|
-
function defaultReadFile(absPath /*: string */) /*: ?string */ {
|
|
91
|
-
try {
|
|
92
|
-
return fs.readFileSync(absPath, 'utf8');
|
|
93
|
-
} catch {
|
|
94
|
-
return null;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
93
|
/**
|
|
99
94
|
* `IPHONEOS_DEPLOYMENT_TARGET` as an xcconfig defines it, following `#include`
|
|
100
95
|
* lines in place so a later assignment in the includer wins. Null when the file
|
|
@@ -116,10 +111,10 @@ function parseXcconfigSetting(
|
|
|
116
111
|
let value /*: ?string */ = null;
|
|
117
112
|
for (const rawLine of content.split('\n')) {
|
|
118
113
|
const line = rawLine.replace(/\/\/.*$/, '').trim();
|
|
119
|
-
const
|
|
120
|
-
if (
|
|
114
|
+
const includePath = xcconfigIncludePath(absPath, line);
|
|
115
|
+
if (includePath != null) {
|
|
121
116
|
const included = readXcconfigSetting(
|
|
122
|
-
|
|
117
|
+
includePath,
|
|
123
118
|
readFile,
|
|
124
119
|
visited,
|
|
125
120
|
depth + 1,
|
|
@@ -154,41 +149,6 @@ function readXcconfigSetting(
|
|
|
154
149
|
: null;
|
|
155
150
|
}
|
|
156
151
|
|
|
157
|
-
/**
|
|
158
|
-
* Directory components of the PBXGroup chain holding `uuid`, outermost first —
|
|
159
|
-
* how a `"<group>"` file reference's path is anchored to the project dir.
|
|
160
|
-
*/
|
|
161
|
-
function groupPathPrefix(
|
|
162
|
-
text /*: string */,
|
|
163
|
-
uuid /*: string */,
|
|
164
|
-
) /*: Array<string> */ {
|
|
165
|
-
const groups /*: Array<{uuid: string, path: ?string, children: Set<string>}> */ =
|
|
166
|
-
[];
|
|
167
|
-
forEachObjectInSection(text, 'PBXGroup', ({uuid: groupUuid, ...body}) => {
|
|
168
|
-
const children = findField(text, body, 'children');
|
|
169
|
-
const groupPath = findField(text, body, 'path');
|
|
170
|
-
groups.push({
|
|
171
|
-
uuid: groupUuid,
|
|
172
|
-
path: groupPath != null ? unquote(groupPath.value) : null,
|
|
173
|
-
children: children != null ? uuidsInArray(children.value) : new Set(),
|
|
174
|
-
});
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
const parts /*: Array<string> */ = [];
|
|
178
|
-
let current = uuid;
|
|
179
|
-
for (let i = 0; i < groups.length; i++) {
|
|
180
|
-
const parent = groups.find(group => group.children.has(current));
|
|
181
|
-
if (parent == null) {
|
|
182
|
-
break;
|
|
183
|
-
}
|
|
184
|
-
if (parent.path != null) {
|
|
185
|
-
parts.unshift(parent.path);
|
|
186
|
-
}
|
|
187
|
-
current = parent.uuid;
|
|
188
|
-
}
|
|
189
|
-
return parts;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
152
|
/**
|
|
193
153
|
* Absolute paths to try for the xcconfig a configuration is based on, in order:
|
|
194
154
|
* the reference's own anchoring first, then plain `<srcRoot>/<path>`.
|
|
@@ -211,23 +171,16 @@ function xcconfigCandidates(
|
|
|
211
171
|
if (pathField == null) {
|
|
212
172
|
return [];
|
|
213
173
|
}
|
|
214
|
-
const refPath = unquote(pathField.value);
|
|
215
|
-
if (path.isAbsolute(refPath)) {
|
|
216
|
-
return [refPath];
|
|
217
|
-
}
|
|
218
174
|
const sourceTreeField = findField(text, ref, 'sourceTree');
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
175
|
+
return xcconfigReferencePaths(
|
|
176
|
+
text,
|
|
177
|
+
{
|
|
178
|
+
uuid: refUuid,
|
|
179
|
+
path: unquote(pathField.value),
|
|
180
|
+
sourceTree: sourceTreeField != null ? unquote(sourceTreeField.value) : '',
|
|
181
|
+
},
|
|
226
182
|
srcRoot,
|
|
227
|
-
...groupPathPrefix(text, refUuid),
|
|
228
|
-
refPath,
|
|
229
183
|
);
|
|
230
|
-
return anchored === fallback ? [fallback] : [anchored, fallback];
|
|
231
184
|
}
|
|
232
185
|
|
|
233
186
|
function configName(
|
|
@@ -300,7 +253,7 @@ function readIosDeploymentTargetFromPbxproj(
|
|
|
300
253
|
) /*: ?string */ {
|
|
301
254
|
const ctx /*: XcconfigContext */ = {
|
|
302
255
|
srcRoot: opts?.srcRoot,
|
|
303
|
-
readFile: opts?.readFile ??
|
|
256
|
+
readFile: opts?.readFile ?? readXcconfig,
|
|
304
257
|
};
|
|
305
258
|
const targetUuid = opts?.targetUuid;
|
|
306
259
|
const marked = targetUuid != null ? findObjectByUuid(text, targetUuid) : null;
|
|
@@ -530,21 +530,26 @@ function addArrayStringValues(
|
|
|
530
530
|
}
|
|
531
531
|
|
|
532
532
|
/**
|
|
533
|
-
* Add a scalar field
|
|
534
|
-
*
|
|
533
|
+
* Add a scalar field only when ABSENT (never clobbers a value the user already
|
|
534
|
+
* set). Returns text unchanged if the key exists. Lands right after the field
|
|
535
|
+
* named `after` when the object has one, else after the object's `{`.
|
|
535
536
|
*/
|
|
536
537
|
function ensureScalarField(
|
|
537
538
|
text /*: string */,
|
|
538
539
|
obj /*: BodyRange */,
|
|
539
540
|
key /*: string */,
|
|
540
541
|
value /*: string */,
|
|
542
|
+
options /*: {after?: string} */ = {},
|
|
541
543
|
) /*: string */ {
|
|
542
544
|
if (findField(text, obj, key) != null) {
|
|
543
545
|
return text;
|
|
544
546
|
}
|
|
545
547
|
const fieldIndent = detectFieldIndent(text, obj);
|
|
546
548
|
const block = `\n${fieldIndent}${key} = ${value};`;
|
|
547
|
-
|
|
549
|
+
const anchor =
|
|
550
|
+
options.after != null ? findField(text, obj, options.after) : null;
|
|
551
|
+
const at = anchor != null ? anchor.tokenEnd + 1 : obj.bodyOpen + 1;
|
|
552
|
+
return text.slice(0, at) + block + text.slice(at);
|
|
548
553
|
}
|
|
549
554
|
|
|
550
555
|
/**
|
package/scripts/spm/spm-types.js
CHANGED
|
@@ -87,13 +87,6 @@ export type SpmTarget = {
|
|
|
87
87
|
// .js/.podspec/.md siblings, etc. can never sneak in. Null/empty means
|
|
88
88
|
// fall back to SPM's default scan of target.path.
|
|
89
89
|
sources?: ?Array<string>,
|
|
90
|
-
// Header search paths declared by the dep's podspec
|
|
91
|
-
// (pod_target_xcconfig HEADER_SEARCH_PATHS), already substituted relative
|
|
92
|
-
// to the dep's source dir. Path-style includes like
|
|
93
|
-
// `<react/renderer/components/safeareacontext/X.h>` resolve through these.
|
|
94
|
-
// Emitted as `.headerSearchPath(...)` directives in the target's
|
|
95
|
-
// cSettings / cxxSettings.
|
|
96
|
-
headerSearchPaths?: ?Array<string>,
|
|
97
90
|
};
|
|
98
91
|
|
|
99
92
|
// Routing metadata kept alongside an SpmTarget in main(). Lives in a wrapper
|
|
@@ -324,7 +317,8 @@ export type PluginResult = {
|
|
|
324
317
|
flavoredFrameworks: Array<PluginFlavoredFramework>,
|
|
325
318
|
// Absolute paths (dirs or files) the Xcode auto-sync build phase should watch
|
|
326
319
|
// for staleness, e.g. the plugin dep's own `Package.swift` and per-module
|
|
327
|
-
// manifests. Folded into `.spm-sync-watch-paths`
|
|
320
|
+
// manifests. Folded into `.spm-sync-watch-paths` (or `.spm-sync-watch-absent`
|
|
321
|
+
// while missing) by main().
|
|
328
322
|
watchPaths: Array<string>,
|
|
329
323
|
// Build-time shell phases for the app target, recorded to
|
|
330
324
|
// `.spm-plugin-script-phases.json` by main() and injected by `spm add`/
|
|
@@ -373,13 +367,6 @@ export type SynthPackageSpec = {
|
|
|
373
367
|
// supply absolute paths (tests). Production uses siblingSynthAbsolutePaths.
|
|
374
368
|
siblingPackageBaseRelative?: string,
|
|
375
369
|
siblingSynthAbsolutePaths?: {[swiftName: string]: string},
|
|
376
|
-
// Header search paths from the dep's podspec `pod_target_xcconfig`
|
|
377
|
-
// HEADER_SEARCH_PATHS, with `$(PODS_TARGET_SRCROOT)` substituted and the
|
|
378
|
-
// synth wrapper's `root/` prefix applied. Emitted as `.headerSearchPath()`
|
|
379
|
-
// directives on cSettings / cxxSettings so path-style includes like
|
|
380
|
-
// `<react/renderer/components/safeareacontext/X.h>` resolve through the
|
|
381
|
-
// dep's own `common/cpp/` subtree.
|
|
382
|
-
headerSearchPaths?: ?Array<string>,
|
|
383
370
|
iosDeploymentTarget?: ?string,
|
|
384
371
|
};
|
|
385
372
|
|
|
@@ -31,14 +31,24 @@
|
|
|
31
31
|
* call site)
|
|
32
32
|
* 2. Calls generate-spm-autolinking.js → build/generated/autolinking/Package.swift
|
|
33
33
|
* 3. Rebuilds the generated-headers farm
|
|
34
|
-
* 4.
|
|
34
|
+
* 4. Fails when the Xcode project does not link exactly the precompiled
|
|
35
|
+
* frameworks autolinking plugins provide, and records the errors in
|
|
36
|
+
* build/generated/autolinking/.spm-plugin-mismatch for later builds
|
|
37
|
+
* 5. Writes build/generated/autolinking/.spm-sync-stamp
|
|
35
38
|
*
|
|
36
39
|
* Runtime frameworks are deliberately not downloaded or regenerated from an
|
|
37
40
|
* Xcode build. `spm add` / `spm update` own the immutable dual-flavor slots and
|
|
38
41
|
* the app target's linker/embed configuration.
|
|
39
42
|
*/
|
|
40
43
|
|
|
41
|
-
const {
|
|
44
|
+
const {
|
|
45
|
+
MissingManifestError,
|
|
46
|
+
main: generateAutolinking,
|
|
47
|
+
} = require('./generate-spm-autolinking');
|
|
48
|
+
const {
|
|
49
|
+
PluginFrameworkMismatchError,
|
|
50
|
+
assertPluginFrameworksLinked,
|
|
51
|
+
} = require('./generate-spm-xcodeproj');
|
|
42
52
|
const {
|
|
43
53
|
RemoteVersionError,
|
|
44
54
|
buildPerAppHeaderTree,
|
|
@@ -62,6 +72,7 @@ const defaultDeps = {
|
|
|
62
72
|
generateAutolinking,
|
|
63
73
|
installSpmCodegenTemplate,
|
|
64
74
|
buildPerAppHeaderTree,
|
|
75
|
+
assertPluginFrameworksLinked,
|
|
65
76
|
findProjectRoot,
|
|
66
77
|
};
|
|
67
78
|
|
|
@@ -130,6 +141,27 @@ async function main(
|
|
|
130
141
|
autolinkingArgv.push('--ios-deployment-target', iosDeploymentTarget);
|
|
131
142
|
}
|
|
132
143
|
deps.generateAutolinking(autolinkingArgv);
|
|
144
|
+
const autolinkingDir = path.join(
|
|
145
|
+
appRoot,
|
|
146
|
+
'build',
|
|
147
|
+
'generated',
|
|
148
|
+
'autolinking',
|
|
149
|
+
);
|
|
150
|
+
const stampPath = path.join(autolinkingDir, '.spm-sync-stamp');
|
|
151
|
+
const mismatchPath = path.join(autolinkingDir, '.spm-plugin-mismatch');
|
|
152
|
+
try {
|
|
153
|
+
deps.assertPluginFrameworksLinked(appRoot);
|
|
154
|
+
} catch (e) {
|
|
155
|
+
if (e instanceof PluginFrameworkMismatchError) {
|
|
156
|
+
// The build phase prints the recorded errors and fails until an input
|
|
157
|
+
// changes, so these inputs count as synced.
|
|
158
|
+
fs.mkdirSync(autolinkingDir, {recursive: true});
|
|
159
|
+
fs.writeFileSync(mismatchPath, e.problems.join('\n') + '\n', 'utf8');
|
|
160
|
+
writeStamp(stampPath);
|
|
161
|
+
}
|
|
162
|
+
throw e;
|
|
163
|
+
}
|
|
164
|
+
fs.rmSync(mismatchPath, {force: true});
|
|
133
165
|
|
|
134
166
|
// Rebuild the per-app generated-headers farm (vended as the ReactAppHeaders
|
|
135
167
|
// SPM target inside the codegen package). React core headers need no trees
|
|
@@ -139,31 +171,33 @@ async function main(
|
|
|
139
171
|
// so no path-locator JSON is written.
|
|
140
172
|
deps.buildPerAppHeaderTree(appRoot, {log});
|
|
141
173
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
'.spm-sync-stamp',
|
|
148
|
-
);
|
|
174
|
+
writeStamp(stampPath);
|
|
175
|
+
log('SPM autolinking sync complete.');
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function writeStamp(stampPath /*: string */) /*: void */ {
|
|
149
179
|
fs.mkdirSync(path.dirname(stampPath), {recursive: true});
|
|
150
180
|
fs.writeFileSync(stampPath, new Date().toISOString() + '\n', 'utf8');
|
|
151
|
-
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function reportFailure(e /*: unknown */) /*: void */ {
|
|
184
|
+
if (
|
|
185
|
+
e instanceof RemoteVersionError ||
|
|
186
|
+
e instanceof MissingManifestError ||
|
|
187
|
+
e instanceof PluginFrameworkMismatchError
|
|
188
|
+
) {
|
|
189
|
+
// Clean message + exit 2 (the build phase hard-fails on it) instead of a
|
|
190
|
+
// stack trace, matching how setup-apple-spm.js surfaces these errors.
|
|
191
|
+
log(e.message);
|
|
192
|
+
process.exitCode = 2;
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
console.error(e);
|
|
196
|
+
process.exitCode = 1;
|
|
152
197
|
}
|
|
153
198
|
|
|
154
199
|
if (require.main === module) {
|
|
155
|
-
main().catch(
|
|
156
|
-
if (e instanceof RemoteVersionError) {
|
|
157
|
-
// Clean message + exit 2 (the build phase hard-fails on it) instead of a
|
|
158
|
-
// stack trace, matching how setup-apple-spm.js surfaces remote-mode
|
|
159
|
-
// version errors.
|
|
160
|
-
log(e.message);
|
|
161
|
-
process.exitCode = 2;
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
console.error(e);
|
|
165
|
-
process.exitCode = 1;
|
|
166
|
-
});
|
|
200
|
+
main().catch(reportFailure);
|
|
167
201
|
}
|
|
168
202
|
|
|
169
|
-
module.exports = {main};
|
|
203
|
+
module.exports = {main, reportFailure};
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow strict-local
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
'use strict';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Where the xcconfig file a project references lives on disk, and the files it
|
|
15
|
+
* pulls in through `#include` — resolved the way Xcode resolves them.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const {
|
|
19
|
+
findField,
|
|
20
|
+
forEachObjectInSection,
|
|
21
|
+
uuidsInArray,
|
|
22
|
+
} = require('./spm-pbxproj');
|
|
23
|
+
const fs = require('node:fs');
|
|
24
|
+
const path = require('node:path');
|
|
25
|
+
|
|
26
|
+
function unquote(value /*: string */) /*: string */ {
|
|
27
|
+
return value.replace(/^"|"$/g, '');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function readXcconfig(absPath /*: string */) /*: ?string */ {
|
|
31
|
+
try {
|
|
32
|
+
return fs.readFileSync(absPath, 'utf8');
|
|
33
|
+
} catch {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Directory components of the PBXGroup chain holding `uuid`, outermost first —
|
|
40
|
+
* how a `"<group>"` file reference's path is anchored to the project dir.
|
|
41
|
+
*/
|
|
42
|
+
function groupPathPrefix(
|
|
43
|
+
text /*: string */,
|
|
44
|
+
uuid /*: string */,
|
|
45
|
+
) /*: Array<string> */ {
|
|
46
|
+
const groups /*: Array<{uuid: string, path: ?string, children: Set<string>}> */ =
|
|
47
|
+
[];
|
|
48
|
+
forEachObjectInSection(text, 'PBXGroup', ({uuid: groupUuid, ...body}) => {
|
|
49
|
+
const children = findField(text, body, 'children');
|
|
50
|
+
const groupPath = findField(text, body, 'path');
|
|
51
|
+
groups.push({
|
|
52
|
+
uuid: groupUuid,
|
|
53
|
+
path: groupPath != null ? unquote(groupPath.value) : null,
|
|
54
|
+
children: children != null ? uuidsInArray(children.value) : new Set(),
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const parts /*: Array<string> */ = [];
|
|
59
|
+
let current = uuid;
|
|
60
|
+
for (let i = 0; i < groups.length; i++) {
|
|
61
|
+
const parent = groups.find(group => group.children.has(current));
|
|
62
|
+
if (parent == null) {
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
if (parent.path != null) {
|
|
66
|
+
parts.unshift(parent.path);
|
|
67
|
+
}
|
|
68
|
+
current = parent.uuid;
|
|
69
|
+
}
|
|
70
|
+
return parts;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Absolute paths to try for the file a PBXFileReference names, in order: the
|
|
75
|
+
* reference's own anchoring first, then plain `<srcRoot>/<path>`. `ref.path`
|
|
76
|
+
* and `ref.sourceTree` are unquoted.
|
|
77
|
+
*/
|
|
78
|
+
function xcconfigReferencePaths(
|
|
79
|
+
text /*: string */,
|
|
80
|
+
ref /*: {uuid: string, path: string, sourceTree: string} */,
|
|
81
|
+
srcRoot /*: string */,
|
|
82
|
+
) /*: Array<string> */ {
|
|
83
|
+
if (path.isAbsolute(ref.path)) {
|
|
84
|
+
return [ref.path];
|
|
85
|
+
}
|
|
86
|
+
const fallback = path.join(srcRoot, ref.path);
|
|
87
|
+
if (ref.sourceTree !== '<group>') {
|
|
88
|
+
return [fallback];
|
|
89
|
+
}
|
|
90
|
+
const anchored = path.join(
|
|
91
|
+
srcRoot,
|
|
92
|
+
...groupPathPrefix(text, ref.uuid),
|
|
93
|
+
ref.path,
|
|
94
|
+
);
|
|
95
|
+
return anchored === fallback ? [fallback] : [anchored, fallback];
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* The absolute path an `#include "…"` or `#include? "…"` line of the xcconfig
|
|
100
|
+
* at `absPath` names, or null for any other line. Xcode resolves it from the
|
|
101
|
+
* folder of the file holding the line.
|
|
102
|
+
*/
|
|
103
|
+
function xcconfigIncludePath(
|
|
104
|
+
absPath /*: string */,
|
|
105
|
+
line /*: string */,
|
|
106
|
+
) /*: ?string */ {
|
|
107
|
+
const include = line
|
|
108
|
+
.replace(/\/\/.*$/, '')
|
|
109
|
+
.trim()
|
|
110
|
+
.match(/^#include\??\s+"([^"]+)"/);
|
|
111
|
+
return include != null
|
|
112
|
+
? path.resolve(path.dirname(absPath), include[1])
|
|
113
|
+
: null;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Whether the xcconfig at `absPath` (holding `content`) pulls in `targetPath`
|
|
118
|
+
* through its `#include` chain. An included file that cannot be read ends its
|
|
119
|
+
* branch of the chain.
|
|
120
|
+
*/
|
|
121
|
+
function xcconfigIncludes(
|
|
122
|
+
absPath /*: string */,
|
|
123
|
+
content /*: string */,
|
|
124
|
+
targetPath /*: string */,
|
|
125
|
+
visited /*: Set<string> */ = new Set(),
|
|
126
|
+
) /*: boolean */ {
|
|
127
|
+
visited.add(absPath);
|
|
128
|
+
for (const line of content.split('\n')) {
|
|
129
|
+
const included = xcconfigIncludePath(absPath, line);
|
|
130
|
+
if (included == null || visited.has(included)) {
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
if (included === path.resolve(targetPath)) {
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
136
|
+
const next = readXcconfig(included);
|
|
137
|
+
if (next != null && xcconfigIncludes(included, next, targetPath, visited)) {
|
|
138
|
+
return true;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
module.exports = {
|
|
145
|
+
readXcconfig,
|
|
146
|
+
xcconfigIncludePath,
|
|
147
|
+
xcconfigIncludes,
|
|
148
|
+
xcconfigReferencePaths,
|
|
149
|
+
};
|
package/sdks/.hermesv1version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
hermes-v260318099.0.
|
|
1
|
+
hermes-v260318099.0.5
|
|
@@ -1 +1 @@
|
|
|
1
|
-
HERMES_VERSION_NAME=260318099.0.
|
|
1
|
+
HERMES_VERSION_NAME=260318099.0.5
|