Skip to content
This repository has been archived by the owner on Nov 27, 2019. It is now read-only.

Commit

Permalink
--force-aom -> --retro flag which now allows one to use jpm with an o…
Browse files Browse the repository at this point in the history
…ld-school restart requiring add-on
  • Loading branch information
erikvold committed Oct 24, 2014
1 parent b6f6884 commit 9299e1c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jpm run -o /path/to/addon-sdk

## Transitioning From CFX

Currently, any add-on with unspecified engines, or engines supporting versions of Firefox where AOM support for native jetpacks does not exist, jpm will add a `install.rdf` and `bootstrap.js` file for backwards compatability. This can be overridden with the `--force-aom` flag, which will not build with these additional files. This is mainly for testing AOM support while still in development.
Currently, any add-on with unspecified engines, or engines supporting versions of Firefox where AOM support for native jetpacks does not exist, jpm will add a `install.rdf` and `bootstrap.js` file for backwards compatability.


## Testing
Expand Down
2 changes: 1 addition & 1 deletion bin/jpm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ program
.option("--debug", "Enable the add-on debugger when running the add-on")
.option("--check-memory", "Enable leaked tracker that attempts to report compartments leaked")
.option("--profile-memory", "Enable profiling of memory usage")
.option("--force-aom", "In development flag for transitioning to new style addons; forces the lack of install.rdf/bootstrap.js creation regardless of what engine versions are running");
.option("--retro", "In development flag for transitioning to new style addons; forces the lack of install.rdf/bootstrap.js creation regardless of what engine versions are running");

program
.command("xpi")
Expand Down
3 changes: 3 additions & 0 deletions lib/xpi.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ function xpi (manifest, options) {
return utils.checkNeedsFallbacks(options)
.then(function() {
if (options.needsBootstrapJS || options.needsInstallRDF) {
if (options.verbose) {
console.log("Validating the manifest")
}
return validate(dir);
}
return null;
Expand Down
10 changes: 2 additions & 8 deletions lib/xpi/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ var createRDF = require("../rdf");
var zip = require("../zip");
var console = require("../utils").console;
var getManifest = require("../utils").getManifest;
var DOMParser = require("xmldom").DOMParser;


function getData (xml, tag) {
var tag = xml.getElementsByTagName(tag)[0];
Expand Down Expand Up @@ -56,12 +54,8 @@ function checkNeedsFallbacks(options) {
if (exists) {
console.warn("Using existing install.rdf. This file is usually auto-generated.");

return fs.readFile(rdfPath).then(function(data) {
//var rdf = new DOMParser().parseFromString(data, "application/rdf+xml");
//var needsBootstrap = getData(rdf, "em:bootstrap") == "true";
var needsBootstrap = true;
return needsBootstrap ? checkForBootstrap() : null;
})
var needsBootstrap = !options.retro;
return needsBootstrap ? checkForBootstrap() : null;
}

return checkForBootstrap();
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"mozilla-version-comparator": "1.0.2",
"mozilla-toolkit-versioning": "0.0.2",
"jetpack-validation": "0.0.4",
"xmldom": "0.1.19",
"winreg": "0.0.12",
"when": "3.5.0",
"zip-dir": "0.2.1"
Expand All @@ -46,7 +45,8 @@
"glob": "4.0.6",
"rimraf": "2.2.8",
"sandboxed-module": "1.0.2",
"unzip": "0.1.9"
"unzip": "0.1.9",
"xmldom": "0.1.19"
},
"author": "Jordan Santell",
"license": "MPL v2.0"
Expand Down

0 comments on commit 9299e1c

Please sign in to comment.