Skip to content

Build Process

Eric Bixby edited this page Dec 10, 2022 · 35 revisions

Operating System

The add-on is primarily built on Ubuntu (using Docker). It also builds on macOS and Windows. The following steps are performed by a docker build. They are provided in case you want to do it manually.

Install NodeJS

Install NodeJS version 12.22.12 (npm version 6.14.16). Use nvm to install a particular node version.

Source Folder Location

Because the build output will contain relative paths in some files, when building for AMO verification/reproducibility purposes, the source code folder needs to be at the same folder level as the original build (the names don't need to match, just the folder levels).

The docker container uses this location: /root/auto-sort-bookmarks-webext/

Your location will probably be something like: ~/Downloads/auto-sort-bookmarks-webext-X.Y.Z

Install web-ext

Install web-ext:

npm i -g web-ext@6.8.0

More information: web-ext

Install weh

Install weh:

npm i -g gulp@4.0.2
npm i -g weh@2.10.0

Override dependencies with the same version used for the submitted source rather than the latest:

cd `npm root -g`/weh
cp ~/Downloads/auto-sort-bookmarks-webext-X.Y.Z/weh-npm-shrinkwrap.json ./npm-shrinkwrap.json
npm i

More information: weh (weh depends on NodeJS 12.X; newer versions not supported)

Build

The following script will build/generate the target Javascript code and bundle it into a .xpi file:

cd ~/Downloads/auto-sort-bookmarks-webext-X.Y.Z
./build_ff.sh

The only difference between the AMO submitted and generated sources should be the "build.date" file. However, if you use a different OS/Platform, the bundle order might be different.