Skip to content

Commit 740d895

Browse files
Merge branch 'release' into vladimirov/merge-rel-master-pre-150-2
Conflicts: lib/common
2 parents 6abe032 + dccee5e commit 740d895

File tree

7 files changed

+49
-12
lines changed

7 files changed

+49
-12
lines changed

lib/services/doctor-service.ts

+10-3
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,22 @@ class DoctorService implements IDoctorService {
4545
result = true;
4646
}
4747

48-
if(!sysInfo.cocoapodVer ) {
48+
if(!sysInfo.cocoapodVer) {
4949
this.$logger.warn("WARNING: CocoaPod is not installed or is not configured properly.");
5050
this.$logger.out("You will not be able to build your projects for iOS if they contain plugin with CocoaPod file." + EOL
5151
+ "To be able to build such projects, verify that you have installed CocoaPod.");
5252
result = true;
5353
}
5454

55-
if(sysInfo.cocoapodVer && semver.lt(sysInfo.cocoapodVer, DoctorService.MIN_SUPPORTED_POD_VERSION)) {
56-
this.$logger.warn(`WARNING: CocoaPods version is lower than ${DoctorService.MIN_SUPPORTED_POD_VERSION}`);
55+
if (sysInfo.cocoapodVer && semver.valid(sysInfo.cocoapodVer) === null) {
56+
this.$logger.warn(`WARNING: CocoaPods version is not a valid semver version.`);
57+
this.$logger.out("You will not be able to build your projects for iOS if they contain plugin with CocoaPod file." + EOL
58+
+ `To be able to build such projects, verify that you have at least ${DoctorService.MIN_SUPPORTED_POD_VERSION} version installed.`);
59+
result = true;
60+
}
61+
62+
if (sysInfo.cocoapodVer && semver.valid(sysInfo.cocoapodVer) && semver.lt(sysInfo.cocoapodVer, DoctorService.MIN_SUPPORTED_POD_VERSION)) {
63+
this.$logger.warn(`WARNING: CocoaPods version is lower than ${DoctorService.MIN_SUPPORTED_POD_VERSION}.`);
5764
this.$logger.out("You will not be able to build your projects for iOS if they contain plugin with CocoaPod file." + EOL
5865
+ `To be able to build such projects, verify that you have at least ${DoctorService.MIN_SUPPORTED_POD_VERSION} version installed.`);
5966
result = true;

lib/services/init-service.ts

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export class InitService implements IInitService {
1616
private _projectFilePath: string;
1717

1818
constructor(private $fs: IFileSystem,
19-
private $errors: IErrors,
2019
private $logger: ILogger,
2120
private $options: IOptions,
2221
private $injector: IInjector,

lib/services/platform-service.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,11 @@ export class PlatformService implements IPlatformService {
335335
this.ensurePlatformInstalled(platform).wait();
336336
let platformData = this.$platformsData.getPlatformData(platform);
337337

338+
this.$devicesService.initialize({platform: platform, deviceId: this.$options.device}).wait();
339+
if (this.$devicesService.deviceCount < 1) {
340+
this.$errors.failWithoutHelp("Cannot find connected devices. Reconnect any connected devices, verify that your system recognizes them, and run this command again.");
341+
}
342+
338343
let cachedDeviceOption = this.$options.forDevice;
339344
this.$options.forDevice = true;
340345
this.buildPlatform(platform, buildConfig).wait();
@@ -344,7 +349,6 @@ export class PlatformService implements IPlatformService {
344349
let packageFile = this.getLatestApplicationPackageForDevice(platformData).wait().packageName;
345350
this.$logger.out("Using ", packageFile);
346351

347-
this.$devicesService.initialize({platform: platform, deviceId: this.$options.device}).wait();
348352
let action = (device: Mobile.IDevice): IFuture<void> => {
349353
return (() => {
350354
platformData.platformProjectService.deploy(device.deviceInfo.identifier).wait();

lib/services/plugins-service.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,7 @@ export class PluginsService implements IPluginsService {
162162
let packageJsonContent = this.$fs.readJson(this.getPackageJsonFilePath()).wait();
163163
let allDependencies = _.keys(packageJsonContent.dependencies).concat(_.keys(packageJsonContent.devDependencies));
164164
if(this.$options.force || _.difference(allDependencies, installedDependencies).length) {
165-
let command = "npm install ";
166-
if(this.$options.ignoreScripts) {
167-
command += "--ignore-scripts";
168-
}
169-
this.$childProcess.exec(command, { cwd: this.$projectData.projectDir }).wait();
165+
this.$npm.install(this.$projectData.projectDir, this.$projectData.projectDir, { "ignore-scripts": this.$options.ignoreScripts }).wait();
170166
}
171167
}).future<void>()();
172168
}

lib/services/usb-livesync-service.ts

+24-1
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,14 @@ export class IOSUsbLiveSyncService implements IiOSUsbLiveSyncService {
217217
return this.$iOSEmulatorServices.postDarwinNotification(this.$iOSNotification.attachRequest);
218218
}
219219

220+
public removeFile(appIdentifier: string, localToDevicePaths: Mobile.ILocalToDevicePathData[]): IFuture<void> {
221+
return (() => {
222+
_.each(localToDevicePaths, localToDevicePathData => {
223+
this.device.fileSystem.deleteFile(localToDevicePathData.getDevicePath(), appIdentifier);
224+
});
225+
}).future<void>()();
226+
}
227+
220228
private sendPageReloadMessage(socket: net.Socket): void {
221229
try {
222230
this.sendPageReloadMessageCore(socket);
@@ -265,7 +273,7 @@ export class AndroidUsbLiveSyncService extends androidLiveSyncServiceLib.Android
265273

266274
public beforeLiveSyncAction(deviceAppData: Mobile.IDeviceAppData): IFuture<void> {
267275
return (() => {
268-
let deviceRootPath = `/data/local/tmp/${deviceAppData.appIdentifier}`;
276+
let deviceRootPath = this.getDeviceRootPath(deviceAppData.appIdentifier);
269277
this.device.adb.executeShellCommand(["rm", "-rf", this.$mobileHelper.buildDevicePath(deviceRootPath, "fullsync"),
270278
this.$mobileHelper.buildDevicePath(deviceRootPath, "sync"),
271279
this.$mobileHelper.buildDevicePath(deviceRootPath, "removedsync")]).wait();
@@ -279,6 +287,21 @@ export class AndroidUsbLiveSyncService extends androidLiveSyncServiceLib.Android
279287
}).future<void>()();
280288
}
281289

290+
public removeFile(appIdentifier: string, localToDevicePaths: Mobile.ILocalToDevicePathData[]): IFuture<void> {
291+
return (() => {
292+
let deviceRootPath = this.getDeviceRootPath(appIdentifier);
293+
_.each(localToDevicePaths, localToDevicePathData => {
294+
let relativeUnixPath = _.trimLeft(helpers.fromWindowsRelativePathToUnix(localToDevicePathData.getRelativeToProjectBasePath()), "/");
295+
let deviceFilePath = this.$mobileHelper.buildDevicePath(deviceRootPath, "removedsync", relativeUnixPath);
296+
this.device.adb.executeShellCommand(["mkdir", "-p", path.dirname(deviceFilePath), "&&", "touch", deviceFilePath]).wait();
297+
});
298+
}).future<void>()();
299+
}
300+
301+
private getDeviceRootPath(appIdentifier: string): string {
302+
return `/data/local/tmp/${appIdentifier}`;
303+
}
304+
282305
private sendPageReloadMessage(): IFuture<void> {
283306
let future = new Future<void>();
284307

lib/tools/broccoli/node-modules-dest-copy.ts

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import * as semver from "semver";
77
import * as shelljs from "shelljs";
88
import {wrapBroccoliPlugin} from './broccoli-plugin-wrapper-factory';
99
import * as constants from "../../constants";
10+
import * as minimatch from "minimatch";
11+
import Future = require("fibers/future");
1012

1113
/**
1214
* Intercepts each directory as it is copied to the destination tempdir,
@@ -79,6 +81,12 @@ export class DestCopy implements IBroccoliPlugin {
7981

8082
if (dependency.name === constants.TNS_CORE_MODULES_NAME) {
8183
let tnsCoreModulesResourcePath = path.join(this.outputRoot, constants.TNS_CORE_MODULES_NAME);
84+
85+
// Remove .ts files
86+
let allFiles = this.$fs.enumerateFilesInDirectorySync(tnsCoreModulesResourcePath);
87+
let deleteFilesFutures = allFiles.filter(file => minimatch(file, "**/*.ts", {nocase: true})).map(file => this.$fs.deleteFile(file));
88+
Future.wait(deleteFilesFutures);
89+
8290
shelljs.cp("-Rf", path.join(tnsCoreModulesResourcePath, "*"), this.outputRoot);
8391
this.$fs.deleteDirectory(tnsCoreModulesResourcePath).wait();
8492
}

0 commit comments

Comments
 (0)