Commit 19609e1
fix(spm): migration fixes surfaced by rn-tester + helloworld SPM builds
Migrating rn-tester (RNTesterPods.xcodeproj, in-place) and helloworld to
SwiftPM surfaced five latent bugs:
- scaffold: podspecs with root-level sources (s.source_files =
"*.{h,m,mm}") got no publicHeadersPath, so SPM rejected the target
over the nonexistent default include/. The scaffolder now mirrors
root headers into a generated include/<SwiftName>/ shim dir
(publicHeadersPath: "include"), giving dependents the CocoaPods
header-map spelling `#import <SwiftName/Header.h>`.
- scaffold: root podspec globs matched the scaffolder's own output on
re-runs — Package.swift's `.swift` extension tripped the
mixed-language gate into DELETING the manifest it had just written
(runs alternated between scaffolding and self-destructing). Scaffold
artifacts (Package.swift, the prefix header, include/ shims) are now
excluded from source expansion.
- autolinking: the one-time legacy-layout cleanup unconditionally
removed `<dep>/include/`, nuking the scaffolder's shim dirs on every
sync. It now only removes include/ together with a marker-bearing
legacy in-place Package.swift.
- scaffold: transitive spm.dependencies entries carry no podspecPath,
so podspec-name sibling deps (s.dependency "TestLibraryCommon")
could not be wired ("Unknown dependency"). The sibling map now
discovers podspecs at those deps' roots.
- add --deintegrate: a ${PODS_ROOT}-anchored REACT_NATIVE_PATH (the
CocoaPods template default) dangles once CocoaPods is deintegrated,
breaking the "Bundle React Native code and images" phase. The
injection now replaces it with the SPM-computed path, recording the
original in the marker so deinit restores it exactly.
Also declares TestLibraryApple's real dependency on TestLibraryCommon
in its podspec (CocoaPods resolved the undeclared edge leniently
through the shared Public headers dir; SPM needs it for sibling
package wiring).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 3167024 commit 19609e1
5 files changed
Lines changed: 132 additions & 11 deletions
File tree
- packages
- react-native-test-library/apple
- react-native/scripts/spm
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
22 | 28 | | |
23 | 29 | | |
Lines changed: 18 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1570 | 1570 | | |
1571 | 1571 | | |
1572 | 1572 | | |
| 1573 | + | |
1573 | 1574 | | |
1574 | 1575 | | |
1575 | 1576 | | |
1576 | 1577 | | |
| 1578 | + | |
1577 | 1579 | | |
1578 | 1580 | | |
1579 | 1581 | | |
1580 | 1582 | | |
1581 | 1583 | | |
1582 | 1584 | | |
1583 | 1585 | | |
1584 | | - | |
1585 | | - | |
1586 | | - | |
1587 | | - | |
1588 | | - | |
1589 | | - | |
1590 | | - | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
1591 | 1602 | | |
1592 | | - | |
1593 | | - | |
1594 | 1603 | | |
1595 | 1604 | | |
1596 | 1605 | | |
| |||
Lines changed: 42 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
99 | 103 | | |
100 | 104 | | |
101 | 105 | | |
| |||
942 | 946 | | |
943 | 947 | | |
944 | 948 | | |
| 949 | + | |
945 | 950 | | |
946 | 951 | | |
947 | 952 | | |
948 | 953 | | |
949 | 954 | | |
950 | | - | |
| 955 | + | |
| 956 | + | |
951 | 957 | | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
952 | 975 | | |
953 | 976 | | |
954 | 977 | | |
955 | 978 | | |
956 | 979 | | |
957 | | - | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
958 | 987 | | |
959 | 988 | | |
960 | 989 | | |
| |||
1270 | 1299 | | |
1271 | 1300 | | |
1272 | 1301 | | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
1273 | 1313 | | |
1274 | 1314 | | |
1275 | 1315 | | |
| |||
Lines changed: 61 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
393 | 405 | | |
394 | 406 | | |
395 | 407 | | |
| |||
457 | 469 | | |
458 | 470 | | |
459 | 471 | | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
460 | 488 | | |
461 | 489 | | |
462 | 490 | | |
| |||
475 | 503 | | |
476 | 504 | | |
477 | 505 | | |
| 506 | + | |
478 | 507 | | |
479 | 508 | | |
480 | 509 | | |
| |||
960 | 989 | | |
961 | 990 | | |
962 | 991 | | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
963 | 1009 | | |
964 | 1010 | | |
965 | 1011 | | |
| |||
1070 | 1116 | | |
1071 | 1117 | | |
1072 | 1118 | | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
1073 | 1134 | | |
1074 | 1135 | | |
1075 | 1136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
341 | 346 | | |
342 | 347 | | |
343 | 348 | | |
| |||
0 commit comments