Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DE7F018587 for ; Sat, 30 Jan 2016 02:17:23 +0000 (UTC) Received: (qmail 65116 invoked by uid 500); 30 Jan 2016 02:17:23 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 65074 invoked by uid 500); 30 Jan 2016 02:17:23 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 65062 invoked by uid 99); 30 Jan 2016 02:17:23 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 30 Jan 2016 02:17:23 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3F747E0A12; Sat, 30 Jan 2016 02:17:23 +0000 (UTC) From: riknoll To: dev@cordova.apache.org Reply-To: dev@cordova.apache.org References: In-Reply-To: Subject: [GitHub] cordova-docs pull request: CB-10364: Making plugin.xml a reference Content-Type: text/plain Message-Id: <20160130021723.3F747E0A12@git1-us-west.apache.org> Date: Sat, 30 Jan 2016 02:17:23 +0000 (UTC) Github user riknoll commented on a diff in the pull request: https://github.com/apache/cordova-docs/pull/474#discussion_r51338281 --- 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. --- End diff -- This talks about plugman, what happens with the Cordova CLI? Probably the same thing. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org For additional commands, e-mail: dev-help@cordova.apache.org