Skip to content
This repository was archived by the owner on Feb 2, 2021. It is now read-only.

Commit ef87c15

Browse files
Merge pull request #1001 from telerik/kerezov/liveync+debug
Extract some interfaces
2 parents 2287fd9 + 4a1f77e commit ef87c15

File tree

3 files changed

+18
-31
lines changed

3 files changed

+18
-31
lines changed

declarations.d.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -525,8 +525,11 @@ interface ISpawnFromEventOptions {
525525
}
526526
}
527527

528-
interface IProjectHelper {
528+
interface IProjectDir {
529529
projectDir: string;
530+
}
531+
532+
interface IProjectHelper extends IProjectDir {
530533
generateDefaultAppId(appName: string, baseAppId: string): string;
531534
sanitizeName(appName: string): string;
532535
}
@@ -931,8 +934,11 @@ interface ISyncBatch {
931934
syncFiles(syncAction: (filesToSync: string[]) => Promise<void>): Promise<void>;
932935
}
933936

934-
interface ILiveSyncData {
937+
interface IPlatform {
935938
platform: string;
939+
}
940+
941+
interface ILiveSyncData extends IPlatform {
936942
/** Application identifier */
937943
appIdentifier: string;
938944
/** The path to a directory that contains prepared project files for sync */
@@ -973,13 +979,11 @@ interface IDeviceLiveSyncService extends IDeviceLiveSyncServiceBase {
973979
afterInstallApplicationAction?(deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[]): Promise<boolean>;
974980
}
975981

976-
interface ISysInfoData {
982+
interface ISysInfoData extends IPlatform {
977983
/** name and version of the CLI app itself */
978984
procInfo: string;
979985

980986
// os stuff
981-
/** os platform flavour, reported by os.platform */
982-
platform: string;
983987
/** Full os name, like `uname -a` on unix, registry query on win */
984988
os: string;
985989
/** .net version, applicable to windows only */

definitions/mobile.d.ts

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ declare module Mobile {
77
/**
88
* Describes available information for a device.
99
*/
10-
interface IDeviceInfo {
10+
interface IDeviceInfo extends IPlatform {
1111
/**
1212
* Unique identifier of the device.
1313
*/
@@ -41,12 +41,6 @@ declare module Mobile {
4141
*/
4242
vendor: string;
4343

44-
/**
45-
* Device's platform.
46-
* Can be Android or iOS.
47-
*/
48-
platform: string;
49-
5044
/**
5145
* Status of device describing if you can work with this device or there's communication error.
5246
* Can be Connected or Unauthorized.
@@ -85,7 +79,9 @@ declare module Mobile {
8579
activeArchitecture?: string;
8680
}
8781

88-
interface IDeviceError extends Error {
82+
interface IDeviceError extends Error, IDeviceIdentifier { }
83+
84+
interface IDeviceIdentifier {
8985
deviceIdentifier: string;
9086
}
9187

@@ -113,10 +109,9 @@ declare module Mobile {
113109

114110
interface IiOSSimulator extends IDevice { }
115111

116-
interface IDeviceAppData {
112+
interface IDeviceAppData extends IPlatform {
117113
appIdentifier: string;
118114
device: Mobile.IDevice;
119-
platform: string;
120115
getDeviceProjectRootPath(): Promise<string>;
121116
deviceSyncZipPath?: string;
122117
isLiveSyncSupported(): Promise<boolean>;
@@ -360,12 +355,11 @@ declare module Mobile {
360355
skipEmulatorStart?: boolean;
361356
}
362357

363-
interface IDeviceActionResult<T> {
364-
deviceIdentifier: string;
358+
interface IDeviceActionResult<T> extends IDeviceIdentifier {
365359
result: T;
366360
}
367361

368-
interface IDevicesService extends NodeJS.EventEmitter {
362+
interface IDevicesService extends NodeJS.EventEmitter, IPlatform {
369363
hasDevices: boolean;
370364
deviceCount: number;
371365

@@ -391,7 +385,6 @@ declare module Mobile {
391385
* @return {void}
392386
*/
393387
addDeviceDiscovery(deviceDiscovery: IDeviceDiscovery): void;
394-
platform: string;
395388
getDevices(): Mobile.IDeviceInfo[];
396389

397390
/**
@@ -612,10 +605,9 @@ declare module Mobile {
612605
}
613606

614607
//todo: plamen5kov: this is a duplicate of an interface (IEmulatorInfo) fix after 3.0-RC nativescript-cli/lib/definitions/emulator-platform-service.d.ts
615-
interface IEmulatorInfo {
608+
interface IEmulatorInfo extends IPlatform {
616609
name: string;
617610
version: string;
618-
platform: string;
619611
id: string;
620612
type: string;
621613
isRunning?: boolean;
@@ -756,12 +748,7 @@ declare module Mobile {
756748
/**
757749
* Describes basic information about application on device.
758750
*/
759-
interface IDeviceApplicationInformationBase {
760-
/**
761-
* The device identifier.
762-
*/
763-
deviceIdentifier: string;
764-
751+
interface IDeviceApplicationInformationBase extends IDeviceIdentifier {
765752
/**
766753
* The application identifier.
767754
*/

mobile/ios/device/ios-application-manager.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,6 @@ export class IOSApplicationManager extends ApplicationManagerBase {
7676
}
7777

7878
public async startApplication(appIdentifier: string): Promise<void> {
79-
if (this.$hostInfo.isWindows && !this.$staticConfig.enableDeviceRunCommandOnWindows) {
80-
this.$errors.fail("$%s device run command is not supported on Windows for iOS devices.", this.$staticConfig.CLIENT_NAME.toLowerCase());
81-
}
82-
8379
if (!await this.isApplicationInstalled(appIdentifier)) {
8480
this.$errors.failWithoutHelp("Invalid application id: %s. All available application ids are: %s%s ", appIdentifier, EOL, this.applicationsLiveSyncInfos.join(EOL));
8581
}

0 commit comments

Comments
 (0)