mozilla/addon-sdk — pull request #276 by ochameau (2011-11-29 14:45:19+00:00)
Title: Bug 660629 - Simple XPI file layout

This work is meant to simplify multiple things:
- XPI generated by cfx
- manifest (i.e harness-options.json file)
- the module loader implementation

First, instead of registering one resource domain for each package section,
we are now registering only one per addon by using "unique_prefix" as domain.
i.e. we will use the following URL for all addon files:
resource://$(unique_prefix)/$(packageName)/$(section)/$(module)
So if the addon id is "my-addon@mozilla.com", we will have following url for module cuddlefish:
resource://my-addon-at-mozilla.com/api-utils/lib/cuddlefish.js
`unique_prefix` is computed by cfx and given to `bootstrap.js` that is going to register the resource domain by reading `unique_prefix` from the manifest.

In order to do register only one resource, we changed the XPI file layout a bit and simplified it. We still put all files into `resources` folder, but instead of having folders containing the jetpack id, we simply put packages folders. Here is an example of resources folder:
resources/
api-utils/
lib/
cuddlefish.js
file.js
data/
content-script.js
tests/
test-main.js
my-addon/
lib/
main.js
data/
panel.html
tests/
test-main.js

So `resources` folder contains packages folders with package name, all these package folders contains section folders (i.e test, data, lib, locale, ...). Finally section folders contains module files, static files, locale files, ...

I end up removing various unused manifest attributes: bundle_id (equal to jetpackID), resources, resourcePackages, packageData, rootPaths.