Skip to content

Commit 696a28b

Browse files
Merge pull request #1131 from NativeScript/vladimirov/integrate-proton-branch
Integrate latest common changes
2 parents 107a3ac + ed5b883 commit 696a28b

15 files changed

+44
-41
lines changed

lib/bootstrap.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ $injector.require("mobilePlatformsCapabilities", "./mobile-platforms-capabilitie
6161
$injector.require("commandsServiceProvider", "./providers/commands-service-provider");
6262
$injector.require("deviceAppDataProvider", "./providers/device-app-data-provider");
6363

64-
$injector.require("logcatPrinter", "./providers/logcat-printer");
64+
$injector.require("deviceLogProvider", "./providers/device-log-provider");
6565

6666
$injector.require("broccoliBuilder", "./tools/broccoli/builder");
6767
$injector.require("nodeModulesTree", "./tools/broccoli/trees/node-modules-tree");

lib/config.ts

+4
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,9 @@ export class StaticConfig extends staticConfigBaseLibPath.StaticConfigBase imple
7373
public get pathToPackageJson(): string {
7474
return path.join(__dirname, "..", "package.json");
7575
}
76+
77+
public get PATH_TO_BOOTSTRAP() : string {
78+
return path.join(__dirname, "bootstrap");
79+
}
7680
}
7781
$injector.register("staticConfig", StaticConfig);

lib/nativescript-cli.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ require("./bootstrap");
44

55
import fiber = require("fibers");
66
import Future = require("fibers/future");
7-
import errors = require("./common/errors");
8-
errors.installUncaughtExceptionListener();
7+
import {installUncaughtExceptionListener} from "./common/errors";
8+
installUncaughtExceptionListener(process.exit);
99

1010
fiber(() => {
11-
let config = <Config.IConfig>$injector.resolve("$config");
12-
let err = <IErrors>$injector.resolve("$errors");
11+
let config: Config.IConfig = $injector.resolve("$config");
12+
let err: IErrors = $injector.resolve("$errors");
1313
err.printCallStack = config.DEBUG;
1414

1515
let commandDispatcher: ICommandDispatcher = $injector.resolve("commandDispatcher");

lib/providers/device-log-provider.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
///<reference path="../.d.ts"/>
2+
"use strict";
3+
4+
export class DeviceLogProvider implements Mobile.IDeviceLogProvider {
5+
constructor(private $logger: ILogger) { }
6+
7+
public logData(line: string, platform: string, deviceIdentifier: string): void {
8+
this.$logger.out(line);
9+
}
10+
}
11+
$injector.register("deviceLogProvider", DeviceLogProvider);

lib/providers/logcat-printer.ts

-12
This file was deleted.

lib/services/android-debug-service.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class AndroidDebugService implements IDebugService {
1212

1313
private _device: Mobile.IAndroidDevice = null;
1414

15-
constructor(private $devicesServices: Mobile.IDevicesServices,
15+
constructor(private $devicesService: Mobile.IDevicesService,
1616
private $platformService: IPlatformService,
1717
private $platformsData: IPlatformsData,
1818
private $projectData: IProjectData,
@@ -70,9 +70,9 @@ class AndroidDebugService implements IDebugService {
7070
this.$logger.out("Using ", packageFile);
7171
}
7272

73-
this.$devicesServices.initialize({ platform: this.platform, deviceId: this.$options.device}).wait();
73+
this.$devicesService.initialize({ platform: this.platform, deviceId: this.$options.device}).wait();
7474
let action = (device: Mobile.IAndroidDevice): IFuture<void> => { return this.debugCore(device, packageFile, this.$projectData.projectId); };
75-
this.$devicesServices.execute(action).wait();
75+
this.$devicesService.execute(action).wait();
7676

7777
}).future<void>()();
7878
}
@@ -141,12 +141,12 @@ class AndroidDebugService implements IDebugService {
141141

142142
public debugStart(): IFuture<void> {
143143
return (() => {
144-
this.$devicesServices.initialize({ platform: this.platform, deviceId: this.$options.device}).wait();
144+
this.$devicesService.initialize({ platform: this.platform, deviceId: this.$options.device}).wait();
145145
let action = (device: Mobile.IAndroidDevice): IFuture<void> => {
146146
this.device = device;
147147
return this.debugStartCore();
148148
};
149-
this.$devicesServices.execute(action).wait();
149+
this.$devicesService.execute(action).wait();
150150
}).future<void>()();
151151
}
152152

lib/services/ios-debug-service.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class IOSDebugService implements IDebugService {
6969
constructor(
7070
private $platformService: IPlatformService,
7171
private $iOSEmulatorServices: Mobile.IEmulatorPlatformServices,
72-
private $devicesServices: Mobile.IDevicesServices,
72+
private $devicesService: Mobile.IDevicesService,
7373
private $platformsData: IPlatformsData,
7474
private $projectData: IProjectData,
7575
private $childProcess: IChildProcess,
@@ -151,8 +151,8 @@ class IOSDebugService implements IDebugService {
151151

152152
private deviceDebugBrk(): IFuture<void> {
153153
return (() => {
154-
this.$devicesServices.initialize({ platform: this.platform, deviceId: this.$options.device }).wait();
155-
this.$devicesServices.execute((device: iOSDevice.IOSDevice) => (() => {
154+
this.$devicesService.initialize({ platform: this.platform, deviceId: this.$options.device }).wait();
155+
this.$devicesService.execute((device: iOSDevice.IOSDevice) => (() => {
156156
// we intentionally do not wait on this here, because if we did, we'd miss the AppLaunching notification
157157
let deploy = this.$platformService.deployOnDevice(this.platform);
158158
this.debugBrkCore(device).wait();
@@ -163,8 +163,8 @@ class IOSDebugService implements IDebugService {
163163

164164
public debugStart(): IFuture<void> {
165165
return (() => {
166-
this.$devicesServices.initialize({ platform: this.platform, deviceId: this.$options.device }).wait();
167-
this.$devicesServices.execute((device: iOSDevice.IOSDevice) => this.debugBrkCore(device)).wait();
166+
this.$devicesService.initialize({ platform: this.platform, deviceId: this.$options.device }).wait();
167+
this.$devicesService.execute((device: iOSDevice.IOSDevice) => this.debugBrkCore(device)).wait();
168168
}).future<void>()();
169169
}
170170

@@ -193,8 +193,8 @@ class IOSDebugService implements IDebugService {
193193

194194
private deviceStart(): IFuture<void> {
195195
return (() => {
196-
this.$devicesServices.initialize({ platform: this.platform, deviceId: this.$options.device }).wait();
197-
this.$devicesServices.execute(device => (() => {
196+
this.$devicesService.initialize({ platform: this.platform, deviceId: this.$options.device }).wait();
197+
this.$devicesService.execute(device => (() => {
198198
let iosDevice = <iOSDevice.IOSDevice>device;
199199
let projectId = this.$projectData.projectId;
200200
let npc = new iOSProxyServices.NotificationProxyClient(iosDevice, this.$injector);

lib/services/platform-service.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import * as semver from "semver";
1010
export class PlatformService implements IPlatformService {
1111
private static TNS_MODULES_FOLDER_NAME = "tns_modules";
1212

13-
constructor(private $devicesServices: Mobile.IDevicesServices,
13+
constructor(private $devicesService: Mobile.IDevicesService,
1414
private $errors: IErrors,
1515
private $fs: IFileSystem,
1616
private $logger: ILogger,
@@ -317,7 +317,7 @@ export class PlatformService implements IPlatformService {
317317
let packageFile = this.getLatestApplicationPackageForDevice(platformData).wait().packageName;
318318
this.$logger.out("Using ", packageFile);
319319

320-
this.$devicesServices.initialize({platform: platform, deviceId: this.$options.device}).wait();
320+
this.$devicesService.initialize({platform: platform, deviceId: this.$options.device}).wait();
321321
let action = (device: Mobile.IDevice): IFuture<void> => {
322322
return (() => {
323323
platformData.platformProjectService.deploy(device.deviceInfo.identifier).wait();
@@ -328,7 +328,7 @@ export class PlatformService implements IPlatformService {
328328
}
329329
}).future<void>()();
330330
};
331-
this.$devicesServices.execute(action).wait();
331+
this.$devicesService.execute(action).wait();
332332
}).future<void>()();
333333
}
334334

lib/services/usb-livesync-service.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class UsbLiveSyncService extends usbLivesyncServiceBaseLib.UsbLiveSyncSer
1313
"**/*.ts",
1414
];
1515

16-
constructor($devicesServices: Mobile.IDevicesServices,
16+
constructor($devicesService: Mobile.IDevicesService,
1717
$fs: IFileSystem,
1818
$mobileHelper: Mobile.IMobileHelper,
1919
$localToDevicePathDataFactory: Mobile.ILocalToDevicePathDataFactory,
@@ -31,7 +31,7 @@ export class UsbLiveSyncService extends usbLivesyncServiceBaseLib.UsbLiveSyncSer
3131
private $projectDataService: IProjectDataService,
3232
private $prompter: IPrompter,
3333
$hostInfo: IHostInfo) {
34-
super($devicesServices, $mobileHelper, $localToDevicePathDataFactory, $logger, $options,
34+
super($devicesService, $mobileHelper, $localToDevicePathDataFactory, $logger, $options,
3535
$deviceAppDataFactory, $fs, $dispatcher, $injector, $childProcess, $iOSEmulatorServices, $hostInfo);
3636
}
3737

@@ -72,7 +72,7 @@ export class UsbLiveSyncService extends usbLivesyncServiceBaseLib.UsbLiveSyncSer
7272
};
7373

7474
let beforeLiveSyncAction = (device: Mobile.IDevice, deviceAppData: Mobile.IDeviceAppData): IFuture<void> => {
75-
let platformSpecificUsbLiveSyncService = this.resolveUsbLiveSyncService(platform || this.$devicesServices.platform, device);
75+
let platformSpecificUsbLiveSyncService = this.resolveUsbLiveSyncService(platform || this.$devicesService.platform, device);
7676
if (platformSpecificUsbLiveSyncService.beforeLiveSyncAction) {
7777
return platformSpecificUsbLiveSyncService.beforeLiveSyncAction(deviceAppData);
7878
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"cli-table": "https://github.com/telerik/cli-table/tarball/v0.3.1.1",
3636
"colors": "1.1.2",
3737
"ffi": "https://github.com/icenium/node-ffi/tarball/v2.0.0.0",
38-
"fibers": "https://github.com/icenium/node-fibers/tarball/v1.0.6.1",
38+
"fibers": "https://github.com/icenium/node-fibers/tarball/v1.0.6.2",
3939
"filesize": "3.1.2",
4040
"gaze": "0.5.1",
4141
"gulp": "3.9.0",

test/npm-support.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function createTestInjector(): IInjector {
4444
testInjector.register("prompter", {});
4545
testInjector.register("androidProjectService", {});
4646
testInjector.register("iOSProjectService", {});
47-
testInjector.register("devicesServices", {});
47+
testInjector.register("devicesService", {});
4848
testInjector.register("resources", {});
4949
testInjector.register("projectData", ProjectDataLib.ProjectData);
5050
testInjector.register("projectHelper", ProjectHelperLib.ProjectHelper);

test/platform-commands.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function createTestInjector() {
9292
testInjector.register('npmInstallationManager', stubs.NpmInstallationManagerStub);
9393
testInjector.register('projectData', stubs.ProjectDataStub);
9494
testInjector.register('platformsData', PlatformsData);
95-
testInjector.register('devicesServices', {});
95+
testInjector.register('devicesService', {});
9696
testInjector.register('projectDataService', stubs.ProjectDataService);
9797
testInjector.register('prompter', {});
9898
testInjector.register('commands-service', CommandsServiceLib.CommandsService);

test/platform-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function createTestInjector() {
2525
testInjector.register('npmInstallationManager', stubs.NpmInstallationManagerStub);
2626
testInjector.register('projectData', stubs.ProjectDataStub);
2727
testInjector.register('platformsData', stubs.PlatformsDataStub);
28-
testInjector.register('devicesServices', {});
28+
testInjector.register('devicesService', {});
2929
testInjector.register('androidEmulatorServices', {});
3030
testInjector.register('projectDataService', stubs.ProjectDataService);
3131
testInjector.register('prompter', {});

test/plugins-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function createTestInjector() {
5151
testInjector.register("mobileHelper", {});
5252
testInjector.register("androidProjectService", AndroidProjectService);
5353
testInjector.register("iOSProjectService", {});
54-
testInjector.register("devicesServices", {});
54+
testInjector.register("devicesService", {});
5555
testInjector.register("projectDataService", ProjectDataService);
5656
testInjector.register("prompter", {});
5757
testInjector.register("resources", ResourceLoader);

0 commit comments

Comments
 (0)