build/docs/jar-manifests.rst

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 .. _jar_manifests:
     3 =============
     4 JAR Manifests
     5 =============
     7 JAR Manifests are plaintext files in the tree that are used to package chrome
     8 files into the correct JARs, and create
     9 `Chrome Registration <https://developer.mozilla.org/en-US/docs/Chrome_Registration>`_
    10 manifests. JAR Manifests are commonly named ``jar.mn``. They are
    11 declared in ``moz.build`` files using the ``JAR_MANIFESTS`` variable.
    13 ``jar.mn`` files are automatically processed by the build system when building a
    14 source directory that contains one. The ``jar``.mn is run through the
    15 :ref:`preprocessor` before being passed to the manifest processor. In order to
    16 have ``@variables@`` expanded (such as ``@AB_CD@``) throughout the file, add
    17 the line ``#filter substitution`` at the top of your ``jar.mn`` file.
    19 The format of a jar.mn is fairly simple; it consists of a heading specifying
    20 which JAR file is being packaged, followed by indented lines listing files and
    21 chrome registration instructions.
    23 To see a simple ``jar.mn`` file at work, see ``toolkit/profile/jar.mn``. A much
    24 more complex ``jar.mn`` is at ``toolkit/locales/jar.mn``.
    26 Shipping Chrome Files
    27 =====================
    29 To ship chrome files in a JAR, an indented line indicates a file to be packaged::
    31    <jarfile>.jar:
    32      path/in/jar/file_name.xul     (source/tree/location/file_name.xul)
    34 The source tree location may also be an *absolute* path (taken from the
    35 top of the source tree::
    37    path/in/jar/file_name.xul     (/path/in/sourcetree/file_name.xul)
    39 An asterisk marker (``*``) at the beginning of the line indicates that the
    40 file should be processed by the :ref:`preprocessor` before being packaged::
    42    * path/in/jar/preprocessed.xul  (source/tree/location/file_name.xul)
    44 A plus marker (``+``) at the beginning of the line indicates that the file
    45 should replace an existing file, even if the source file's timestamp isn't
    46 newer than the existing file::
    48    + path/in/jar/file_name.xul     (source/tree/location/my_file_name.xul)
    50 Preprocessed files always replace existing files, to ensure that changes in
    51 ``#expand`` or ``#include`` directives are picked up, so ``+`` and ``*`` are
    52 equivalent.
    54 There is a special source-directory format for localized files (note the
    55 percent sign in the source file location): this format reads ``localized.dtd``
    56 from the ``en-US`` directory if building an English version, and reads the
    57 file from the alternate localization source tree
    58 ``/l10n/<locale>/path/localized.dtd`` if building a localized version::
    60    locale/path/localized.dtd     (%localized/path/localized.dtd)
    62 Register Chrome
    63 ===============
    65 `Chrome Registration <https://developer.mozilla.org/en-US/docs/Chrome_Registration>`_
    66 instructions are marked with a percent sign (``%``) at the beginning of the
    67 line, and must be part of the definition of a JAR file. Any additional percents
    68 signs are replaced with an appropriate relative URL of the JAR file being
    69 packaged::
    71    % content global %path/in/jar/
    72    % overlay chrome://blah/content/blah.xul chrome://foo/content/overlay.xul
    74 There are two possible locations for a manifest file. If the chrome is being
    75 built into a standalone application, the ``jar.mn`` processor creates a
    76 ``<jarfilename>.manifest`` next to the JAR file itself. This is the default
    77 behavior.
    79 If the build specifies ``USE_EXTENSION_MANIFEST = 1``, the ``jar.mn`` processor
    80 creates a single ``chrome.manifest`` file suitable for registering chrome as
    81 an extension.

mercurial