(params: InferPlatformParams)
| 111 | } |
| 112 | |
| 113 | function resolveCachedPlatform(params: InferPlatformParams): SimulatorPlatform | null { |
| 114 | const defaults = params.sessionDefaults ?? sessionStore.getAll(); |
| 115 | if (!isSimulatorPlatform(defaults.simulatorPlatform)) { |
| 116 | return null; |
| 117 | } |
| 118 | |
| 119 | const hasExplicitId = Boolean(params.simulatorId); |
| 120 | const hasExplicitName = Boolean(params.simulatorName); |
| 121 | |
| 122 | if (!hasExplicitId && !hasExplicitName) { |
| 123 | return defaults.simulatorPlatform; |
| 124 | } |
| 125 | |
| 126 | if (hasExplicitId && defaults.simulatorId && params.simulatorId === defaults.simulatorId) { |
| 127 | return defaults.simulatorPlatform; |
| 128 | } |
| 129 | |
| 130 | if ( |
| 131 | hasExplicitName && |
| 132 | defaults.simulatorName && |
| 133 | params.simulatorName === defaults.simulatorName |
| 134 | ) { |
| 135 | return defaults.simulatorPlatform; |
| 136 | } |
| 137 | |
| 138 | return null; |
| 139 | } |
| 140 | |
| 141 | function resolveProjectFromSession(params: InferPlatformParams): { |
| 142 | projectPath?: string; |
no test coverage detected