Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 755AA18612 for ; Sat, 30 Jan 2016 02:41:41 +0000 (UTC) Received: (qmail 89080 invoked by uid 500); 30 Jan 2016 02:41:40 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 88991 invoked by uid 500); 30 Jan 2016 02:41:40 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 88638 invoked by uid 99); 30 Jan 2016 02:41:40 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 30 Jan 2016 02:41:40 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 731702C1F58 for ; Sat, 30 Jan 2016 02:41:40 +0000 (UTC) Date: Sat, 30 Jan 2016 02:41:40 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-10364) Make Plugin Specification (plugin.xml) page a reference MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-10364?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15124663#comment-15124663 ] ASF GitHub Bot commented on CB-10364: ------------------------------------- Github user riknoll commented on a diff in the pull request: https://github.com/apache/cordova-docs/pull/474#discussion_r51338764 --- Diff: www/docs/en/dev/plugin_ref/spec.md --- @@ -17,700 +17,489 @@ license: > specific language governing permissions and limitations under the License. -title: Plugin Specification +title: Plugin.xml --- -# Plugin Specification - -The `plugin.xml` file is an XML document in the `plugins` namespace: -`http://apache.org/cordova/ns/plugins/1.0`. It contains a top-level -`plugin` element that defines the plugin, and children that define the -structure of the plugin. - -A sample plugin element: +# Plugin.xml - - +Plugin.xml file defines the structure and settings required for your plugin. It has several elements to provide details about your plugin. -## _plugin_ Element +## plugin -The `plugin` element is the plugin manifest's top-level element. It -features the following attributes: + The `plugin` element is the plugin manifest's top-level element. -* `xmlns` (required): - The plugin namespace, `http://apache.org/cordova/ns/plugins/1.0`. If - the document contains XML from other namespaces, such as tags to be - added to the `AndroidManifest.xml` file, those namespaces should - also be included in the top-level element. + Attributes(type) | Description + ---------------- | ------------ + xmlns(string) | *Required*
The plugin namespace, `http://apache.org/cordova/ns/plugins/1.0`. If the document contains XML from other namespaces, such as tags to be added to the `AndroidManifest.xml` file, those namespaces should also be included in the element. + id(string) | *Required*
A reverse-domain style identifier for the plugin. + version(string) | *Required*
A version number for the plugin, that matches the following major-minor-patch style regular expression: `^\d+[.]\d+[.]\d+$` -* `id` (required): - A reverse-domain style identifier for the plugin, such as - `com.alunny.foo` + Example: + ``` + + + ``` -* `version` (required): - A version number for the plugin, that matches the following - major-minor-patch style regular expression: +### engines and engine - ^\d+[.]\d+[.]\d+$ + The child elements of the `` element specify versions of Apache Cordova-based frameworks that this plugin supports. Plugman aborts with a non-zero code for any plugin whose target project does not meet the engine's constraints. If no tags are specified, plugman attempts to install into the specified cordova project directory blindly. -## _engines_ and _engine_ Elements + Attributes(type) | Description + ---------------- | ------------ + name(string) | *Required*
Name of the engine. Here are the default engines that are supported :
  • `cordova`
  • `cordova-plugman`
  • `cordova-android`
  • `cordova-ios`
  • `cordova-blackberry10`
  • `cordova-wp8`
  • `cordova-windows`
  • `android-sdk` // returns the highest Android api level installed
  • `apple-xcode` // returns the xcode version
  • `apple-ios` // returns the highest iOS version installed
  • `apple-osx` // returns the OSX version
  • `blackberry-ndk` // returns the native blackberry SDK version
  • You can also specify a custom framework apart from the default ones. + version(string) | *Required*
    The version that your framework must have in order to install. It should match a major-minor-patch string conforming to the regular expression: `^\d+[.]\d+[.]\d+$` + scriptSrc(string) | **For custom frameworks only**
    *Required*
    The script file that tells plugman the version of the custom framework. Ideally, this file should be within the top level directory of your plugin directory. + platform(string) | **For custom frameworks only**
    *Required*
    The platforms your framework supports. You may use the wildcard `*` to say supported for all platforms, specify multiple with a pipe character like `android|ios|blackberry10` or just a single platform like `android`. -The child elements of the `` element specify versions of -Apache Cordova-based frameworks that this plugin supports. An example: + Examples: + ``` + + + + ``` - - - - - + Engine elements may also specify fuzzy matches using '>', '>=' etc. to avoid repetition, and to reduce maintenance when the underlying platform is updated. + ``` + + + + ``` -Similar to the `` element's `version` attribute, the specified -version string should match a major-minor-patch string conforming to -the regular expression: + The `` tags also has default support for all of the main platforms Cordova exists on. Specifying the cordova engine tag means that all versions of Cordova on any platform must satisfy the engine version attribute. You may also list specific platforms and their versions in order to override the catch-all cordova engine: + ``` + + + + + + ``` - ^\d+[.]\d+[.]\d+$ + Custom frameworks example: + ``` + + + + + + ``` -Engine elements may also specify fuzzy matches to avoid repetition, -and to reduce maintenance when the underlying platform is updated. -Tools should support a minimum of `>`, `>=`, `<` and `<=`, for -example: +### name - - - - + The `name` element is used to specify the name of the plugin. This element does not (yet) handle localization. -The `` tags also has default support for all of the main platforms Cordova exists on. -Specifying the `cordova` engine tag means that all versions of Cordova on any platform must -satisfy the engine version attribute. You may also list specific platforms and their versions -in order to override the catch-all `cordova` engine: + Example: + ``` + Foo + ``` - - - - - +### description -Here's a list of the default engines that the `` tag supports: + The `description` element is used to specify the description of the plugin. This element does not (yet) handle localization. -* `cordova` -* `cordova-plugman` -* `cordova-amazon-fireos` -* `cordova-android` -* `cordova-ios` -* `cordova-blackberry10` -* `cordova-wp8` -* `cordova-windows8` -* `android-sdk` // returns the highest Android api level installed -* `apple-xcode` // returns the xcode version -* `apple-ios` // returns the highest iOS version installed -* `apple-osx` // returns the OSX version -* `blackberry-ndk` // returns the native blackberry SDK version - -Specifying custom Apache Cordova-based frameworks should be listed under the engine tag like so: + Example: + ``` + Foo plugin description + ``` - - - - - +### author -A custom Apache Cordova-based framework requires that an engine element includes the following attributes: -`name`, `version`, `scriptSrc`, and `platform`. + The content of the `author` element contains the name of the plugin author. -* `name` (required): A human-readable name for your custom framework. + Example: + ``` + Foo plugin author + ``` -* `version` (required): The version that your framework must have in order to install. +### keywords -* `scriptSrc` (required): The script file that tells plugman what version of the custom framework is. -Ideally, this file should be within the top level directory of your plugin directory. + The content of the `keywords` element contains comma separated keywords to describe the plugin. -* `platform` (required): Which platforms that your framework supports. You may use the wildcard `*` -to say supported for all platforms, specify multiple with a pipe character like `android|ios|blackberry10` -or just a single platform like `android`. + Example: + ``` + foo,bar + ``` -plugman aborts with a non-zero code for any plugin whose target -project does not meet the engine's constraints. +### license -If no `` tags are specified, plugman attempts to install into -the specified cordova project directory blindly. + This element is used to specify the license of the plugin. -## _name_ Element + Example: + ``` + Apache 2.0 License + ``` + +### asset -A human-readable name for the plugin, whose text content contains the -name of the plugin. For example: + This element is used to list the files or directories to be copied into a Cordova app's www directory. Any `` elements that are nested within `` elements specify platform-specific web assets. - Foo + Attributes(type) | Description + ---------------- | ------------ + src(string) | *Required*
    Where the file or directory is located in the plugin package, relative to the plugin.xml document. If a file does not exist at the specified src location, plugman stops and reverses the installation process, issues a notification about the conflict, and exits with a non-zero code. + target(string) | *Required*
    Where the file or directory should be located in the Cordova app, relative to the www directory. If a file already exists at the target location, plugman stops and reverses the installation process, issues a notification about the conflict, and exits with a non-zero code. -This element does not (yet) handle localization. + Examples: + ``` + + + + + ``` -## _description_ Element + Assets can be targeted to subdirectories as well. This will create the js/experimental directory within the www directory, unless already present, and copy the new-foo.js file and renames it to foo.js. + ``` + + ``` -A human-readable description for the plugin. The text content of the element contains -the description of the plugin. An example: +### js-module - Foo plugin description + Most plugins include one or more JavaScript files. Each `` tag corresponds to a JavaScript file, and prevents the plugin's users from having to add a `