Getting comm-central Source Code 编辑

Warning: This page is OUT OF DATE since the comm-central code now needs to reside in a comm/ subdirectory of the mozilla-central code. Also, client.py (see below) no longer exists.

Using Mercurial

Mercurial is a source code management tool which enables users to track changes to their source code locally and share their changes with others. The Mozilla project is in transition from using CVS for Mozilla 1.9 development to Mercurial for Mozilla 1.9.1 development and onwards.

Note: If you want to build Thunderbird 2.0, SeaMonkey 1.1, or older versions, use CVS.

Client settings

The settings are the same as for the core Firefox 3.5/xulrunner 1.9.1 development. See Mozilla_Source_Code_(Mercurial)#Client_settings.

Branches

comm-central has various different branches available. Current possibilities are:

For more information on these branches, see the comm-central page.

Initial checkout

The Thunderbird, SeaMonkey, Lightning and Sunbird source code is contained in several different repositories. The main integration repository for those applications is comm-central, which contains the main code that is required in addition to the core Gecko code. It also contains a script, client.py, which is used to get the other code.

To get one of the comm-central repositories, clone it (using Mercurial terminology). Do the following, replacing <location of repository> with one of the URLs from the Branches section above, depending upon what you want to build:

# Pull the Mozilla source to the folder src/ - may take a while
# as hundreds of megabytes of history is downloaded to .hg
hg clone <location of repository> src

cd src
Note: If you already have a mozilla-central tree, you can clone it to src/mozilla to avoid pulling all of mozilla-central again.

Update/pull all other needed sources using client.py:

python client.py checkout

Note: If you get the error message "No module named subprocess", install Python 2.4 or later.

This step downloads hundreds of megabytes of data. It can take a while, depending on your network connection.

client.py performs the following tasks:

  • Pulls any new changesets to the comm-central codebase
  • Pulls the mozilla-central codebase into mozilla/
  • Pulls the following repositories into mozilla/extensions/:
    • irc (Chatzilla)
    • inspector (DOM Inspector)
    • venkman (JavaScript Debugger)
  • Pulls the LDAP SDK codebase into ldap/sdks/ (Except on recent trunk — December 2010 — this is done by CVS and the destination is mozilla/directory/c-sdk instead)
  • Runs hg update after each hg pull above to update the corresponding repository clone's working directory contents. This is not required (in fact, you may prefer to pull manually). Pass --skip-comm to client.py to skip this.
Note: Pulling in the related repositories means that you can use the same source directories to develop and build any of the items mentioned above, but it does not mean that you can create cross-repository change sets. Patches that span repositories require multiple changesets.

Updating the repository

To update the repository, just run client.py again:

python client.py checkout

Alternative methods

Using Mercurial bundles

See Mercurial Bundles

Using Github

To only obtain the latest version of the source tree, you can use the Github comm-central mirror (called gecko-dev) as follows. For quick tests, this is appropriate it is because faster than the complete clone.

# does not store the zip file on disk, uncompress on the fly
bsdtar -x -f <(curl -s -L https://github.com/mozilla/releases-comm-central/archive/master.zip)
cd gecko-dev-master

Building

For the comm-central apps, see the following links:

Example

The following script runs the checkout, build, and package operations in turn, telling you what it does (and when) and stopping at (and displaying) the first nonzero program exit code. It is written for the bash shell on Linux-i686 and for an object directory set with mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-@CONFIG_GUESS@, but it can be easily adapted for other Mozilla building environments:

#!/bin/bash
# set the following to the actual location of your objdir
# if you want to package an installable archive
export MY_OBJDIR=obj-i686-pc-linux-gnu
date && \
echo 'python client.py checkout' && \
python client.py checkout && \
date && \
echo 'make -f client.mk build' && \
make -f client.mk build && \
test -n "$MY_OBJDIR" -a -d $MY_OBJDIR && \
date && \
echo "make -C $MY_OBJDIR package" && \
make -C $MY_OBJDIR package
echo 'Exit status' $?
date

Firefox and xulrunner

You can, if needed, build Firefox or xulrunner from this tree. As client.py pulls the mozilla-central repository, builds and development of Firefox and xulrunner can take place within a repository from comm-central. The only difference is that you must be in the mozilla/ directory before running the build command:

cd src/mozilla
make -f client.mk build

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:128 次

字数:8913

最后编辑:7 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文