microsoft/vscode-react-native
Publicmirrored from https://github.com/microsoft/vscode-react-nativeAvailable
src/debugger/platformResolver.ts
29lines · modeblame
a31b007cunknown10 years ago | 1 | // Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | // Licensed under the MIT license. See LICENSE file in the project root for details. | |
| 3 | | |
acf08bc2dlebu10 years ago | 4 | import {IRunOptions} from "../common/launchArgs"; |
52f3873ddigeff10 years ago | 5 | import {IOSPlatform} from "./ios/iOSPlatform"; |
| 6 | import {AndroidPlatform} from "../common/android/androidPlatform"; | |
ac7fef0cPatricio Beltran9 years ago | 7 | import {GeneralMobilePlatform} from "../common/generalMobilePlatform"; |
1c32fe84Patricio Beltran9 years ago | 8 | import {ExponentPlatform} from "../common/exponent/exponentPlatform"; |
65ee84c9unknown10 years ago | 9 | |
f5ea0577unknown10 years ago | 10 | export class PlatformResolver { |
65ee84c9unknown10 years ago | 11 | |
f5ea0577unknown10 years ago | 12 | /** |
| 13 | * Resolves the mobile application target platform. | |
| 14 | */ | |
299b0557Patricio Beltran10 years ago | 15 | public resolveMobilePlatform(mobilePlatformString: string, runOptions: IRunOptions): GeneralMobilePlatform { |
f5ea0577unknown10 years ago | 16 | switch (mobilePlatformString) { |
| 17 | // We lazyly load the strategies, because some components might be | |
| 18 | // missing on some platforms (like XCode in Windows) | |
| 19 | case "ios": | |
52f3873ddigeff10 years ago | 20 | return new IOSPlatform(runOptions); |
f5ea0577unknown10 years ago | 21 | case "android": |
52f3873ddigeff10 years ago | 22 | return new AndroidPlatform(runOptions); |
1c32fe84Patricio Beltran9 years ago | 23 | case "exponent": |
| 24 | return new ExponentPlatform(runOptions); | |
f5ea0577unknown10 years ago | 25 | default: |
299b0557Patricio Beltran10 years ago | 26 | return new GeneralMobilePlatform(runOptions); |
f5ea0577unknown10 years ago | 27 | } |
| 28 | } | |
| 29 | } |