Skip to content

Merge release in master pre 1.5.0 (second time) and fix master #1208

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 19 commits into from
Nov 18, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
1407af7
Remove .ts from tns-core-modules package when moving it to platforms dir
rosen-vladimirov Nov 13, 2015
9d7a6b7
Merge pull request #1193 from NativeScript/vladimirov/report-android-…
rosen-vladimirov Nov 16, 2015
890cc8c
Fix doctor command
Nov 16, 2015
0cedf90
Merge pull request #1195 from NativeScript/fatme/fix-doctor
Nov 16, 2015
fed257f
Merge pull request #1189 from NativeScript/vladimirov/skip-d-ts-core-…
rosen-vladimirov Nov 16, 2015
358da57
Respect deleted files by livesync command
Nov 13, 2015
9e372a8
Merge pull request #1190 from NativeScript/fatme/respect-deleted-files
Nov 16, 2015
cae6c99
Check for devices before building the project
teobugslayer Nov 16, 2015
c8dea83
Merge pull request #1198 from NativeScript/totev/device-detection-first
teobugslayer Nov 16, 2015
7b3c843
Use emulator executable from ANDROID_HOME
rosen-vladimirov Nov 16, 2015
c16813e
Merge pull request #1201 from NativeScript/vladimirov/fix-emulator-start
rosen-vladimirov Nov 16, 2015
9f4667a
Fix getting of cocoapod version
rosen-vladimirov Nov 16, 2015
b888aa7
Merge pull request #1202 from NativeScript/vladimirov/fix-cocoapod-ve…
rosen-vladimirov Nov 17, 2015
6a12b0f
Release the console after livesync command and fix a typo.
Nov 16, 2015
c289ad6
Merge pull request #1196 from NativeScript/fatme/release-console
Nov 17, 2015
74da44f
Use npm api to install all project dependencies
Nov 17, 2015
dccee5e
Merge pull request #1205 from NativeScript/fatme/npm-install-using-api
Nov 17, 2015
740d895
Merge branch 'release' into vladimirov/merge-rel-master-pre-150-2
rosen-vladimirov Nov 18, 2015
5e85672
Require `messages` in bootstrap
rosen-vladimirov Nov 18, 2015
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
1 change: 1 addition & 0 deletions lib/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,4 @@ $injector.require("iOSNotificationService", "./services/ios-notification-service
$injector.require("socketProxyFactory", "./device-sockets/ios/socket-proxy-factory");
$injector.require("iOSNotification", "./device-sockets/ios/notification");
$injector.require("iOSSocketRequestExecutor", "./device-sockets/ios/socket-request-executor");
$injector.require("messages", "./messages");
13 changes: 10 additions & 3 deletions lib/services/doctor-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,22 @@ class DoctorService implements IDoctorService {
result = true;
}

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

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

if (sysInfo.cocoapodVer && semver.valid(sysInfo.cocoapodVer) && semver.lt(sysInfo.cocoapodVer, DoctorService.MIN_SUPPORTED_POD_VERSION)) {
this.$logger.warn(`WARNING: CocoaPods version is lower than ${DoctorService.MIN_SUPPORTED_POD_VERSION}.`);
this.$logger.out("You will not be able to build your projects for iOS if they contain plugin with CocoaPod file." + EOL
+ `To be able to build such projects, verify that you have at least ${DoctorService.MIN_SUPPORTED_POD_VERSION} version installed.`);
result = true;
Expand Down
1 change: 0 additions & 1 deletion lib/services/init-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export class InitService implements IInitService {
private _projectFilePath: string;

constructor(private $fs: IFileSystem,
private $errors: IErrors,
private $logger: ILogger,
private $options: IOptions,
private $injector: IInjector,
Expand Down
6 changes: 5 additions & 1 deletion lib/services/platform-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,11 @@ export class PlatformService implements IPlatformService {
this.ensurePlatformInstalled(platform).wait();
let platformData = this.$platformsData.getPlatformData(platform);

this.$devicesService.initialize({platform: platform, deviceId: this.$options.device}).wait();
if (this.$devicesService.deviceCount < 1) {
this.$errors.failWithoutHelp("Cannot find connected devices. Reconnect any connected devices, verify that your system recognizes them, and run this command again.");
}

let cachedDeviceOption = this.$options.forDevice;
this.$options.forDevice = true;
this.buildPlatform(platform, buildConfig).wait();
Expand All @@ -344,7 +349,6 @@ export class PlatformService implements IPlatformService {
let packageFile = this.getLatestApplicationPackageForDevice(platformData).wait().packageName;
this.$logger.out("Using ", packageFile);

this.$devicesService.initialize({platform: platform, deviceId: this.$options.device}).wait();
let action = (device: Mobile.IDevice): IFuture<void> => {
return (() => {
platformData.platformProjectService.deploy(device.deviceInfo.identifier).wait();
Expand Down
6 changes: 1 addition & 5 deletions lib/services/plugins-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,7 @@ export class PluginsService implements IPluginsService {
let packageJsonContent = this.$fs.readJson(this.getPackageJsonFilePath()).wait();
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";
}
this.$childProcess.exec(command, { cwd: this.$projectData.projectDir }).wait();
this.$npm.install(this.$projectData.projectDir, this.$projectData.projectDir, { "ignore-scripts": this.$options.ignoreScripts }).wait();
}
}).future<void>()();
}
Expand Down
25 changes: 24 additions & 1 deletion lib/services/usb-livesync-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,14 @@ export class IOSUsbLiveSyncService implements IiOSUsbLiveSyncService {
return this.$iOSEmulatorServices.postDarwinNotification(this.$iOSNotification.attachRequest);
}

public removeFile(appIdentifier: string, localToDevicePaths: Mobile.ILocalToDevicePathData[]): IFuture<void> {
return (() => {
_.each(localToDevicePaths, localToDevicePathData => {
this.device.fileSystem.deleteFile(localToDevicePathData.getDevicePath(), appIdentifier);
});
}).future<void>()();
}

private sendPageReloadMessage(socket: net.Socket): void {
try {
this.sendPageReloadMessageCore(socket);
Expand Down Expand Up @@ -265,7 +273,7 @@ export class AndroidUsbLiveSyncService extends androidLiveSyncServiceLib.Android

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

public removeFile(appIdentifier: string, localToDevicePaths: Mobile.ILocalToDevicePathData[]): IFuture<void> {
return (() => {
let deviceRootPath = this.getDeviceRootPath(appIdentifier);
_.each(localToDevicePaths, localToDevicePathData => {
let relativeUnixPath = _.trimLeft(helpers.fromWindowsRelativePathToUnix(localToDevicePathData.getRelativeToProjectBasePath()), "/");
let deviceFilePath = this.$mobileHelper.buildDevicePath(deviceRootPath, "removedsync", relativeUnixPath);
this.device.adb.executeShellCommand(["mkdir", "-p", path.dirname(deviceFilePath), "&&", "touch", deviceFilePath]).wait();
});
}).future<void>()();
}

private getDeviceRootPath(appIdentifier: string): string {
return `/data/local/tmp/${appIdentifier}`;
}

private sendPageReloadMessage(): IFuture<void> {
let future = new Future<void>();

Expand Down
8 changes: 8 additions & 0 deletions lib/tools/broccoli/node-modules-dest-copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import * as semver from "semver";
import * as shelljs from "shelljs";
import {wrapBroccoliPlugin} from './broccoli-plugin-wrapper-factory';
import * as constants from "../../constants";
import * as minimatch from "minimatch";
import Future = require("fibers/future");

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

if (dependency.name === constants.TNS_CORE_MODULES_NAME) {
let tnsCoreModulesResourcePath = path.join(this.outputRoot, constants.TNS_CORE_MODULES_NAME);

// Remove .ts files
let allFiles = this.$fs.enumerateFilesInDirectorySync(tnsCoreModulesResourcePath);
let deleteFilesFutures = allFiles.filter(file => minimatch(file, "**/*.ts", {nocase: true})).map(file => this.$fs.deleteFile(file));
Future.wait(deleteFilesFutures);

shelljs.cp("-Rf", path.join(tnsCoreModulesResourcePath, "*"), this.outputRoot);
this.$fs.deleteDirectory(tnsCoreModulesResourcePath).wait();
}
Expand Down