MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / splitWrapperCompileArgs

Function splitWrapperCompileArgs

scripts/experimental/swiftui-preview.mjs:411–448  ·  view source on GitHub ↗
(
  context,
  stamp,
  wrapperPath,
  dylibPath,
  sourceModule,
  args,
  xcode,
  sourceFile,
)

Source from the content-addressed store, hash-verified

409}
410
411function splitWrapperCompileArgs(
412 context,
413 stamp,
414 wrapperPath,
415 dylibPath,
416 sourceModule,
417 args,
418 xcode,
419 sourceFile,
420) {
421 return [
422 "--sdk",
423 "iphonesimulator",
424 "swiftc",
425 "-target",
426 context.target,
427 "-sdk",
428 context.sdkPath,
429 "-parse-as-library",
430 "-Onone",
431 "-emit-library",
432 "-module-name",
433 `SimDeckPreviewPayload_${stamp.replaceAll("-", "_")}`,
434 "-I",
435 sourceModule.directory,
436 "-framework",
437 "SwiftUI",
438 "-framework",
439 "UIKit",
440 ...xcodeSwiftcArgs(xcode),
441 wrapperPath,
442 sourceModule.objectPath,
443 ...xcodeObjectFiles(xcode, sourceFile),
444 ...arrayArg(args.swiftcArg),
445 "-o",
446 dylibPath,
447 ];
448}
449
450function previewSourceModule(context, sanitizedSource, args, xcode) {
451 const extraSwift = arrayArg(args.extraSwift);

Callers 1

reloadPreviewFunction · 0.85

Calls 3

xcodeSwiftcArgsFunction · 0.85
xcodeObjectFilesFunction · 0.85
arrayArgFunction · 0.85

Tested by

no test coverage detected