cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Cordova Wiki] Update of "CommandLineToolingDesign" by FilMaj
Date Tue, 02 Apr 2013 18:24:31 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Cordova Wiki" for change notification.

The "CommandLineToolingDesign" page has been changed by FilMaj:
http://wiki.apache.org/cordova/CommandLineToolingDesign?action=diff&rev1=9&rev2=10

Comment:
Added details about exit codes, renamed deploy commands to install.

         |-run
         `-lib
            |-start-emulator
-           |-deploy-device
+           |-install-device
-           |-deploy-emulator
+           |-install-emulator
            |-list-devices
            |-list-emulator-images
            `-list-started-emulators
@@ -22, +22 @@

  
  Anything that is necessary for a platform's basic CLI tooling (e.g. `ApplicationInfo` on
Android) can be placed under `cordova/lib`.
  
- Any scripts that are not implementable for certain platforms should simply exit with a non-zero
exit code / error out.
+ = Errors =
+ 
+ The following exit codes should be considered standard:
+ 
+  * 1: not implemented / unsupported command
+  * 2: generic runtime error. Hopefully accompanied with `stderr` output.
  
  = Specification =
  
@@ -37, +42 @@

  Several commands require determining a single target out of a potential for multiple targets.
These scripts are:
  
   * `run`
-  * the `deploy` sub-scripts
+  * the `install` sub-scripts
   * `start-emulator`
   * `log`
  
- The flow for determining a single target out of many is as follows. Note that the distinction
between emulator and device may not be applicable for certain commands (i.e. `deploy-device`
should not look at emulators, and the converse case for `deploy-emulator`).
+ The flow for determining a single target out of many is as follows. Note that the distinction
between emulator and device may not be applicable for certain commands (i.e. `install-device`
should not look at emulators, and the converse case for `install-emulator`).
  
   1. Are there any actual devices available? (use `list-devices` to determine this). If so,
target the first one. If no, continue.
   2. Are there any actual emulators available, i.e. started/running? (use `list-started-emulators`
to determine this). If so, target the first one. If no, continue.
   3. Are there any emulator images available to start? (use `list-emulator-images` to determine
this). If so, call `start-emulator <id>` of the first available image, wait for it to
become ready, then target it. If no, continue.
-  4. Fail horribly.
+  4. Fail horribly, and exit with code 2.
  
  == `clean` ==
  
@@ -86, +91 @@

      build [--debug] [--release]
  }}}
  
- Builds the application and compiles to the platform's appropriate binary format. By default
builds a debug release (`--debug`), but supports building a release (possibly signed) build
using `--release` as well. Implicitly calls `clean` first.
+ Builds the application and compiles to the platform's appropriate binary format. By default
builds a debug release (`--debug`), but supports building a release (possibly signed) build
using `--release` as well. Implicitly calls `clean` first. If both `--release` and `--debug`
are specified, error out with exit code 2 and an appropriate error message.
  
  Current implementations:
  
@@ -99, +104 @@

   * {X} WP7
   * {X} WP8
  
- {{{#!wiki caution
- '''Outstanding Issues'''
- 
- For the `build` command
- }}}
- 
-  * What happens when a user specifies both `--debug` and `--release`?
- 
  == `run` ==
  
  {{{
      run [--target=<id>]
  }}}
  
- Deploys a build of the app to an available device or emulator. If `--target` is specified,
attempts to deploy the app to the device or emulator identified by `<id>`. If the attempt
fails, the script will error out. If no `--target` is specified, follows the multi-device
flow as detailed above. Implicitly calls `build` first.
+ Deploys a build of the app to an available device or emulator. If `--target` is specified,
attempts to deploy the app to the device or emulator identified by `<id>`. If the attempt
fails, the script will error out with code 2. If no `--target` is specified, follows the multi-device
flow as detailed above. Implicitly calls `build` first.
  
  Current implementations:
  
@@ -129, +126 @@

  
  === `list-emulator-images` ===
  
- Lists out available emulator image IDs. Its main use is passing into `start-emulator`. The
script should print out, at a minimum, one emulator ID per line. If a description of the emulator
image is available, each line should be in the form `ID: DESCRIPTION`.
+ Lists out available emulator image IDs. Its main use is passing into `start-emulator`. The
script should print out, at a minimum, one emulator ID per line. If a description of the emulator
image is available, each line should be in the form `ID DESCRIPTION`. Other tooling can then
use the first space as a delimiter.
  
   * {X} Not Implemented
   * /!\ Android: rudimentary support (can use `android list avd` and parse that).
  
  === `list-started-emulators` ===
  
- Lists out running emulators. The script should print out, at a minimum, one emulator ID
per line. If a description of the running emulator is available, each line should be in the
form `ID: DESCRIPTION`.
+ Lists out running emulators. The script should print out, at a minimum, one emulator ID
per line. If a description of the running emulator is available, each line should be in the
form `ID DESCRIPTION`. Other tooling can then use the first space as a delimiter.
  
   * {X} Not Implemented
   * /!\ Android: rudimentary support available
  
  === `list-devices` ===
  
- Lists out attached/connected devices. The script should print out, at a minimum, one device
ID per line. If a description of the device is available, each line should be in the form
`ID: DESCRIPTION`.
+ Lists out attached/connected devices. The script should print out, at a minimum, one device
ID per line. If a description of the device is available, each line should be in the form
`ID DESCRIPTION`. Other tooling can then use the first space as a delimiter.
  
   * {X} Not Implemented
   * (./) Android (`adb devices`)
  
- === `deploy-emulator` ===
+ === `install-emulator` ===
  
  {{{
-     deploy-emulator [--target=id]
+     install-emulator [--target=id]
  }}}
  
- Deploys a build of the app to an available emulator. If `--target` is specified, attempts
to deploy the app to the emulator identified by `<id>`. If the attempt fails, the script
will error out. If no `--target` is specified, follows the multi-device flow as detailed above
(but only for emulators).
+ Installs a build of the app to an available emulator. If `--target` is specified, attempts
to install the app to the emulator identified by `<id>`. If the attempt fails, the script
will error out. If no `--target` is specified, follows the multi-device flow as detailed above
(but only for emulators). If the application is not compiled/built yet, the script will error
out and exit with code 2.
  
   * (./) Android
   * (./) iOS
@@ -162, +159 @@

   * {X} WP7
   * {X} WP8
  
- === `deploy-device` ===
+ === `install-device` ===
  
  {{{
-     deploy-device [--target=id]
+     install-device [--target=id]
  }}}
  
- Deploys a build of the app to an available device. If `--target` is specified, attempts
to deploy the app to the device identified by `<id>`. If the attempt fails, the script
will error out. If no `--target` is specified, follows the multi-device flow as detailed above
(but only for devices).
+ Installs a build of the app to an available device. If `--target` is specified, attempts
to install the app to the device identified by `<id>`. If the attempt fails, the script
will error out. If no `--target` is specified, follows the multi-device flow as detailed above
(but only for devices). If the application is not compiled/built yet, the script will error
out and exit with code 2.
  
   * (./) Android
   * (./) iOS
@@ -182, +179 @@

      start-emulator [id]
  }}}
  
- Starts an emulator image. If `id` is specified, will attempt to start the emulator image
with the specified ID, or, if not available or unable to start, errors out. If no `id` is
specified, it will try to start the first available emulator. If no emulator images are available,
it will error out.
+ Starts an emulator image. If `id` is specified, will attempt to start the emulator image
with the specified ID, or, if not available or unable to start, errors out. If no `id` is
specified, it will try to start the first available emulator. If no emulator images are available,
it will error out and exit with code 2.
  
   * (./) Android
   * (./) iOS

Mime
View raw message