Table of Contents
Introduction
Building products from the mozilla project can be quite a bit of work. Much of the project is designed to be flexible and robust, but sometimes that doesn't lend itself well to ease-of-use when working at the code level. Developing for mozilla tends to include a large number of tedious tasks, mostly centered around the build process. As part of getting indoctrinated into the project, many contributors spend their first few days developing scripts to assist them in running these tedious tasks automatically. Unfortunately, volunteer contributors sometimes don't have the time to spend getting their scripts running perfectly.
In order to diminish the time necessary for volunteer contributors to get up to speed with building mozilla from source, existing developers have contributed their knowledge and experience with writing build, debug, and test scripts into this suite of tools that new contributors can use to quickly get things working. This suite isn't the most flexible set of scripts written, but it does allow for many of the most common varieties of building, running, and debugging mozilla and mozilla-based products, with a very concise and easy-to-understand syntax.
Download
License
JMozTools is released under version 2.0 of the Mozilla Public License. You should receive a copy of the license with your download of JMozTools.
Installation
Linux and OS/X
Prerequisites
- Python 2.7 or higher is required. You will need to install the appropriate version for your platform before installing JMozTools.
Instructions
- Download and decompress the tarball listed under Download, above.
- cd into the directory where the tarball was extracted.
- sudo python setup.py install
- Re-initialize your .bashrc file with the following: source ~/.bashrc
This should install all required packages for you automatically.
Windows
Prerequisites
- Python 2.7 or higher is required. You will need to install the appropriate version for your platform before installing JMozTools.
- On Windows platforms, you need the latest mozilla-build package, available from Latest MozillaBuild Package.
- (Optional) You may also require some or all of the packages listed on this page in order to perform some builds.
Instructions
- Download and decompress the zip file listed under Download, above.
- Open up an msys mozilla build shell.
- cd to the directory where the unzipping was performed (e.g. C:\JMozTools).
- Type python setup.py install
- Re-initialize your .bashrc file with the following: source ~/.bashrc
Project Setup
JMozTools runs on the concept of 'projects', which are essentially cached information about mozilla source and object directories on your local machine. Currently, the projects are a lightweight XML file stored in your home directory. In the future, the intent is to incorporate a link to Eclipse projects, in order facilitate building and debugging within the IDE.
Scripts
JMozTeleport
JMozTeleport is a glorified cd program. The only real advantage to JMozTeleport is that you can save a few keystrokes, if, like me, you maintain multiple mozilla source trees. You can find instructions for use at JMozTeleport.
JMozMake
JMozMake is one of the core applications for this suite. It's an all-in-one, make-your-life-easier-building-mozilla tool. The tool functions similar to make, but it supports other make options, such as clobber, clean-config, and even incremental building of a single module. It integrates with both standard make (for use in an IDE, such as Eclipse), and colormake, for easy-to-read colored command line functionality.
JMozDebug
JMozDebug is the core debugging script in JMozTools. It comprises the other half (along with JMozMake) of tools you will likely use every day developing for mozilla. JMozDebug is a wrapper for gdb, but it configures everything in such a way so that you don't have to concentrate on whether you're connecting to an existing firefox process or whether you're starting a new one. JMozDebug will do either. If running versions of your source tree are found on the system, it will present you with a list of such and give you the option to connect to them. If not, it will automatically start a new firefox process and load it into gdb for debugging.
JMozUnitTest
JMozUnitTest was the original reason these scripts were developed. Running unit tests for mozilla can be a complicated task, since you need to configure a path on the command line each time you want to run the tests. Add to that the fact that there are several different types of tests, all with very similar commands to run, and it can be complicated running tests. This script makes that task easy, and even interprets output for you, putting it into an easy-to-read format.
Known Issues
- Mac OS/X is not reliably supported right now. (See Ticket #43). I believe the scripts should all work on this platform, but since I don't personally have a Mac OS/X build environment, I can't test bugs with this platform at this time.
- JMozDebug cannot be run on windows, as debugging on windows uses Visual Studio. (See https://developer.mozilla.org/en/Debugging_Mozilla_on_Windows_FAQ)