Skip to content

Commit a0d33d2

Browse files
committed
Remove unused method and interface.
1 parent b86a166 commit a0d33d2

File tree

4 files changed

+2
-58
lines changed

4 files changed

+2
-58
lines changed

lib/declarations.d.ts

-3
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,6 @@ interface IDeployPlatformOptions extends IAndroidReleaseOptions, IPlatformTempla
369369
forceInstall?: boolean;
370370
}
371371

372-
interface IEmulatePlatformOptions extends IJustLaunch, IDeployPlatformOptions, IAvailableDevices, IAvd {
373-
}
374-
375372
interface IUpdatePlatformOptions extends IPlatformTemplate {
376373
currentVersion: string;
377374
newVersion: string;

lib/definitions/platform.d.ts

-11
Original file line numberDiff line numberDiff line change
@@ -120,17 +120,6 @@ interface IPlatformService extends NodeJS.EventEmitter {
120120
*/
121121
startApplication(platform: string, runOptions: IRunPlatformOptions, projectId: string): Promise<void>;
122122

123-
/**
124-
* The emulate command. In addition to `run --emulator` command, it handles the `--available-devices` option to show the available devices.
125-
* @param {string} platform The platform to emulate.
126-
* @param {IAppFilesUpdaterOptions} appFilesUpdaterOptions Options needed to instantiate AppFilesUpdater class.
127-
* @param {IEmulatePlatformOptions} emulateOptions Various options that can manage the emulate operation.
128-
* @param {IProjectData} projectData DTO with information about the project.
129-
* @param {IAddPlatformCoreOptions} config Options required for project preparation/creation.
130-
* @returns {void}
131-
*/
132-
emulatePlatform(platform: string, appFilesUpdaterOptions: IAppFilesUpdaterOptions, emulateOptions: IEmulatePlatformOptions, projectData: IProjectData, config: IAddPlatformCoreOptions): Promise<void>;
133-
134123
cleanDestinationApp(platform: string, appFilesUpdaterOptions: IAppFilesUpdaterOptions, platformTemplate: string, projectData: IProjectData, config: IAddPlatformCoreOptions): Promise<void>;
135124
validatePlatformInstalled(platform: string, projectData: IProjectData): void;
136125

lib/services/platform-service.ts

+2-40
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,8 @@ export class PlatformService extends EventEmitter implements IPlatformService {
3838
private $npm: INodePackageManager,
3939
private $devicePlatformsConstants: Mobile.IDevicePlatformsConstants,
4040
private $deviceAppDataFactory: Mobile.IDeviceAppDataFactory,
41-
private $projectChangesService: IProjectChangesService,
42-
private $emulatorPlatformService: IEmulatorPlatformService,
43-
private $analyticsService: IAnalyticsService,
44-
private $messages: IMessages,
45-
private $staticConfig: Config.IStaticConfig) {
41+
private $projectChangesService: IProjectChangesService,
42+
private $analyticsService: IAnalyticsService) {
4643
super();
4744
}
4845

@@ -528,41 +525,6 @@ export class PlatformService extends EventEmitter implements IPlatformService {
528525
await this.$devicesService.execute(action, this.getCanExecuteAction(platform, runOptions));
529526
}
530527

531-
public async emulatePlatform(platform: string, appFilesUpdaterOptions: IAppFilesUpdaterOptions, emulateOptions: IEmulatePlatformOptions, projectData: IProjectData, config: IAddPlatformCoreOptions): Promise<void> {
532-
if (emulateOptions.avd) {
533-
this.$logger.warn(`Option --avd is no longer supported. Please use --device instead!`);
534-
return Promise.resolve();
535-
}
536-
537-
if (emulateOptions.availableDevices) {
538-
return this.$emulatorPlatformService.listAvailableEmulators(platform);
539-
}
540-
541-
if (emulateOptions.device) {
542-
let info = await this.$emulatorPlatformService.getEmulatorInfo(platform, emulateOptions.device);
543-
if (info) {
544-
if (!info.isRunning) {
545-
await this.$emulatorPlatformService.startEmulator(info, projectData);
546-
}
547-
548-
emulateOptions.device = null;
549-
} else {
550-
await this.$devicesService.initialize({ platform: platform, deviceId: emulateOptions.device });
551-
let found: Mobile.IDeviceInfo[] = [];
552-
if (this.$devicesService.hasDevices) {
553-
found = this.$devicesService.getDevices().filter((deviceInfo: Mobile.IDeviceInfo) => deviceInfo.identifier === emulateOptions.device);
554-
}
555-
556-
if (found.length === 0) {
557-
this.$errors.fail(this.$messages.Devices.NotFoundDeviceByIdentifierErrorMessage, this.$staticConfig.CLIENT_NAME.toLowerCase());
558-
}
559-
}
560-
}
561-
562-
await this.deployPlatform(platform, appFilesUpdaterOptions, emulateOptions, projectData, config);
563-
return this.startApplication(platform, emulateOptions, projectData.projectId);
564-
}
565-
566528
private getBuildOutputPath(platform: string, platformData: IPlatformData, options: IBuildForDevice): string {
567529
if (platform.toLowerCase() === this.$devicePlatformsConstants.iOS.toLowerCase()) {
568530
return options.buildForDevice ? platformData.deviceBuildOutputPath : platformData.emulatorBuildOutputPath;

test/stubs.ts

-4
Original file line numberDiff line numberDiff line change
@@ -653,10 +653,6 @@ export class PlatformServiceStub extends EventEmitter implements IPlatformServic
653653
return Promise.resolve();
654654
}
655655

656-
public emulatePlatform(platform: string, appFilesUpdaterOptions: IAppFilesUpdaterOptions, emulateOptions: IEmulatePlatformOptions): Promise<void> {
657-
return Promise.resolve();
658-
}
659-
660656
public cleanDestinationApp(platform: string, appFilesUpdaterOptions: IAppFilesUpdaterOptions, platformTemplate: string): Promise<void> {
661657
return Promise.resolve();
662658
}

0 commit comments

Comments
 (0)