Skip to content

Commit 78835ec

Browse files
Merge pull request #1194 from NativeScript/vladimirov/merge-release-in-master-pre-150
Merge release in master pre 1.5.0
2 parents c579ae8 + 5b2bc76 commit 78835ec

File tree

7 files changed

+28
-13
lines changed

7 files changed

+28
-13
lines changed

lib/common

lib/definitions/plugins.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ interface IPluginVariablesService {
5353
* @return {IFuture<string>} returns the changed plugin configuration file content.
5454
*/
5555
getPluginVariablePropertyName(pluginData: IPluginData): string;
56+
5657
}
5758

5859
interface IPluginVariableData {

lib/services/ios-project-service.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -516,15 +516,12 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
516516
let podTool = this.$config.USE_POD_SANDBOX ? "sandbox-pod" : "pod";
517517
let childProcess = this.$childProcess.spawnFromEvent(podTool, ["install"], "close", { cwd: this.platformData.projectRoot, stdio: ['pipe', process.stdout, 'pipe'] }).wait();
518518
if (childProcess.stderr) {
519-
let warnings = childProcess.stderr.match(/(\u001b\[(?:\d*;){0,5}\d*m[\s\S]+?\u001b\[(?:\d*;){0,5}\d*m)|(\[!\].*?\n)/g);
519+
let warnings = childProcess.stderr.match(/(\u001b\[(?:\d*;){0,5}\d*m[\s\S]+?\u001b\[(?:\d*;){0,5}\d*m)|(\[!\].*?\n)|(.*?warning.*)/gi);
520520
_.each(warnings, (warning: string) => {
521521
this.$logger.warnWithLabel(warning.replace("\n", ""));
522522
});
523523

524-
// HACK for silencing irrelevant linking warnings when pod installing on
525-
// El Capitan with cocoa pods version 0.38.2
526-
// Reference https://github.com/CocoaPods/CocoaPods/issues/4302
527-
let errors = childProcess.stderr.replace(/dyld: warning, LC_RPATH @executable_path.*?@executable_path/g, "");
524+
let errors = childProcess.stderr;
528525
_.each(warnings, warning => {
529526
errors = errors.replace(warning, "");
530527
});

lib/services/platform-service.ts

+15-2
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,25 @@ export class PlatformService implements IPlatformService {
154154
}).future<string[]>()();
155155
}
156156

157-
@helpers.hook('prepare')
158157
public preparePlatform(platform: string): IFuture<void> {
159158
return (() => {
160159
this.validatePlatform(platform);
161160

161+
//We need dev-dependencies here, so before-prepare hooks will be executed correctly.
162+
try {
163+
this.$pluginsService.ensureAllDependenciesAreInstalled().wait();
164+
} catch(err) {
165+
this.$logger.trace(err);
166+
this.$errors.failWithoutHelp(`Unable to install dependencies. Make sure your package.json is valid and all dependencies are correct. Error is: ${err.message}`);
167+
}
168+
169+
this.preparePlatformCore(platform).wait();
170+
}).future<void>()();
171+
}
172+
173+
@helpers.hook('prepare')
174+
private preparePlatformCore(platform: string): IFuture<void> {
175+
return (() => {
162176
platform = platform.toLowerCase();
163177
this.ensurePlatformInstalled(platform).wait();
164178

@@ -214,7 +228,6 @@ export class PlatformService implements IPlatformService {
214228
// Process node_modules folder
215229
let appDir = path.join(platformData.appDestinationDirectoryPath, constants.APP_FOLDER_NAME);
216230
try {
217-
this.$pluginsService.ensureAllDependenciesAreInstalled().wait();
218231
let tnsModulesDestinationPath = path.join(appDir, PlatformService.TNS_MODULES_FOLDER_NAME);
219232
this.$broccoliBuilder.prepareNodeModules(tnsModulesDestinationPath, platform, lastModifiedTime).wait();
220233
} catch(error) {

lib/services/plugins-service.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ export class PluginsService implements IPluginsService {
160160
return (() => {
161161
let installedDependencies = this.$fs.exists(this.nodeModulesPath).wait() ? this.$fs.readDirectory(this.nodeModulesPath).wait() : [];
162162
let packageJsonContent = this.$fs.readJson(this.getPackageJsonFilePath()).wait();
163-
if(this.$options.force || (packageJsonContent.dependencies && _.difference(_.keys(packageJsonContent.dependencies), installedDependencies).length)) {
163+
let allDependencies = _.keys(packageJsonContent.dependencies).concat(_.keys(packageJsonContent.devDependencies));
164+
if(this.$options.force || _.difference(allDependencies, installedDependencies).length) {
164165
let command = "npm install ";
165166
if(this.$options.ignoreScripts) {
166167
command += "--ignore-scripts";

lib/services/usb-livesync-service.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ export class UsbLiveSyncService extends usbLivesyncServiceBaseLib.UsbLiveSyncSer
4949

5050
let platformData = this.$platformsData.getPlatformData(platformLowerCase);
5151

52+
this.$projectDataService.initialize(this.$projectData.projectDir);
53+
let frameworkVersion = this.$projectDataService.getValue(platformData.frameworkPackageName).wait().version;
54+
5255
if (platformLowerCase === this.$devicePlatformsConstants.Android.toLowerCase()) {
53-
this.$projectDataService.initialize(this.$projectData.projectDir);
54-
let frameworkVersion = this.$projectDataService.getValue(platformData.frameworkPackageName).wait().version;
5556
if (semver.lt(frameworkVersion, "1.2.1")) {
5657
let shouldUpdate = this.$prompter.confirm(
5758
"You need Android Runtime 1.2.1 or later for LiveSync to work properly. Do you want to update your runtime now?"
@@ -139,6 +140,8 @@ export class UsbLiveSyncService extends usbLivesyncServiceBaseLib.UsbLiveSyncSer
139140
return platformSpecificUsbLiveSyncService.sendPageReloadMessageToDevice(deviceAppData).wait();
140141
});
141142
}
143+
144+
this.$logger.info(`Successfully synced application ${this.$projectData.projectId}.`);
142145
}).future<void>()();
143146
});
144147
};
@@ -156,7 +159,7 @@ export class UsbLiveSyncService extends usbLivesyncServiceBaseLib.UsbLiveSyncSer
156159
beforeLiveSyncAction: beforeLiveSyncAction,
157160
beforeBatchLiveSyncAction: beforeBatchLiveSyncAction,
158161
iOSSimulatorRelativeToProjectBasePathAction: iOSSimulatorRelativeToProjectBasePathAction,
159-
canExecuteFastLiveSync: (filePath: string) => _.contains(fastLivesyncFileExtensions, path.extname(filePath)),
162+
canExecuteFastLiveSync: (filePath: string) => _.contains(fastLivesyncFileExtensions, path.extname(filePath)) && semver.gte(frameworkVersion, "1.5.0"),
160163
fastLiveSync: fastLiveSync
161164
};
162165

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "nativescript",
33
"preferGlobal": true,
4-
"version": "1.5.0",
4+
"version": "1.6.0",
55
"author": "Telerik <[email protected]>",
66
"description": "Command-line interface for building NativeScript projects",
77
"bin": {

0 commit comments

Comments
 (0)