microsoft/vscode-react-native

Public

mirrored from https://github.com/microsoft/vscode-react-nativeAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
8b2be31e754e9f0cdcb9f30d07d7b34dc181dcc7

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/debugger/platformResolver.ts

35lines · modeblame

a31b007cunknown10 years ago1// 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 ago4import {IRunOptions} from "../common/launchArgs";
bc7a32ceJimmy Thomson10 years ago5import * as IOSPlatform from "./ios/iOSPlatform";
6import * as AndroidPlatform from "./android/androidPlatform";
fb2bae06Daniel10 years ago7
65ee84c9unknown10 years ago8/**
9* Contains all the mobile platform specific debugging operations.
10*/
f8d32439dlebu10 years ago11export interface IAppPlatform {
7be1388cdigeff10 years ago12runApp(): Q.Promise<void>;
13enableJSDebuggingMode(): Q.Promise<void>;
65ee84c9unknown10 years ago14}
15
f5ea0577unknown10 years ago16export class PlatformResolver {
65ee84c9unknown10 years ago17
f5ea0577unknown10 years ago18/**
19* Resolves the mobile application target platform.
20*/
7be1388cdigeff10 years ago21public resolveMobilePlatform(mobilePlatformString: string, runOptions: IRunOptions): IAppPlatform {
f5ea0577unknown10 years ago22switch (mobilePlatformString) {
23// We lazyly load the strategies, because some components might be
24// missing on some platforms (like XCode in Windows)
25case "ios":
bc7a32ceJimmy Thomson10 years ago26let ios: typeof IOSPlatform = require("./ios/iOSPlatform");
7be1388cdigeff10 years ago27return new ios.IOSPlatform(runOptions);
f5ea0577unknown10 years ago28case "android":
bc7a32ceJimmy Thomson10 years ago29let android: typeof AndroidPlatform = require("./android/androidPlatform");
7be1388cdigeff10 years ago30return new android.AndroidPlatform(runOptions);
f5ea0577unknown10 years ago31default:
3af9a124unknown10 years ago32return null;
f5ea0577unknown10 years ago33}
34}
35}