incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Lunny <alu...@gmail.com>
Subject Plugins: Packaging/Installation/Manifests and whatnot
Date Tue, 24 Jan 2012 01:10:22 GMT
Hi all,

As I mentioned on the call last week, I have been working on some tooling
for programmatically installing Cordova plugins into projects, as well as a
format for defining what tasks a particular plugin needs accomplished. I
have a couple of early protoypes that I'd like some feedback on.

The first is a cross-platform structure for the ChildBrowser plugin, that
can be seen here:
https://github.com/alunny/phonegap-plugins/tree/crossplatform/CrossPlatform/ChildBrowser
including an XML-based manifest, here
https://github.com/alunny/phonegap-plugins/blob/crossplatform/CrossPlatform/ChildBrowser/plugin.xml

A couple of notes:
* it is Android only because the installation tool I've been working on
only supports Android at present
* the manifest is in XML because so are most of the config formats we're
dealing with (AndroidManifest, App-Info.plist, config.xml). Having an XML
manifest makes it easy to include, say, extra permission tags to be
included on Android, with XPath selectors to say where they should go in
the target document
* in most cases, it would be preferable for JavaScript files to be
cross-platform compatible; however, the format is flexible enough to allow
`asset` nodes to be children of `platform` nodes, and thus platform-specific
* the format was written from the perspective of a plugin-consumer, rather
than a plugin-author, so it's missing anything inessential for writing a
consumer tool (no author tags, no license tags)
* the directory structure is, of course, up for bikeshedding

I have written a small library that programmatically installs plugins based
on this file format, that can be found here:
https://github.com/alunny/pluginstall
or installed locally via
npm install -g pluginstall

Writing such tools is trivially easy for Android plugins (aside from
Node.js not having very good pure JavaScript XML libraries); it could
probably be translated into an ant task. For iOS, it would be necessary to
parse xcodeproj files, which is a little more involved - I am working on a
node.js based parser for that, to enhance the `pluginstall` tools.

A couple of open issues:
* the current format doesn't have a mechanism for specifying that one
plugin depends on another, which will be necessary
* there's no way to specify a dependency on an external library - for
example, a separate framework on iOS. I will investigate options as I begin
work on the iOS side of the code.

Looking forward to feedback,
Andrew

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message