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

Function collectXcodeObjectFiles

scripts/experimental/swiftui-preview.mjs:884–913  ·  view source on GitHub ↗
(settings, arch)

Source from the content-addressed store, hash-verified

882}
883
884function collectXcodeObjectFiles(settings, arch) {
885 const roots = [
886 settings.OBJECT_FILE_DIR_normal,
887 settings.TARGET_TEMP_DIR,
888 settings.OBJECT_FILE_DIR,
889 ].filter(Boolean);
890 const files = new Set();
891 for (const root of roots) {
892 if (fs.existsSync(root)) {
893 for (const file of walkFiles(root)) {
894 if (file.endsWith(".o") && objectFileMatchesArchPath(file, arch)) {
895 files.add(file);
896 }
897 }
898 }
899 }
900 const list = [...files].filter(
901 (file) => !file.includes("SimDeckPreviewPayload"),
902 );
903 if (list.length === 0) {
904 console.warn(
905 "[simdeck-preview] warning: no Xcode object files found; compatibility will be limited.",
906 );
907 } else {
908 console.log(
909 `[simdeck-preview] found ${list.length} Xcode object files for fallback linking`,
910 );
911 }
912 return list;
913}
914
915function objectFileMatchesArchPath(file, arch) {
916 const normalized = file.split(path.sep).join("/");

Callers 1

resolveXcodeContextFunction · 0.85

Calls 4

walkFilesFunction · 0.85
warnMethod · 0.80
logMethod · 0.80

Tested by

no test coverage detected