1
- import options = require( "./../common/options" ) ;
2
1
import iOSProxyServices = require( "./../common/mobile/ios/ios-proxy-services" ) ;
3
2
import iOSDevice = require( "./../common/mobile/ios/ios-device" ) ;
4
3
import net = require( "net" ) ;
@@ -54,28 +53,29 @@ class IOSDebugService implements IDebugService {
54
53
private $fs : IFileSystem ,
55
54
private $errors : IErrors ,
56
55
private $injector : IInjector ,
57
- private $npm : INodePackageManager ) {
56
+ private $npm : INodePackageManager ,
57
+ private $options : IOptions ) {
58
58
}
59
59
60
60
get platform ( ) : string {
61
61
return "ios" ;
62
62
}
63
63
64
64
public debug ( ) : IFuture < void > {
65
- if ( ( ! options . debugBrk && ! options . start ) || ( options . debugBrk && options . start ) ) {
65
+ if ( ( ! this . $ options. debugBrk && ! this . $ options. start ) || ( this . $ options. debugBrk && this . $ options. start ) ) {
66
66
this . $errors . failWithoutHelp ( "Expected exactly one of the --debug-brk or --start options." ) ;
67
67
}
68
68
69
- if ( options . emulator ) {
70
- if ( options . debugBrk ) {
69
+ if ( this . $ options. emulator ) {
70
+ if ( this . $ options. debugBrk ) {
71
71
return this . emulatorDebugBrk ( ) ;
72
- } else if ( options . start ) {
72
+ } else if ( this . $ options. start ) {
73
73
return this . emulatorStart ( ) ;
74
74
}
75
75
} else {
76
- if ( options . debugBrk ) {
76
+ if ( this . $ options. debugBrk ) {
77
77
return this . deviceDebugBrk ( ) ;
78
- } else if ( options . start ) {
78
+ } else if ( this . $ options. start ) {
79
79
return this . deviceStart ( ) ;
80
80
}
81
81
}
@@ -107,7 +107,7 @@ class IOSDebugService implements IDebugService {
107
107
108
108
private deviceDebugBrk ( ) : IFuture < void > {
109
109
return ( ( ) => {
110
- this . $devicesServices . initialize ( { platform : this . platform , deviceId : options . device } ) . wait ( ) ;
110
+ this . $devicesServices . initialize ( { platform : this . platform , deviceId : this . $ options. device } ) . wait ( ) ;
111
111
this . $devicesServices . execute ( device => ( ( ) => {
112
112
this . $platformService . deployOnDevice ( this . platform ) . wait ( ) ;
113
113
@@ -121,7 +121,7 @@ class IOSDebugService implements IDebugService {
121
121
122
122
private deviceStart ( ) : IFuture < void > {
123
123
return ( ( ) => {
124
- this . $devicesServices . initialize ( { platform : this . platform , deviceId : options . device } ) . wait ( ) ;
124
+ this . $devicesServices . initialize ( { platform : this . platform , deviceId : this . $ options. device } ) . wait ( ) ;
125
125
this . $devicesServices . execute ( device => ( ( ) => {
126
126
var iosDevice = < iOSDevice . IOSDevice > device ;
127
127
createWebSocketProxy ( this . $logger , ( callback ) => connectEventually ( ( ) => iosDevice . connectToPort ( InspectorBackendPort ) , callback ) ) ;
@@ -131,7 +131,7 @@ class IOSDebugService implements IDebugService {
131
131
}
132
132
133
133
public executeOpenDebuggerClient ( ) : IFuture < void > {
134
- if ( options . client === false ) {
134
+ if ( this . $ options. client === false ) {
135
135
// NOTE: The --no-client has been specified. Otherwise its either false or undefined.
136
136
return ( ( ) => {
137
137
this . $logger . info ( "Supressing debugging client." ) ;
@@ -151,11 +151,11 @@ class IOSDebugService implements IDebugService {
151
151
private getSafariPath ( ) : IFuture < string > {
152
152
return ( ( ) => {
153
153
var tnsIosPackage = "" ;
154
- if ( options . frameworkPath ) {
155
- if ( this . $fs . getFsStats ( options . frameworkPath ) . wait ( ) . isFile ( ) ) {
154
+ if ( this . $ options. frameworkPath ) {
155
+ if ( this . $fs . getFsStats ( this . $ options. frameworkPath ) . wait ( ) . isFile ( ) ) {
156
156
this . $errors . failWithoutHelp ( "frameworkPath option must be path to directory which contains tns-ios framework" ) ;
157
157
}
158
- tnsIosPackage = path . resolve ( options . frameworkPath ) ;
158
+ tnsIosPackage = path . resolve ( this . $ options. frameworkPath ) ;
159
159
} else {
160
160
var platformData = this . $platformsData . getPlatformData ( this . platform ) ;
161
161
tnsIosPackage = this . $npm . install ( platformData . frameworkPackageName ) . wait ( ) ;
0 commit comments