incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Mueller <>
Subject Re: [Cordova-JS] Platform-specific plugin directory structure
Date Wed, 18 Apr 2012 00:01:36 GMT
On Tue, Apr 17, 2012 at 19:04, Filip Maj <> wrote:

> How come we use the following dir structure for platforms:
> lib
>  - android
>  - plugin
>   - android
> ...

Here's how the files / directories are laid out:

- lib/[platform]/* platform-specific modules for specified platform
- lib/common/* portable modules
- lib/script/* JavaScript files which are NOT modules
- lib/cordova.js - bootstrap JavaScript file

In the case of the modules, in lib/[platform] and lib/common, the names of
the file correspond to the module id.  Here are the files in android and
their respective module ids:

android/exec.js cordova/exec
android/platform.js cordova/platform
android/plugin/android/app.js cordova/plugin/android/app
android/plugin/android/callback.js cordova/plugin/android/callback

module ids are what is used as the argument of require()

Note that the module ids are not encoded in the files, the module ids are
calculated by the file's location in the file system.  The reason the file
"android/plugin/android/app.js" exists, is because there is a module with
the id "cordova/plugin/android/app" that's specific to android.

That's the way it works today anyway.

Patrick Mueller

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