( platform: PLATFORM, buildConfig: 'debug' | 'release' | undefined, architectures: Architecture[], forDevice: boolean, enableRuntimeLogs: boolean | undefined, enableRuntimeTracing: boolean | undefined, additionalBazelArgs: string | undefined, )
| 238 | } |
| 239 | |
| 240 | export function resolveBazelBuildArgs( |
| 241 | platform: PLATFORM, |
| 242 | buildConfig: 'debug' | 'release' | undefined, |
| 243 | architectures: Architecture[], |
| 244 | forDevice: boolean, |
| 245 | enableRuntimeLogs: boolean | undefined, |
| 246 | enableRuntimeTracing: boolean | undefined, |
| 247 | additionalBazelArgs: string | undefined, |
| 248 | ): string { |
| 249 | const allArgs: string[] = []; |
| 250 | |
| 251 | if (buildConfig === 'release') { |
| 252 | allArgs.push(...RELEASE_BUILD_FLAGS); |
| 253 | } else { |
| 254 | allArgs.push(...DEBUG_BUILD_FLAGS); |
| 255 | } |
| 256 | |
| 257 | if (enableRuntimeLogs) { |
| 258 | allArgs.push(...ENABLE_RUNTIME_LOGS_BUILD_FLAGS); |
| 259 | } |
| 260 | if (enableRuntimeTracing) { |
| 261 | allArgs.push(...ENABLE_RUNTIME_TRACES_BUILD_FLAGS); |
| 262 | } |
| 263 | |
| 264 | if (platform === PLATFORM.IOS) { |
| 265 | allArgs.push(IOS_BUILD_FLAGS); |
| 266 | |
| 267 | if (forDevice) { |
| 268 | allArgs.push(IOS_DEVICE_BUILD_FLAGS); |
| 269 | } |
| 270 | } |
| 271 | |
| 272 | if (platform === PLATFORM.CLI) { |
| 273 | allArgs.push(...CLI_BUILD_FLAGS); |
| 274 | } else if (platform === PLATFORM.MACOS) { |
| 275 | allArgs.push(...MACOS_BUILD_FLAGS); |
| 276 | } else if (platform === PLATFORM.LINUX) { |
| 277 | allArgs.push(...LINUX_BUILD_FLAGS); |
| 278 | } |
| 279 | |
| 280 | if (platform === PLATFORM.ANDROID) { |
| 281 | allArgs.push(...ANDROID_BUILD_FLAGS); |
| 282 | |
| 283 | for (const architecture of architectures) { |
| 284 | allArgs.push(...androidBuildFlagsForArchitecture(architecture)); |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | if (additionalBazelArgs) { |
| 289 | allArgs.push(additionalBazelArgs); |
| 290 | } |
| 291 | return allArgs.join(' '); |
| 292 | } |
no test coverage detected