Skip to content

Commit a1869ae

Browse files
FatmeFatme
Fatme
authored and
Fatme
committed
Merge pull request #438 from NativeScript/fatme/merge-release-0.10.0-in-master
Merge release 0.10.0
2 parents 7949c2d + 0e270cf commit a1869ae

File tree

12 files changed

+47
-23
lines changed

12 files changed

+47
-23
lines changed

README.md

+5-6
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,10 @@ export PATH=${PATH}:/ant/apache-ant-1.9.4/bin:/Applications/Android Studio.app/s
165165
> On Linux systems, you can develop, build, and deploy NativeScript projects that target Android.
166166
167167
* Ubuntu 14.04 LTS
168-
* [Node.js 0.10.26][Node.js 0.10.26] or a later stable official release<br/>If installed via `sudo apt-get install`, use the `nodejs-legacy` package.
168+
* [Node.js 0.10.26][Node.js 0.10.26] or a later stable official release
169169

170-
```Shell
171-
sudo apt-get install nodejs-legacy
172-
```
170+
> **TIP:** You can follow the instructions provided [here](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager) to install Node.js on your system.
171+
173172
* G++ compiler
174173

175174
```Shell
@@ -245,9 +244,9 @@ Quick Start
245244

246245
## The Commands
247246

248-
Run `tns help` to list all available commands. Run or `tns <Command> --help` to view more information about a selected command.
247+
Run `tns help` to view all available commands in the browser. Run `tns help <Command>` to view more information about a selected command in the browser.
249248

250-
* `help` lists all available commands.
249+
* `help` opens a new browser window and lists all available commands.
251250
* `create <App Name> [--path <Directory>] [--appid <App ID>] [--copy-from <Directory>]` creates a new project with the specified settings.
252251
* `platform list` lists the current target platforms for your project.
253252
* `platform add <Platform>` adds a new target platform to your project.

docs/man_pages/general/help.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ Usage | Synopsis
55
------|-------
66
General | `$ tns help [<Command>]`
77

8-
Lists the available commands or shows information about the selected command.
8+
Opens the command reference for all commands in your browser or shows information about the selected command in the browser.
9+
10+
To list all commands in the console, run `$ tns -h`
11+
To print information about a selected command in the console, run `$ tns <Command> -h`
912

1013
### Attributes
11-
* `<Command>` is any of the available commands as listed by `$ tns help`
14+
* `<Command>` is any of the available commands as listed by `$ tns help` or `$ tns -h`
1215

1316
<% if(isHtml) { %>
1417
### Related Commands

docs/man_pages/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Alias | `$ nativescript <Command> [Command Parameters] [--command <Options>]`
99

1010
Command | Description
1111
-------|----------
12-
[help `<Command>`](general/help.html) | Shows additional information about the commands in this list.
12+
[help `<Command>`](general/help.html) | Shows additional information about the commands in this list in the browser.
1313
[autocomplete](general/autocomplete.html) | Configures your current command-line completion settings.
1414
[feature-usage-tracking](general/feature-usage-tracking.html) | Configures anonymous feature usage tracking.
1515

@@ -40,7 +40,7 @@ Command | Description
4040
## Global Options
4141
Option | Description
4242
-------|---------
43-
--help, -h, /? | Prints help about the current command.
43+
--help, -h, /? | Prints help about the selected command in the console.
4444
--path `<Directory>` | Specifies the directory that contains the project. If not set, the project is searched for in the current directory and all directories above it.
4545
--version | Prints the client version.
4646
--log trace | Prints a detailed diagnostic log for the execution of the current command.

docs/man_pages/project/testing/emulate-android.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ emulate android
33

44
Usage | Synopsis
55
---|---
6-
Run in the native emulator | `$ tns emulate android [--avd <Name>] [--path <Directory>] [--timeout <Seconds>] [--keyStorePath <File Path> --keyStorePassword <Password> --keyStoreAlias <Name> --keyStoreAliasPassword <Password>] [--release]`
7-
Run in Genymotion | `$ tns emulate android --geny <GenyName> [--path <Directory>] [--timeout <Seconds>] [--keyStorePath <File Path> --keyStorePassword <Password> --keyStoreAlias <Name> --keyStoreAliasPassword <Password>] [--release]`
8-
Run in the default Android virtual device or in a currently running emulator | `$ tns emulate android [--path <Directory>] [--timeout <Seconds>] [--keyStorePath <File Path> --keyStorePassword <Password> --keyStoreAlias <Name> --keyStoreAliasPassword <Password>] [--release]`
6+
Run in the native emulator | `$ tns emulate android [--avd <Name>] [--path <Directory>] [--timeout <Seconds>] [--keyStorePath <File Path> --keyStorePassword <Password> --keyStoreAlias <Name> --keyStoreAliasPassword <Password>] [--release] [--justlaunch]`
7+
Run in Genymotion | `$ tns emulate android --geny <GenyName> [--path <Directory>] [--timeout <Seconds>] [--keyStorePath <File Path> --keyStorePassword <Password> --keyStoreAlias <Name> --keyStoreAliasPassword <Password>] [--release] [--justlaunch]`
8+
Run in the default Android virtual device or in a currently running emulator | `$ tns emulate android [--path <Directory>] [--timeout <Seconds>] [--keyStorePath <File Path> --keyStorePassword <Password> --keyStoreAlias <Name> --keyStoreAliasPassword <Password>] [--release] [--justlaunch]`
99

1010
Builds the specified project and runs it in the native emulator from the Android SDK or Genymotion. <% if(isHtml) { %>If you do not select an Android virtual device (AVD) with the `--avd` option or a Genymotion virtual device with the `--geny` option, your app runs in the default AVD or a currently running emulator, if any. <% } %>
1111

@@ -19,6 +19,7 @@ Builds the specified project and runs it in the native emulator from the Android
1919
* `--keyStorePassword` - Provides the password for the keystore file specified with --keyStorePath. You can use the `--keyStore*` options along with --release to produce a signed release build. You need to specify all `--keyStore*` options.
2020
* `--keyStoreAlias` - Provides the alias for the keystore file specified with `--keyStorePath`. You can use the `--keyStore*` options along with `--release` to produce a signed release build. You need to specify all `--keyStore*` options.
2121
* `--keyStoreAliasPassword` - Provides the password for the alias specified with `--keStoreAliasPassword`. You can use the `--keyStore*` options along with `--release` to produce a signed release build. You need to specify all `--keyStore*` options.
22+
* `--justlaunch` - If set, does not print application output on the console. Otherwise prints the application output on the console.
2223

2324
### Attributes
2425
* `<Name>` is the name of the Android virtual device that you want to use as listed by `$ android list avd`

docs/man_pages/project/testing/run-android.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ run android
33

44
Usage | Synopsis
55
---|---
6-
Run on all connected devices and running emulators | `$ tns run android [--keyStorePath <File Path> --keyStorePassword <Password> --keyStoreAlias <Name> --keyStoreAliasPassword <Password>] [--release]`
7-
Run on a selected connected device or running emulator | `$ tns run android --device <Device ID> [--keyStorePath <File Path> --keyStorePassword <Password> --keyStoreAlias <Name> --keyStoreAliasPassword <Password>] [--release]`
8-
Start an emulator and run the app inside it | `$ tns run android --emulator [<Emulator Options>] [--keyStorePath <File Path> --keyStorePassword <Password> --keyStoreAlias <Name> --keyStoreAliasPassword <Password>] [--release]`
6+
Run on all connected devices and running emulators | `$ tns run android [--keyStorePath <File Path> --keyStorePassword <Password> --keyStoreAlias <Name> --keyStoreAliasPassword <Password>] [--release] [--justlaunch]`
7+
Run on a selected connected device or running emulator | `$ tns run android --device <Device ID> [--keyStorePath <File Path> --keyStorePassword <Password> --keyStoreAlias <Name> --keyStoreAliasPassword <Password>] [--release] [--justlaunch]`
8+
Start an emulator and run the app inside it | `$ tns run android --emulator [<Emulator Options>] [--keyStorePath <File Path> --keyStorePassword <Password> --keyStoreAlias <Name> --keyStoreAliasPassword <Password>] [--release] [--justlaunch]`
99

1010
Runs your project on a connected Android device or in a native Android emulator, if configured. This is shorthand for prepare, build and deploy.
1111

@@ -17,6 +17,7 @@ Runs your project on a connected Android device or in a native Android emulator,
1717
* `--keyStorePassword` - Provides the password for the keystore file specified with `--keyStorePath`. You can use the `--keyStore*` options along with `--release` to produce a signed release build. You need to specify all `--keyStore*` options.
1818
* `--keyStoreAlias` - Provides the alias for the keystore file specified with `--keyStorePath`. You can use the `--keyStore*` options along with `--release` to produce a signed release build. You need to specify all `--keyStore*` options.
1919
* `--keyStoreAliasPassword` - Provides the password for the alias specified with `--keStoreAliasPassword`. You can use the `--keyStore*` options along with `--release` to produce a signed release build. You need to specify all `--keyStore*` options.
20+
* `--justlaunch` - If set, does not print application output on the console. Otherwise prints the application output on the console.
2021

2122
### Attributes
2223
* `<Device ID>` is the index or name of the target device as listed by `$ tns device android`

docs/man_pages/project/testing/run-ios.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ run ios
33

44
Usage | Synopsis
55
---|---
6-
Run on all connected devices | `$ tns run ios [--release]`
7-
Run on a selected connected device | `$ tns run ios [--device <Device ID>] [--release]`
6+
Run on all connected devices | `$ tns run ios [--release] [--justlaunch]`
7+
Run on a selected connected device | `$ tns run ios [--device <Device ID>] [--release] [--justlaunch]`
88
Start an emulator and run the app inside it | `$ tns run ios --emulator [<Emulator Options>] [--release]`
99

1010
Runs your project on a connected iOS device or in the iOS Simulator, if configured. This is shorthand for prepare, build, and deploy.
@@ -17,6 +17,7 @@ Runs your project on a connected iOS device or in the iOS Simulator, if configur
1717
* `--device` - Specifies a connected device on which to run the app.
1818
* `--emulator` - If set, runs the app in a native emulator for the target platform, if configured. When set, you can also set any other valid combination of emulator options as listed by `$ tns help emulate ios`. You cannot use `--device` and `--emulator` simultaneously.
1919
* `--release` - If set, produces a release build. Otherwise, produces a debug build.
20+
* `--justlaunch` - If set, does not print application output on the console. Otherwise prints the application output on the console.
2021

2122
### Attributes
2223
* `<Device ID>` is the index or name of the target device as listed by `$ tns device ios`

lib/bootstrap.ts

+2
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,5 @@ $injector.require("optionsService", "./services/options-service");
4949
$injector.require("dynamicHelpProvider", "./dynamic-help-provider");
5050
$injector.require("mobilePlatformsCapabilities", "./mobile-platforms-capabilities");
5151
$injector.require("commandsServiceProvider", "./providers/commands-service-provider");
52+
53+
$injector.require("logcatPrinter", "./providers/logcat-printer");

lib/providers/logcat-printer.ts

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

lib/services/platform-service.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ export class PlatformService implements IPlatformService {
1818
private $platformsData: IPlatformsData,
1919
private $projectData: IProjectData,
2020
private $projectDataService: IProjectDataService,
21-
private $prompter: IPrompter) { }
21+
private $prompter: IPrompter,
22+
private $commandsService: ICommandsService) { }
2223

2324
public addPlatforms(platforms: string[]): IFuture<void> {
2425
return (() => {
@@ -190,7 +191,6 @@ export class PlatformService implements IPlatformService {
190191
return (() => {
191192
platform = platform.toLowerCase();
192193

193-
this.preparePlatform(platform).wait();
194194
if (options.emulator) {
195195
this.deployOnEmulator(platform).wait();
196196
} else {
@@ -242,7 +242,7 @@ export class PlatformService implements IPlatformService {
242242
this.$devicesServices.initialize({platform: platform, deviceId: options.device}).wait();
243243
var action = (device: Mobile.IDevice): IFuture<void> => { return device.deploy(packageFile, this.$projectData.projectId); };
244244
this.$devicesServices.execute(action).wait();
245-
245+
this.$commandsService.tryExecuteCommand("device", ["run", this.$projectData.projectId]).wait();
246246
}).future<void>()();
247247
}
248248

test/platform-commands.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ function createTestInjector() {
9999
testInjector.register("commandsServiceProvider", {
100100
registerDynamicSubCommands: () => {}
101101
});
102-
102+
testInjector.register("commandsService", {
103+
tryExecuteCommand: () => {}
104+
});
103105

104106
return testInjector;
105107
}

test/platform-service.ts

+3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ function createTestInjector() {
3838
testInjector.register('projectDataService', stubs.ProjectDataService);
3939
testInjector.register('prompter', {});
4040
testInjector.register('lockfile', stubs.LockFile);
41+
testInjector.register("commandsService", {
42+
tryExecuteCommand: () => {}
43+
});
4144

4245
return testInjector;
4346
}

0 commit comments

Comments
 (0)