// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for details.
import {IRunOptions} from "../common/launchArgs";
import * as IOSPlatform from "./ios/iOSPlatform";
import * as AndroidPlatform from "./android/androidPlatform";
/**
* Contains all the mobile platform specific debugging operations.
*/
export interface IAppPlatform {
runApp(): Q.Promise<void>;
enableJSDebuggingMode(): Q.Promise<void>;
}
export class PlatformResolver {
/**
* Resolves the mobile application target platform.
*/
public resolveMobilePlatform(mobilePlatformString: string, runOptions: IRunOptions): IAppPlatform {
switch (mobilePlatformString) {
// We lazyly load the strategies, because some components might be
// missing on some platforms (like XCode in Windows)
case "ios":
let ios: typeof IOSPlatform = require("./ios/iOSPlatform");
return new ios.IOSPlatform(runOptions);
case "android":
let android: typeof AndroidPlatform = require("./android/androidPlatform");
return new android.AndroidPlatform(runOptions);
default:
return null;
}
}
}microsoft/vscode-react-native
Publicmirrored fromhttps://github.com/microsoft/vscode-react-nativeAvailable
src/debugger/platformResolver.ts
35lines · modepreview