Skip to content
4z3 edited this page May 11, 2012 · 1 revision

Package Plugin

A package plugin is a directory below the project's plugins/ directory. The name of that directory is the plugin's name (as far as Espresso is concerned). This directory usually contains the plugin's native code and it's web resources.

Quickstart Example

A minimal Android plugin's file system hierarchy might look like this:

plugins/MyPlugin/src/com/test/MyPlugin.java
plugins/MyPlugin/assets/MyPlugin.js

The corresponding "plugins"-property of the project's [[config.json]]-file could look like this:

"plugins": {
  "com.test.MyPlugin": "MyPlugin"
}

Web Resources

Web resources are JavaScript code, HTML code, images, and so on. They have to reside below the plugin's assets/ directory.

Native Code

Native Code for iOS

Native code has to reside below the plugin's src/ directory.

For iOS the native code consists of the plugin's .h, .cpp, and .mm files.

Native Code for Android

For Android the native code consists of the plugin's .java files. The src/-directory will be used as Java class path. See also understanding the class path and package names to unterstand how java classes are mapped to directories.

Quirks

Android Quirks

Android Plugin Naming Quirk

Currently the name of the plugin has to be the same as the name of the plugin's class name. I.e. if you have a plugin with the (fully qualified) class name com.test.MyPlugin, then the plugin has to reside plugin has to be found below plugins/MyPlugin/.

Clone this wiki locally