| 48 | } |
| 49 | |
| 50 | export function getWorkspaceFilesystemLayout(workspaceKey: string): WorkspaceFilesystemLayout { |
| 51 | const normalizedWorkspaceKey = normalizeWorkspaceKey(workspaceKey); |
| 52 | const root = path.join(getWorkspacesDir(), normalizedWorkspaceKey); |
| 53 | const logs = path.join(root, 'logs'); |
| 54 | const state = path.join(root, 'state'); |
| 55 | const locks = path.join(root, 'locks'); |
| 56 | const derivedData = path.join(root, 'DerivedData'); |
| 57 | const resultBundles = path.join(root, 'result-bundles'); |
| 58 | |
| 59 | return { |
| 60 | workspaceKey: normalizedWorkspaceKey, |
| 61 | root, |
| 62 | logs, |
| 63 | state, |
| 64 | locks, |
| 65 | derivedData, |
| 66 | resultBundles, |
| 67 | logRetention: { |
| 68 | lockDir: path.join(locks, 'log-retention.lock'), |
| 69 | markerPath: path.join(state, 'log-retention', 'last-cleanup'), |
| 70 | }, |
| 71 | filesystemLifecycle: { |
| 72 | lockDir: path.join(locks, 'filesystem-lifecycle.lock'), |
| 73 | markerPath: path.join(state, 'filesystem-lifecycle', 'last-cleanup'), |
| 74 | }, |
| 75 | simulatorLaunchOsLogRegistryDir: path.join(state, 'simulator-launch-oslog'), |
| 76 | }; |
| 77 | } |
| 78 | |
| 79 | export function setXcodeBuildMCPAppDirOverrideForTests(dir: string | null): void { |
| 80 | appDirOverrideForTests = dir; |