Intel-XDK uses third party Cordova plugins only at build time. Is there a way to implement a third party plugin using Cordova CLI in my local Intel-XDK environment? In other words, can I access the internal Intel-XDK Cordova server in some way?
-
Adding a plugin via CL is possible and it should work for Intel-XDK, have you looked at http://cordova.apache.org/docs/en/4.0.0/guide_cli_index.md.html – AAhad Nov 29 '14 at 02:54
-
Thanks! And will the plugin be activated, or is added automatically a checkbox in the projects tab of the Intel-XDK? – Jack541108 Nov 29 '14 at 09:03
-
Sorry I haven't used Intel-XDK. Using the common CL method of adding a plugin will make it present/activated in the app. Better you first try adding any other plugin and check the results like settings, configuration and how it was added. And then you add your custom plugin. In this way you can compare both settings/configuration and can easily pin point missing items in your plugins - if in case. – AAhad Nov 29 '14 at 13:36
-
Thanks, AAhad. I'm going to try it. – Jack541108 Nov 29 '14 at 13:38
1 Answers
EDIT (7 Aug 2015): With our EA release local plugins no longer need to be placed inside your source directory (typically www
inside your project directory). The Intel XDK EA release manages plugins in a way that is consistent with Cordova CLI. This CLI-compatible plugin management scheme will become part of the mainstream release in the very near future.
Original Post:
You cannot directly access the XDK build server's CLI. However, you can reference a plugin locally (that is, you can submit a plugin that is located on your local disk drive). Unfortunately, you have to locate the plugin inside your www
"source" directory, I hope to see that changed in a future revision of the product; this is not where a local CLI would place the plugin...
Placing the plugin into your www
directory, and then referencing it using the "import local plugin" on the Projects tab (find the "Plugins and Permission" and then the "Third-Party Plugins" section) allows you to customize that plugin before it gets submitted to the build service. For example, assume you need to change the contennts of the plugin.xml
file or change a plist
or manifest
file that is part of the plugin, you could do that in the local copy and those changes would be part of this "local third-party plugin" that is submitted to the build server with your app when the build server runs.
In essence, the build server does a plugin add
on a copy of the plugin that got submitted along with your project when you use the "import local plugin" feature. A copy of your local plugin gets sent with your app source to the build server and, before the build happens, the build server's CLI performs a plugin add
with that plugin, so the changes you implemented locally will be included in the plugin when it is built by the build server. Make sense? :)
There are also some useful things you can do with the intelxdk.config.additions.xml
file regarding plugins. See these doc pages for some details:
- https://software.intel.com/en-us/html5/xdkdocs#517453
- https://software.intel.com/en-us/html5/articles/using-the-cordova-for-android-ios-etc-build-option
The checkmarked plugins on the Project tab refer only to what are called "core" plugins and "featured" plugins. They are really just a convenience for selecting plugins. The "core" plugins also include some simulation inside the Emulate, Test and Debug tabs (as well as in App Preview). Other than that, they are standard Cordova plugins that are also "plugin added" by the build server if they have been checked. Take a look at the various intelxdk.config.*.xml
files that are automatically generated when you perform a build to see how the checkmarks (and third-party plugins) are communicated to the build server.

- 2,314
- 2
- 14
- 31
-
-
when im trying to import local plugin , it says "please choose a path within project directory" is there something wrong im doing ? – ProllyGeek Dec 17 '14 at 15:57
-
No, as the build system works today it requires that any local plugins be located within your project directory. If the path you are pointing to is outside of the project directory it will not work. – xmnboy Dec 18 '14 at 20:10