Skip to content

Merge release in master pre 1.5.0 #1194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Nov 16, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/common
1 change: 1 addition & 0 deletions lib/definitions/plugins.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ interface IPluginVariablesService {
* @return {IFuture<string>} returns the changed plugin configuration file content.
*/
getPluginVariablePropertyName(pluginData: IPluginData): string;

}

interface IPluginVariableData {
Expand Down
7 changes: 2 additions & 5 deletions lib/services/ios-project-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -516,15 +516,12 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
let podTool = this.$config.USE_POD_SANDBOX ? "sandbox-pod" : "pod";
let childProcess = this.$childProcess.spawnFromEvent(podTool, ["install"], "close", { cwd: this.platformData.projectRoot, stdio: ['pipe', process.stdout, 'pipe'] }).wait();
if (childProcess.stderr) {
let warnings = childProcess.stderr.match(/(\u001b\[(?:\d*;){0,5}\d*m[\s\S]+?\u001b\[(?:\d*;){0,5}\d*m)|(\[!\].*?\n)/g);
let warnings = childProcess.stderr.match(/(\u001b\[(?:\d*;){0,5}\d*m[\s\S]+?\u001b\[(?:\d*;){0,5}\d*m)|(\[!\].*?\n)|(.*?warning.*)/gi);
_.each(warnings, (warning: string) => {
this.$logger.warnWithLabel(warning.replace("\n", ""));
});

// HACK for silencing irrelevant linking warnings when pod installing on
// El Capitan with cocoa pods version 0.38.2
// Reference https://github.com/CocoaPods/CocoaPods/issues/4302
let errors = childProcess.stderr.replace(/dyld: warning, LC_RPATH @executable_path.*?@executable_path/g, "");
let errors = childProcess.stderr;
_.each(warnings, warning => {
errors = errors.replace(warning, "");
});
Expand Down
17 changes: 15 additions & 2 deletions lib/services/platform-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,25 @@ export class PlatformService implements IPlatformService {
}).future<string[]>()();
}

@helpers.hook('prepare')
public preparePlatform(platform: string): IFuture<void> {
return (() => {
this.validatePlatform(platform);

//We need dev-dependencies here, so before-prepare hooks will be executed correctly.
try {
this.$pluginsService.ensureAllDependenciesAreInstalled().wait();
} catch(err) {
this.$logger.trace(err);
this.$errors.failWithoutHelp(`Unable to install dependencies. Make sure your package.json is valid and all dependencies are correct. Error is: ${err.message}`);
}

this.preparePlatformCore(platform).wait();
}).future<void>()();
}

@helpers.hook('prepare')
private preparePlatformCore(platform: string): IFuture<void> {
return (() => {
platform = platform.toLowerCase();
this.ensurePlatformInstalled(platform).wait();

Expand Down Expand Up @@ -214,7 +228,6 @@ export class PlatformService implements IPlatformService {
// Process node_modules folder
let appDir = path.join(platformData.appDestinationDirectoryPath, constants.APP_FOLDER_NAME);
try {
this.$pluginsService.ensureAllDependenciesAreInstalled().wait();
let tnsModulesDestinationPath = path.join(appDir, PlatformService.TNS_MODULES_FOLDER_NAME);
this.$broccoliBuilder.prepareNodeModules(tnsModulesDestinationPath, platform, lastModifiedTime).wait();
} catch(error) {
Expand Down
3 changes: 2 additions & 1 deletion lib/services/plugins-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ export class PluginsService implements IPluginsService {
return (() => {
let installedDependencies = this.$fs.exists(this.nodeModulesPath).wait() ? this.$fs.readDirectory(this.nodeModulesPath).wait() : [];
let packageJsonContent = this.$fs.readJson(this.getPackageJsonFilePath()).wait();
if(this.$options.force || (packageJsonContent.dependencies && _.difference(_.keys(packageJsonContent.dependencies), installedDependencies).length)) {
let allDependencies = _.keys(packageJsonContent.dependencies).concat(_.keys(packageJsonContent.devDependencies));
if(this.$options.force || _.difference(allDependencies, installedDependencies).length) {
let command = "npm install ";
if(this.$options.ignoreScripts) {
command += "--ignore-scripts";
Expand Down
9 changes: 6 additions & 3 deletions lib/services/usb-livesync-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ export class UsbLiveSyncService extends usbLivesyncServiceBaseLib.UsbLiveSyncSer

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

this.$projectDataService.initialize(this.$projectData.projectDir);
let frameworkVersion = this.$projectDataService.getValue(platformData.frameworkPackageName).wait().version;

if (platformLowerCase === this.$devicePlatformsConstants.Android.toLowerCase()) {
this.$projectDataService.initialize(this.$projectData.projectDir);
let frameworkVersion = this.$projectDataService.getValue(platformData.frameworkPackageName).wait().version;
if (semver.lt(frameworkVersion, "1.2.1")) {
let shouldUpdate = this.$prompter.confirm(
"You need Android Runtime 1.2.1 or later for LiveSync to work properly. Do you want to update your runtime now?"
Expand Down Expand Up @@ -139,6 +140,8 @@ export class UsbLiveSyncService extends usbLivesyncServiceBaseLib.UsbLiveSyncSer
return platformSpecificUsbLiveSyncService.sendPageReloadMessageToDevice(deviceAppData).wait();
});
}

this.$logger.info(`Successfully synced application ${this.$projectData.projectId}.`);
}).future<void>()();
});
};
Expand All @@ -156,7 +159,7 @@ export class UsbLiveSyncService extends usbLivesyncServiceBaseLib.UsbLiveSyncSer
beforeLiveSyncAction: beforeLiveSyncAction,
beforeBatchLiveSyncAction: beforeBatchLiveSyncAction,
iOSSimulatorRelativeToProjectBasePathAction: iOSSimulatorRelativeToProjectBasePathAction,
canExecuteFastLiveSync: (filePath: string) => _.contains(fastLivesyncFileExtensions, path.extname(filePath)),
canExecuteFastLiveSync: (filePath: string) => _.contains(fastLivesyncFileExtensions, path.extname(filePath)) && semver.gte(frameworkVersion, "1.5.0"),
fastLiveSync: fastLiveSync
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "nativescript",
"preferGlobal": true,
"version": "1.5.0",
"version": "1.6.0",
"author": "Telerik <[email protected]>",
"description": "Command-line interface for building NativeScript projects",
"bin": {
Expand Down