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

Function printUsage

scripts/experimental/swiftui-preview.mjs:127–158  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

125}
126
127function printUsage() {
128 console.log(`Usage:
129 node scripts/experimental/swiftui-preview.mjs --udid <sim> --file <Preview.swift> [options]
130
131Options:
132 --preview <name-or-index> Select a #Preview block. Defaults to the first one.
133 --watch, -w Recompile and dlopen a new payload after file changes.
134 --extra-swift <file> Include another Swift file. Can be repeated.
135 --swiftc-arg <arg> Pass an extra argument to swiftc. Can be repeated.
136 --workspace <path> Use an Xcode workspace for compatibility mode.
137 --project <path> Use an Xcode project for compatibility mode.
138 --scheme <name> Xcode scheme to build for compatibility mode.
139 --configuration <name> Xcode configuration. Default: Debug.
140 --derived-data-path <path> DerivedData path for Xcode builds.
141 --skip-xcode-build Reuse existing Xcode build artifacts.
142 --skip-codesign Do not ad-hoc sign reload dylibs.
143 --profile Print reload-stage timings.
144 --split-compile Cache the preview source as a testable Swift module.
145 --bundle-id <id> Host bundle id. Default: ${DEFAULT_BUNDLE_ID}
146 --build-root <path> Build/cache directory. Default: .simdeck-preview/build
147 --rebuild-host Rebuild and reinstall the stable host app.
148
149This is intentionally experimental. It extracts simple #Preview { ... } bodies,
150builds them into a versioned simulator dylib, and asks a tiny host app to dlopen
151the new dylib without reinstalling the host.
152
153When --workspace/--project and --scheme are supplied, the runner builds the real
154app target once, copies its resources/frameworks into the host, and links reload
155dylibs against the target's Xcode-built debug dylib. That is the faster Xcode-ish
156path: reloads compile the edited preview source plus a tiny wrapper, not the full
157app target.`);
158}
159
160function buildHostApp(context, rebuildHost) {
161 const appPath = path.join(context.buildRoot, "SimDeckPreviewHost.app");

Callers 1

mainFunction · 0.85

Calls 1

logMethod · 0.80

Tested by

no test coverage detected