[ 
https://issues.apache.org/jira/browse/CB-8954?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14555882#comment-14555882
 ] 

Vladimir Kotikov edited comment on CB-8954 at 5/22/15 9:29 AM:
---------------------------------------------------------------

[~timwindsor], this structure is placed in the platform's check_reqs code. In 
general, the platform code will return a Promise, resolved with array of 
{{Requirement}} objects, which defined as following:

{noformat}
/**
 * Object thar represents one of requirements for current platform.
 * @param {String} id         The unique identifier for this requirement.
 * @param {String} name       The name of requirements. Human-readable field.
 * @param {String} version    The version of requirement installed. In some 
cases could be an array of strings
 *                            (for example, check_android_target returns an 
array of android targets installed)
 * @param {Boolean} installed Indicates whether the reuirement is installed or 
not
 */
var Requirement = function (id, name, version, installed) {
    /* The unique identifier for this requirement */
    this.id = id;
    /* The name of requirements. Human-readable field */
    this.name = name;
    /* Indicates whether the reuirement is installed or not */
    this.installed = installed || false;
    this.metadata = {
        /* The version of requirement installed. In some cases could be an 
array of strings
           (for example, check_android_target returns an array of android 
targets installed) */
        version: version,
        /* Reason of failed check, should be a string with description, why 
check is failed,
           and, probably, the steps to resolve/install missing requirement */
        reason: undefined
    };
};
{noformat}


was (Author: vladimir.kotikov):
[~timwindsor], the place where this structure is placed - the platform's 
check_reqs code. In general, the platform code will return a Promise, resolved 
with array of {{Requirement}} objects, which defined as following:

{noformat}
/**
 * Object thar represents one of requirements for current platform.
 * @param {String} id         The unique identifier for this requirement.
 * @param {String} name       The name of requirements. Human-readable field.
 * @param {String} version    The version of requirement installed. In some 
cases could be an array of strings
 *                            (for example, check_android_target returns an 
array of android targets installed)
 * @param {Boolean} installed Indicates whether the reuirement is installed or 
not
 */
var Requirement = function (id, name, version, installed) {
    /* The unique identifier for this requirement */
    this.id = id;
    /* The name of requirements. Human-readable field */
    this.name = name;
    /* Indicates whether the reuirement is installed or not */
    this.installed = installed || false;
    this.metadata = {
        /* The version of requirement installed. In some cases could be an 
array of strings
           (for example, check_android_target returns an array of android 
targets installed) */
        version: version,
        /* Reason of failed check, should be a string with description, why 
check is failed,
           and, probably, the steps to resolve/install missing requirement */
        reason: undefined
    };
};
{noformat}

> Update platform check_reqs script to return structured result to 
> 'requirements' command
> ---------------------------------------------------------------------------------------
>
>                 Key: CB-8954
>                 URL: https://issues.apache.org/jira/browse/CB-8954
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android, iOS, Windows, WP8
>            Reporter: Vladimir Kotikov
>            Assignee: Vladimir Kotikov
>
> Since {{requirements}} LIB method assumes that underlying platform script 
> will be {{require}}d instead of spawning child process and capturing output, 
> we need to modify these scripts to provide method that will be called for 
> getting current requirements status.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to