Skip to content

Commit

Permalink
Fix some problems blocking Tbird extension submission
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-p committed Sep 13, 2018
1 parent 79e02bf commit ff5f1db
Show file tree
Hide file tree
Showing 5 changed files with 356 additions and 99 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"no-mixed-spaces-and-tabs": "error",
"no-multi-spaces": "error",
"no-multi-str": "error",
"no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 0 }],
"no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 0 }],
"no-negated-in-lhs": "error",
"no-new": "error",
"no-new-func": "error",
Expand Down
10 changes: 5 additions & 5 deletions src/install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@
<em:id>[email protected]</em:id>
<em:version>2.13.3</em:version>

<!-- Firefox -->
<em:targetApplication>
<Description>
<!-- Firefox -->
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>11.0</em:minVersion>
<em:maxVersion>49.*</em:maxVersion>
</Description>
</em:targetApplication>

<!-- Postbox -->
<!-- Thunderbird -->
<em:targetApplication>
<Description>
<em:id>[email protected]</em:id>
<em:minVersion>2.0</em:minVersion>
<em:maxVersion>5.*</em:maxVersion>
<em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
<em:minVersion>6.0</em:minVersion>
<em:maxVersion>60.*</em:maxVersion>
</Description>
</em:targetApplication>

Expand Down
13 changes: 7 additions & 6 deletions utils/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"use strict";

var fs = require('fs');
var path = require('path');
var file = require('file');
var archiver = require('archiver');
var MetaScript = require('MetaScript');
Expand Down Expand Up @@ -60,16 +59,18 @@ function fnameMatch(fpath, inputArray) {

// Add a file to the Chrome extension zip
function addBuildFile(platformName, zip, fullPath, zipPath) {
var fileContents;

// For the Mozilla extensions in particular, we need to do some preprocessing on JavaScript files
// in order to exclude code specific to other platforms.
if (javascriptFileRegex.test(fullPath)) {
var fileContents = fs.readFileSync(fullPath);
fileContents = fs.readFileSync(fullPath);
fileContents = MetaScript.transform(fileContents, {platform: platformName});
zip.append(fileContents, { name: zipPath });
}
else if (platformName === CHROME_PLATFORM && manifestJsonFileRegex.test(fullPath)) {
// Remove the Firefox-specific stuff from manifest.json when building for Chrome.
var fileContents = fs.readFileSync(fullPath, {encoding: 'utf8'});
fileContents = fs.readFileSync(fullPath, {encoding: 'utf8'});
fileContents = fileContents.replace(/,"applications":[^{]*{[^{]*{[^}]*}[^}]*}/m, '');
zip.append(fileContents, { name: zipPath });
}
Expand All @@ -96,8 +97,8 @@ function setUpZips() {
}

var chromeZip = new archiver('zip'); // Chrome will reject the zip if there's no compression
var firefoxZip = new archiver('zip', {store: true});
var thunderbirdZip = new archiver('zip', {store: true});
var firefoxZip = new archiver('zip');
var thunderbirdZip = new archiver('zip'); // addons.thunderbird.net rejects the xpi if there's no compression

chromeZip.on('error', function(err) {
console.log('chromeZip error:', err);
Expand All @@ -121,7 +122,7 @@ function setUpZips() {
return {
chrome: chromeZip,
firefox: firefoxZip,
thunderbird: thunderbirdZip,
thunderbird: thunderbirdZip
};
}

Expand Down
Loading

0 comments on commit ff5f1db

Please sign in to comment.