@@ -165,7 +165,7 @@ export class PlatformService implements IPlatformService {
165165 public buildPlatform ( platform : string ) : IFuture < void > {
166166 return ( ( ) => {
167167 platform = platform . toLowerCase ( ) ;
168- this . preparePlatform ( platform ) ;
168+ this . preparePlatform ( platform ) . wait ( ) ;
169169
170170 var platformData = this . $platformsData . getPlatformData ( platform ) ;
171171 platformData . platformProjectService . buildProject ( platformData . projectRoot ) . wait ( ) ;
@@ -178,57 +178,57 @@ export class PlatformService implements IPlatformService {
178178 platform = platform . toLowerCase ( ) ;
179179
180180 this . preparePlatform ( platform ) . wait ( ) ;
181- if ( options . emulator ) {
181+ if ( options . emulator ) {
182182 this . deployOnEmulator ( platform ) . wait ( ) ;
183183 } else {
184184 this . deployOnDevice ( platform ) . wait ( ) ;
185185 }
186186 } ) . future < void > ( ) ( ) ;
187- }
187+ }
188188
189- public debugPlatform ( platform : string ) : IFuture < void > {
190- platform = platform . toLowerCase ( ) ;
189+ public debugPlatform ( platform : string ) : IFuture < void > {
190+ platform = platform . toLowerCase ( ) ;
191191
192- var ret = options . emulator
193- ? this . debugOnEmulator ( platform )
194- : this . debugOnDevice ( platform ) ;
195-
196- return ret ;
197- }
192+ var ret = options . emulator
193+ ? this . debugOnEmulator ( platform )
194+ : this . debugOnDevice ( platform ) ;
198195
199- public debugOnEmulator ( platform : string ) : IFuture < void > {
200- return ( ( ) => {
196+ return ret ;
197+ }
201198
202- // a bit redundant
203- this . deployOnEmulator ( platform ) . wait ( ) ;
199+ public debugOnEmulator ( platform : string ) : IFuture < void > {
200+ return ( ( ) => {
204201
205- this . debugOnDevice ( platform ) . wait ( ) ;
206- } ) . future < void > ( ) ( ) ;
207- }
202+ // a bit redundant
203+ this . deployOnEmulator ( platform ) . wait ( ) ;
208204
209- public debugOnDevice ( platform : string ) : IFuture < void > {
210- return ( ( ) => {
211- platform = platform . toLowerCase ( ) ;
205+ this . debugOnDevice ( platform ) . wait ( ) ;
206+ } ) . future < void > ( ) ( ) ;
207+ }
212208
213- var packageFile = "" ;
209+ public debugOnDevice ( platform : string ) : IFuture < void > {
210+ return ( ( ) => {
211+ platform = platform . toLowerCase ( ) ;
214212
215- if ( options [ "debug-brk" ] ) {
216- this . preparePlatform ( platform ) . wait ( ) ;
213+ var packageFile = "" ;
217214
218- var platformData = this . $platformsData . getPlatformData ( platform ) ;
215+ if ( options [ "debug-brk" ] ) {
216+ this . preparePlatform ( platform ) . wait ( ) ;
219217
220- this . buildPlatform ( platform ) . wait ( ) ;
218+ var platformData = this . $platformsData . getPlatformData ( platform ) ;
221219
222- packageFile = this . getLatestApplicationPackageForDevice ( platformData ) . wait ( ) . packageName ;
223- this . $logger . out ( "Using " , packageFile ) ;
224- }
220+ this . buildPlatform ( platform ) . wait ( ) ;
221+
222+ packageFile = this . getLatestApplicationPackageForDevice ( platformData ) . wait ( ) . packageName ;
223+ this . $logger . out ( "Using " , packageFile ) ;
224+ }
225225
226- this . $devicesServices . initialize ( { platform : platform , deviceId : options . device } ) . wait ( ) ;
227- var action = ( device : Mobile . IDevice ) : IFuture < void > => { return device . debug ( packageFile , this . $projectData . projectId ) ; } ;
228- this . $devicesServices . execute ( action ) . wait ( ) ;
226+ this . $devicesServices . initialize ( { platform : platform , deviceId : options . device } ) . wait ( ) ;
227+ var action = ( device : Mobile . IDevice ) : IFuture < void > => { return device . debug ( packageFile , this . $projectData . projectId ) ; } ;
228+ this . $devicesServices . execute ( action ) . wait ( ) ;
229229
230- } ) . future < void > ( ) ( ) ;
231- }
230+ } ) . future < void > ( ) ( ) ;
231+ }
232232
233233 public removePlatforms ( platforms : string [ ] ) : IFuture < void > {
234234 return ( ( ) => {
0 commit comments