( context, sanitizedPath, sourceModule, args, xcode, )
| 482 | } |
| 483 | |
| 484 | function compilePreviewSourceModule( |
| 485 | context, |
| 486 | sanitizedPath, |
| 487 | sourceModule, |
| 488 | args, |
| 489 | xcode, |
| 490 | ) { |
| 491 | if ( |
| 492 | fs.existsSync(sourceModule.objectPath) && |
| 493 | fs.existsSync(sourceModule.modulePath) |
| 494 | ) { |
| 495 | return; |
| 496 | } |
| 497 | fs.mkdirSync(sourceModule.directory, { recursive: true }); |
| 498 | run("xcrun", [ |
| 499 | "--sdk", |
| 500 | "iphonesimulator", |
| 501 | "swiftc", |
| 502 | "-target", |
| 503 | context.target, |
| 504 | "-sdk", |
| 505 | context.sdkPath, |
| 506 | "-parse-as-library", |
| 507 | "-Onone", |
| 508 | "-enable-testing", |
| 509 | "-emit-module", |
| 510 | "-emit-module-path", |
| 511 | sourceModule.modulePath, |
| 512 | "-emit-object", |
| 513 | "-module-name", |
| 514 | sourceModule.moduleName, |
| 515 | "-framework", |
| 516 | "SwiftUI", |
| 517 | "-framework", |
| 518 | "UIKit", |
| 519 | ...xcodeSwiftcArgs(xcode), |
| 520 | sanitizedPath, |
| 521 | ...arrayArg(args.swiftcArg), |
| 522 | "-o", |
| 523 | sourceModule.objectPath, |
| 524 | ]); |
| 525 | } |
| 526 | |
| 527 | async function sendTcpReloadPath(context, dylibPath) { |
| 528 | const containerPath = appContainerPath(context); |
no test coverage detected