Commit ef87a2f
committed
feat(spm): support self-managed Package.swift under <dep>/ios/
Probe both <dep>/Package.swift and <dep>/ios/Package.swift so community RN
libraries can co-locate their hand-authored SPM manifest with their iOS
sources, keeping the npm-package root free of SPM artifacts (.build/,
.swiftpm/, Package.resolved).
- generate-spm-autolinking.js: replace local isSelfManagedPackage with a
module-scope findSelfManagedPackageDir that returns the actual manifest
directory. The aggregator's .package(path:) now points at the resolved
dir, so for the nested layout SPM resolves against <dep>/ios. Headers
tree still walks from the dep root so cross-package includes stay
complete. AUTOGEN_MARKER lifted to module scope and exported.
- scaffold-package-swift.js: skip-rule also probes <dep>/ios/Package.swift
so the scaffolder never writes a stray root manifest that would shadow
a hand-authored nested one.
- Tests: 6 findSelfManagedPackageDir cases (none / root / autogen-marker
rejection / nested-only / root-preferred / fallback-when-root-is-autogen)
plus 1 scaffolder case for the nested skip-rule. 222 spm tests pass.1 parent 49b13e8 commit ef87a2f
4 files changed
Lines changed: 175 additions & 22 deletions
File tree
- packages/react-native/scripts/spm
- __tests__
Lines changed: 78 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
657 | 659 | | |
658 | 660 | | |
659 | 661 | | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
470 | 470 | | |
471 | 471 | | |
472 | 472 | | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
473 | 493 | | |
474 | 494 | | |
475 | 495 | | |
| |||
Lines changed: 55 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
213 | 252 | | |
214 | 253 | | |
215 | 254 | | |
| |||
1123 | 1162 | | |
1124 | 1163 | | |
1125 | 1164 | | |
1126 | | - | |
1127 | | - | |
1128 | | - | |
1129 | | - | |
1130 | | - | |
1131 | | - | |
1132 | | - | |
1133 | | - | |
1134 | | - | |
1135 | | - | |
1136 | | - | |
1137 | | - | |
1138 | | - | |
1139 | | - | |
1140 | | - | |
1141 | | - | |
1142 | | - | |
1143 | | - | |
1144 | 1165 | | |
1145 | 1166 | | |
1146 | 1167 | | |
| |||
1173 | 1194 | | |
1174 | 1195 | | |
1175 | 1196 | | |
1176 | | - | |
1177 | | - | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
1178 | 1203 | | |
1179 | 1204 | | |
1180 | 1205 | | |
| |||
1188 | 1213 | | |
1189 | 1214 | | |
1190 | 1215 | | |
1191 | | - | |
| 1216 | + | |
1192 | 1217 | | |
1193 | 1218 | | |
1194 | 1219 | | |
| |||
1224 | 1249 | | |
1225 | 1250 | | |
1226 | 1251 | | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
1227 | 1256 | | |
| 1257 | + | |
| 1258 | + | |
1228 | 1259 | | |
1229 | 1260 | | |
1230 | | - | |
| 1261 | + | |
1231 | 1262 | | |
1232 | 1263 | | |
1233 | 1264 | | |
| |||
1473 | 1504 | | |
1474 | 1505 | | |
1475 | 1506 | | |
| 1507 | + | |
| 1508 | + | |
1476 | 1509 | | |
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
493 | 493 | | |
494 | 494 | | |
495 | 495 | | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
496 | 518 | | |
497 | 519 | | |
498 | 520 | | |
| |||
0 commit comments