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.
Files changed (43) hide show
  1. package/Libraries/AppDelegate/RCTDefaultReactNativeFactoryDelegate.mm +26 -1
  2. package/Libraries/AppDelegate/RCTUIConfiguratorProtocol.h +1 -1
  3. package/Libraries/Core/ReactNativeVersion.js +1 -1
  4. package/Libraries/LogBox/LogBoxNotificationContainer.js +7 -1
  5. package/Libraries/LogBox/UI/LogBoxNotificationDismissButton.js +3 -3
  6. package/React/Base/RCTStatusBarAppearance.h +30 -0
  7. package/React/Base/RCTStatusBarAppearance.mm +66 -0
  8. package/React/Base/RCTVersion.m +1 -1
  9. package/React/CoreModules/RCTStatusBarManager.mm +34 -9
  10. package/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm +13 -5
  11. package/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm +30 -2
  12. package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +9 -0
  13. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +8 -1
  14. package/ReactAndroid/gradle.properties +1 -1
  15. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
  16. package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTypefaceUtils.kt +4 -0
  17. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextDecorationStyle.kt +32 -4
  18. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.kt +4 -0
  19. package/ReactApple/RCTSwiftUI/RCTSwiftUIContainerView.swift +4 -0
  20. package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
  21. package/ReactCommon/jsi/jsi/decorator.h +64 -0
  22. package/ReactCommon/jsi/jsi/jsi.cpp +2 -4
  23. package/ReactCommon/jsi/jsi/test/testlib.cpp +285 -8
  24. package/ReactCommon/jsi/jsi/test/testlib.h +1 -0
  25. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +2 -1
  26. package/ReactCommon/yoga/yoga/algorithm/CalculateLayout.cpp +6 -2
  27. package/ReactCommon/yoga/yoga/algorithm/PixelGrid.cpp +49 -19
  28. package/package.json +8 -8
  29. package/scripts/cocoapods/utils.rb +51 -0
  30. package/scripts/codegen/templates/Package.swift.spm-template +13 -2
  31. package/scripts/react_native_pods.rb +1 -0
  32. package/scripts/setup-apple-spm.js +10 -5
  33. package/scripts/spm/autolinking-plugins.js +2 -1
  34. package/scripts/spm/flavored-frameworks.js +1 -0
  35. package/scripts/spm/generate-spm-autolinking.js +34 -96
  36. package/scripts/spm/generate-spm-xcodeproj.js +798 -285
  37. package/scripts/spm/ios-deployment-target.js +16 -63
  38. package/scripts/spm/spm-pbxproj.js +8 -3
  39. package/scripts/spm/spm-types.js +2 -15
  40. package/scripts/spm/sync-spm-autolinking.js +57 -23
  41. package/scripts/spm/xcconfig-files.js +149 -0
  42. package/sdks/.hermesv1version +1 -1
  43. package/sdks/hermes-engine/version.properties +1 -1
@@ -793,6 +793,57 @@ class ReactNativePodsUtils
793
793
  end
794
794
  end
795
795
 
796
+ REACT_NATIVE_THIRD_PARTY_PODS = [
797
+ 'RCT-Folly',
798
+ 'glog',
799
+ 'boost',
800
+ 'DoubleConversion',
801
+ 'fmt',
802
+ 'fast_float',
803
+ 'SocketRocket',
804
+ ].freeze
805
+
806
+ # Generated by React Native into the app's build folder, so not under react_native_path.
807
+ REACT_NATIVE_GENERATED_PODS = [
808
+ 'ReactCodegen',
809
+ 'ReactAppDependencyProvider',
810
+ ].freeze
811
+
812
+ ALWAYS_OPTIMIZED_PODS = [
813
+ 'Yoga',
814
+ 'glog',
815
+ ].freeze
816
+
817
+ # Xcode builds Release at -Os by default. Android builds React Native and its
818
+ # third-party dependencies at -O2 in Release, and Yoga and glog at -O2 in Debug
819
+ # too, so match it. Hermes keeps its own MinSizeRel build on both platforms, and
820
+ # pods outside React Native are left alone.
821
+ def self.set_optimization_level_for_react_native_pods(installer, react_native_path)
822
+ Pod::UI.puts("Setting GCC_OPTIMIZATION_LEVEL to 2 for React Native pods in Release, and for #{ALWAYS_OPTIMIZED_PODS.join(', ')} in all configurations")
823
+ rn_real_path = File.realpath(File.expand_path(react_native_path, Pod::Config.instance.installation_root.to_s))
824
+
825
+ installer.target_installation_results.pod_target_installation_results.each do |_, target_installation_result|
826
+ pod_name = target_installation_result.target.pod_name
827
+ next unless self.react_native_pod?(installer.sandbox, pod_name, rn_real_path)
828
+
829
+ always_optimized = ALWAYS_OPTIMIZED_PODS.include?(pod_name)
830
+ target_installation_result.native_target.build_configurations.each do |config|
831
+ next unless always_optimized || config.type == :release
832
+ config.build_settings['GCC_OPTIMIZATION_LEVEL'] = '2'
833
+ end
834
+ end
835
+ end
836
+
837
+ def self.react_native_pod?(sandbox, pod_name, rn_real_path)
838
+ return false if pod_name == 'hermes-engine'
839
+ return true if REACT_NATIVE_THIRD_PARTY_PODS.include?(pod_name)
840
+ return true if REACT_NATIVE_GENERATED_PODS.include?(pod_name)
841
+ return false unless sandbox.local?(pod_name)
842
+
843
+ pod_real_path = File.realpath(sandbox.pod_dir(pod_name).to_s)
844
+ pod_real_path == rn_real_path || pod_real_path.start_with?(rn_real_path + File::SEPARATOR)
845
+ end
846
+
796
847
  def self.add_flag_to_map_with_inheritance(map, field, flag)
797
848
  if map[field] == nil
798
849
  map[field] = "$(inherited)" + flag
@@ -50,7 +50,12 @@ let package = Package(
50
50
  path: "ReactCodegen",
51
51
  exclude: ["ReactCodegen.podspec"],
52
52
  publicHeadersPath: ".",
53
- cSettings: [.headerSearchPath("headers")],
53
+ // Release builds at -O2 to match CocoaPods and Android; Xcode defaults
54
+ // Release to -Os. cSettings covers .m sources, cxxSettings .mm/.cpp.
55
+ cSettings: [
56
+ .headerSearchPath("headers"),
57
+ .unsafeFlags(["-O2"], .when(configuration: .release)),
58
+ ],
54
59
  // DEBUG/NDEBUG match the prebuilt React.framework's config-gated C++
55
60
  // ABI: NDEBUG (Release) strips DebugStringConvertible's vtable and
56
61
  // shifts the ShadowNode layout that codegen'd Props inherit, so this
@@ -61,6 +66,7 @@ let package = Package(
61
66
  .headerSearchPath("headers"),
62
67
  .define("DEBUG", .when(configuration: .debug)),
63
68
  .define("NDEBUG", .when(configuration: .release)),
69
+ .unsafeFlags(["-O2"], .when(configuration: .release)),
64
70
  ],
65
71
  linkerSettings: [
66
72
  .linkedFramework("Foundation")
@@ -72,13 +78,18 @@ let package = Package(
72
78
  path: "ReactAppDependencyProvider",
73
79
  exclude: ["ReactAppDependencyProvider.podspec"],
74
80
  publicHeadersPath: ".",
75
- cSettings: [.headerSearchPath(".."), .headerSearchPath("headers")],
81
+ cSettings: [
82
+ .headerSearchPath(".."),
83
+ .headerSearchPath("headers"),
84
+ .unsafeFlags(["-O2"], .when(configuration: .release)),
85
+ ],
76
86
  cxxSettings: [
77
87
  .headerSearchPath(".."),
78
88
  .headerSearchPath("headers"),
79
89
  // Match the prebuilt React.framework NDEBUG-gated C++ ABI (see above).
80
90
  .define("DEBUG", .when(configuration: .debug)),
81
91
  .define("NDEBUG", .when(configuration: .release)),
92
+ .unsafeFlags(["-O2"], .when(configuration: .release)),
82
93
  ],
83
94
  linkerSettings: [
84
95
  .linkedFramework("Foundation")
@@ -633,6 +633,7 @@ def react_native_post_install(
633
633
  ReactNativePodsUtils.updateOSDeploymentTarget(installer)
634
634
  ReactNativePodsUtils.set_dynamic_frameworks_flags(installer)
635
635
  ReactNativePodsUtils.add_ndebug_flag_to_pods_in_release(installer)
636
+ ReactNativePodsUtils.set_optimization_level_for_react_native_pods(installer, react_native_path)
636
637
 
637
638
  if !ReactNativeCoreUtils.build_rncore_from_source()
638
639
  # The Xcode-26 SWIFT_ENABLE_EXPLICIT_MODULES=NO workaround (#53457) is removed:
@@ -34,9 +34,10 @@
34
34
  * .spm-injected.json) and drop the marker.
35
35
  * scaffold Generate Package.swift for community deps that
36
36
  * lack SPM support.
37
- * sync / codegen / download Advanced/internal: `sync` is invoked by the
38
- * generated Xcode build phase; `codegen` and
39
- * `download` run a single pipeline step.
37
+ * sync Re-run the build-time autolinking sync and its
38
+ * checks. The generated Xcode build phase runs
39
+ * it; run it by hand after precompiling a module.
40
+ * codegen / download Advanced/internal: run a single pipeline step.
40
41
  *
41
42
  * Zero-arg `npx react-native spm` auto-detects: a freshly-scaffolded CocoaPods
42
43
  * project (clean tree, stock Podfile) → `add --deintegrate`; an injected
@@ -93,6 +94,7 @@ const {
93
94
  const {main: generatePackage} = require('./spm/generate-spm-package');
94
95
  const {findSourcePath} = require('./spm/generate-spm-package');
95
96
  const {
97
+ PluginFrameworkMismatchError,
96
98
  SPM_INJECTED_MARKER,
97
99
  cleanupDanglingJavaScriptCoreRef,
98
100
  cleanupLeftoverPodsGroup,
@@ -1200,8 +1202,11 @@ async function main(argv /*:: ?: Array<string> */) /*: Promise<void> */ {
1200
1202
  iosDeploymentTarget,
1201
1203
  ]);
1202
1204
  } catch (e) {
1203
- if (e instanceof MissingManifestError) {
1204
- // The per-dep `error:` lines were already printed by the autolinker.
1205
+ if (
1206
+ e instanceof MissingManifestError ||
1207
+ e instanceof PluginFrameworkMismatchError
1208
+ ) {
1209
+ // The `error:` lines were already printed.
1205
1210
  // Exit 2 (distinct from generic failure) so the Xcode build phase can
1206
1211
  // turn this into a hard build error while staying lenient on transient
1207
1212
  // sync failures.
@@ -65,7 +65,8 @@
65
65
  * // Absolute paths (dirs OR files) the Xcode auto-sync build phase
66
66
  * // should watch for staleness — e.g. the plugin dep's own
67
67
  * // `Package.swift`, `expo-module.config.json`, and per-module
68
- * // manifests. Folded into `.spm-sync-watch-paths`; a file edit or a
68
+ * // manifests. Folded into `.spm-sync-watch-paths` (or
69
+ * // `.spm-sync-watch-absent` while missing); a file edit or a
69
70
  * // dir add/remove there re-triggers the sync. Relative/empty/non-string
70
71
  * // entries are dropped with a warning; a non-array is ignored.
71
72
  * watchPaths: ['/abs/path/Package.swift', '/abs/dir'],
@@ -1002,6 +1002,7 @@ module.exports = {
1002
1002
  finalizeArtifactPublication,
1003
1003
  prepareFlavoredFrameworks,
1004
1004
  readFlavoredFrameworksManifest,
1005
+ readPluginFrameworks,
1005
1006
  sdkConditionForSlice,
1006
1007
  transformReactModuleMap,
1007
1008
  validatePair,
@@ -71,7 +71,7 @@ const {
71
71
  MIN_IOS_VERSION_SUPPORTED,
72
72
  sanitizeIosDeploymentTarget,
73
73
  } = require('./ios-deployment-target');
74
- const {findPodspecs, readPodspecCached} = require('./read-podspec');
74
+ const {findPodspecs} = require('./read-podspec');
75
75
  const {
76
76
  AUTOLINKED_PACKAGE_NAME,
77
77
  REACT_CODEGEN_PACKAGE_NAME,
@@ -801,58 +801,6 @@ function expandSpmSourceGlobs(
801
801
  return micromatch(walkSourceFiles(sourcePath), patterns).sort();
802
802
  }
803
803
 
804
- /**
805
- * Converts an autolinking.json dependency to an SPM target spec.
806
- * Returns null if the dependency doesn't have iOS support.
807
- *
808
- * `swiftNameByNpm` maps each autolinked dep's npm name to its resolved Swift
809
- * name (populated by expandSpmDependencies from the dep's podspec and
810
- * `spm.name`). Every name this function emits comes from there — see
811
- * requireSwiftName.
812
- */
813
- /**
814
- * Read the dep's podspec (if any) and extract its declared
815
- * `pod_target_xcconfig` HEADER_SEARCH_PATHS, substituted relative to the dep
816
- * source dir. Returns paths suitable for an SPM `.headerSearchPath()`
817
- * directive whose target.path is the dep root (entries are NOT yet prefixed
818
- * with the synth wrapper's `root/` — the emission site adds that prefix
819
- * because the wrapper's target.path is `.`, not the source dir).
820
- *
821
- * Without these, path-style angle includes like
822
- * `<react/renderer/components/safeareacontext/X.h>` (used by
823
- * react-native-safe-area-context, reanimated, screens, etc.) fail to resolve
824
- * because the headers live under the dep's `common/cpp/` rather than under
825
- * the framework-imported xcframework headers.
826
- */
827
- function extractPodspecHeaderSearchPaths(
828
- sourceDir /*: string */,
829
- ) /*: Array<string> */ {
830
- const podspecPath /*: ?string */ = findPodspecs(sourceDir)[0];
831
- if (podspecPath == null) return [];
832
-
833
- let model;
834
- try {
835
- model = readPodspecCached(podspecPath);
836
- } catch {
837
- return [];
838
- }
839
-
840
- const out /*: Array<string> */ = [];
841
- for (const raw of model.headerSearchPaths) {
842
- const substituted = raw
843
- .replace(/\$\(PODS_TARGET_SRCROOT\)/g, '.')
844
- .replace(/\$\{PODS_TARGET_SRCROOT\}/g, '.');
845
- // Drop entries still containing unresolved Xcode tokens — emitting them
846
- // verbatim would surface as clang "no such file" failures.
847
- if (/\$[({]/.test(substituted)) continue;
848
- const cleaned = substituted.replace(/^\.\//, '').replace(/^\//, '');
849
- if (cleaned.length > 0 && !out.includes(cleaned)) {
850
- out.push(cleaned);
851
- }
852
- }
853
- return out;
854
- }
855
-
856
804
  /**
857
805
  * The Swift name expandSpmDependencies resolved for `npmName`, or a hard error:
858
806
  * re-deriving one here would emit a reference nothing in the graph matches.
@@ -869,6 +817,15 @@ function requireSwiftName(
869
817
  return resolved;
870
818
  }
871
819
 
820
+ /**
821
+ * Converts an autolinking.json dependency to an SPM target spec.
822
+ * Returns null if the dependency doesn't have iOS support.
823
+ *
824
+ * `swiftNameByNpm` maps each autolinked dep's npm name to its resolved Swift
825
+ * name (populated by expandSpmDependencies from the dep's podspec and
826
+ * `spm.name`). Every name this function emits comes from there — see
827
+ * requireSwiftName.
828
+ */
872
829
  function autolinkingDepToSpmTarget(
873
830
  depName /*: string */,
874
831
  dep /*: AutolinkedDep */,
@@ -903,8 +860,6 @@ function autolinkingDepToSpmTarget(
903
860
  ? spmDeps.map(n => requireSwiftName(n, swiftNameByNpm.get(n)))
904
861
  : undefined;
905
862
 
906
- const headerSearchPaths = extractPodspecHeaderSearchPaths(sourceDir);
907
-
908
863
  return {
909
864
  name: targetName,
910
865
  path: relSourcePath,
@@ -912,8 +867,6 @@ function autolinkingDepToSpmTarget(
912
867
  publicHeadersPath: inferPublicHeadersPath(sourceDir),
913
868
  resources,
914
869
  spmTargetDependencies,
915
- headerSearchPaths:
916
- headerSearchPaths.length > 0 ? headerSearchPaths : undefined,
917
870
  };
918
871
  }
919
872
 
@@ -1123,12 +1076,6 @@ function generateSynthPackageSwift(spec /*: SynthPackageSpec */) /*: string */ {
1123
1076
  const exclude /*: Array<string> */ = spec.exclude ?? [];
1124
1077
  const sources /*: ?Array<string> */ = spec.sources;
1125
1078
  const publicHeadersPath /*: ?string */ = spec.publicHeadersPath ?? null;
1126
- // Per-dep header search paths from the podspec's
1127
- // pod_target_xcconfig HEADER_SEARCH_PATHS — already prefixed by the caller
1128
- // with the synth wrapper's `root/` so they resolve relative to target.path.
1129
- // Emitted as `.headerSearchPath()` directives, which SPM accepts on
1130
- // cSettings / cxxSettings without needing absolute paths.
1131
- const headerSearchPaths /*: Array<string> */ = spec.headerSearchPaths ?? [];
1132
1079
  const spmDependencies /*: Array<{swiftName: string}> */ =
1133
1080
  spec.spmDependencies ?? [];
1134
1081
  const hasReactDep /*: boolean */ = spec.hasReactDep !== false;
@@ -1212,22 +1159,11 @@ function generateSynthPackageSwift(spec /*: SynthPackageSpec */) /*: string */ {
1212
1159
  packageDeps.length > 0
1213
1160
  ? ` dependencies: [\n ${packageDeps.join(',\n ')},\n ],\n`
1214
1161
  : '';
1215
- // `.headerSearchPath(...)` entries from the podspec — first-class
1216
- // directives keep SPM's diagnostics meaningful (clang reports the
1217
- // dep-relative path on miss). React headers need no paths at all.
1218
- const headerSearchPathList = headerSearchPaths.map(
1219
- p => `.headerSearchPath("${p}")`,
1220
- );
1221
- const cSettingsLine =
1222
- headerSearchPathList.length > 0
1223
- ? `\n cSettings: [${headerSearchPathList.join(', ')}],`
1224
- : '';
1225
- // ALWAYS emit the config-gated C++ defines (even with no header paths): a
1226
- // Fabric C++ target must compile with the same NDEBUG state as the prebuilt
1227
- // React.framework, else DebugStringConvertible's vtable / ShadowNode layout
1228
- // diverges and a Release build fails to link. Mirrors Package.swift.
1229
- const cxxEntries = [...REACT_CXX_CONFIG_DEFINES, ...headerSearchPathList];
1230
- const cxxSettingsLine = `\n cxxSettings: [${cxxEntries.join(', ')}],`;
1162
+ // ALWAYS emit the config-gated C++ defines: a Fabric C++ target must
1163
+ // compile with the same NDEBUG state as the prebuilt React.framework, else
1164
+ // DebugStringConvertible's vtable / ShadowNode layout diverges and a
1165
+ // Release build fails to link. Mirrors Package.swift.
1166
+ const cxxSettingsLine = `\n cxxSettings: [${REACT_CXX_CONFIG_DEFINES.join(', ')}],`;
1231
1167
 
1232
1168
  return `// swift-tools-version: 6.0
1233
1169
  // AUTO-GENERATED by scripts/generate-spm-autolinking.js – do not edit manually.
@@ -1245,7 +1181,7 @@ ${packageDepsBlock} targets: [
1245
1181
  .target(
1246
1182
  name: "${swiftName}",
1247
1183
  dependencies: [${targetDeps.join(', ')}],
1248
- path: "${targetPath}",${excludeLine}${sourcesLine}${publicHeadersLine}${resourcesLine}${cSettingsLine}${cxxSettingsLine}
1184
+ path: "${targetPath}",${excludeLine}${sourcesLine}${publicHeadersLine}${resourcesLine}${cxxSettingsLine}
1249
1185
  linkerSettings: [.linkedFramework("UIKit"), .linkedFramework("Foundation"), .linkedFramework("CoreGraphics")]
1250
1186
  ),
1251
1187
  ],
@@ -1705,15 +1641,6 @@ function main(argv /*:: ?: Array<string> */) /*: void */ {
1705
1641
  const prefixedSources /*: ?Array<string> */ =
1706
1642
  rawSources.length > 0 ? rawSources.map(withRoot) : null;
1707
1643
 
1708
- // Podspec HEADER_SEARCH_PATHS were captured relative to the dep's source
1709
- // dir. The wrapper exposes the source dir under `root/` (target.path is
1710
- // `.`, the wrapper dir), so each entry must be prefixed with `root/` so
1711
- // clang sees the real subtree.
1712
- const prefixedHeaderSearchPaths /*: ?Array<string> */ =
1713
- target.headerSearchPaths != null && target.headerSearchPaths.length > 0
1714
- ? target.headerSearchPaths.map(withRoot)
1715
- : null;
1716
-
1717
1644
  const synthContent = generateSynthPackageSwift({
1718
1645
  swiftName: target.name,
1719
1646
  iosDeploymentTarget: args.iosDeploymentTarget,
@@ -1725,7 +1652,6 @@ function main(argv /*:: ?: Array<string> */) /*: void */ {
1725
1652
  // header farm at <outputDir>/headers is folded into it).
1726
1653
  publicHeadersPath: 'include',
1727
1654
  resources: prefixedResources,
1728
- headerSearchPaths: prefixedHeaderSearchPaths,
1729
1655
  spmDependencies: (target.spmTargetDependencies ?? []).map(swiftName => ({
1730
1656
  swiftName,
1731
1657
  })),
@@ -1920,12 +1846,15 @@ function main(argv /*:: ?: Array<string> */) /*: void */ {
1920
1846
  // stale until an unrelated install triggers a sync. The dep ROOT is
1921
1847
  // threaded through the entry (entry.root, from the autolinking model),
1922
1848
  // not derived by walking up from the (possibly nested) source dir.
1849
+ // Both are listed even when absent: one that appears later (e.g. after
1850
+ // `spm scaffold`) changes self-managed detection and needs a re-sync.
1923
1851
  // 3. Plugin-contributed paths (e.g. Expo's own Package.swift / per-module
1924
1852
  // manifests) — already validated absolute in invokePlugins.
1925
1853
  // The phase distinguishes dir vs file with `-d`/`-f` at build time (no
1926
- // markers). The existsSync filter here is safe: these paths come from a
1927
- // successful sync so they exist now; a path that later VANISHES is caught at
1928
- // phase time against this file and forces a re-sync.
1854
+ // markers). A listed path that later VANISHES forces a re-sync. Paths that do
1855
+ // not exist yet go to .spm-sync-watch-absent, where one that APPEARS forces a
1856
+ // re-sync; they stay out of this file because phases from older versions
1857
+ // treat a missing listed path as stale.
1929
1858
  const watchCandidates /*: Array<string> */ = [...entryAbsDirs.values()];
1930
1859
  for (const entry of entries) {
1931
1860
  const root = entry.root;
@@ -1936,14 +1865,23 @@ function main(argv /*:: ?: Array<string> */) /*: void */ {
1936
1865
  watchCandidates.push(path.join(root, '.react-native'));
1937
1866
  }
1938
1867
  watchCandidates.push(...pluginWatchPaths);
1939
- const watchPaths = Array.from(new Set(watchCandidates))
1940
- .filter(p => p.length > 0 && fs.existsSync(p))
1941
- .sort();
1868
+ const watchPaths /*: Array<string> */ = [];
1869
+ const absentWatchPaths /*: Array<string> */ = [];
1870
+ for (const p of Array.from(new Set(watchCandidates)).sort()) {
1871
+ if (p.length > 0) {
1872
+ (fs.existsSync(p) ? watchPaths : absentWatchPaths).push(p);
1873
+ }
1874
+ }
1942
1875
  fs.writeFileSync(
1943
1876
  path.join(outputDir, '.spm-sync-watch-paths'),
1944
1877
  watchPaths.join('\n') + (watchPaths.length > 0 ? '\n' : ''),
1945
1878
  'utf8',
1946
1879
  );
1880
+ fs.writeFileSync(
1881
+ path.join(outputDir, '.spm-sync-watch-absent'),
1882
+ absentWatchPaths.join('\n') + (absentWatchPaths.length > 0 ? '\n' : ''),
1883
+ 'utf8',
1884
+ );
1947
1885
 
1948
1886
  // AutolinkedAggregate is glue; needs at least one source file (Swift, so we
1949
1887
  // sidestep the Obj-C public-headers-dir requirement).