mozbuild.action package

Submodules

mozbuild.action.buildlist module

A generic script to add entries to a file if the entry does not already exist.

Usage: buildlist.py <filename> <entry> [<entry> …]

mozbuild.action.buildlist.addEntriesToListFile(listFile, entries)

Given a file |listFile| containing one entry per line, add each entry in |entries| to the file, unless it is already present.

mozbuild.action.buildlist.main(args)

mozbuild.action.cl module

mozbuild.action.dump_env module

mozbuild.action.dumpsymbols module

mozbuild.action.dumpsymbols.dump_symbols(target, tracking_file)
mozbuild.action.dumpsymbols.main(argv)

mozbuild.action.exe_7z_archive module

mozbuild.action.exe_7z_archive.archive_exe(pkg_dir, tagfile, sfx_package, package)
mozbuild.action.exe_7z_archive.main(args)

mozbuild.action.exe_7z_extract module

mozbuild.action.exe_7z_extract.extract_exe(package, target)
mozbuild.action.exe_7z_extract.main(args)

mozbuild.action.explode_aar module

mozbuild.action.explode_aar.explode(aar, destdir)
mozbuild.action.explode_aar.main(argv)

mozbuild.action.file_generate module

mozbuild.action.file_generate.main(argv)

mozbuild.action.generate_browsersearch module

Script to generate the browsersearch.json file for Fennec.

This script follows these steps:

1. Read the region.properties file in all the given source directories (see srcdir option). Merge all properties into a single dict accounting for the priority of source directories.

  1. Read the default search plugin from ‘browser.search.defaultenginename’.

3. Read the list of search plugins from the ‘browser.search.order.INDEX’ properties with values identifying particular search plugins by name.

4. Read each region-specific default search plugin from each property named like ‘browser.search.defaultenginename.REGION’.

5. Read the list of region-specific search plugins from the ‘browser.search.order.REGION.INDEX’ properties with values identifying particular search plugins by name. Here, REGION is derived from a REGION for which we have seen a region-specific default plugin.

6. Generate a JSON representation of the above information, and write the result to browsersearch.json in the locale-specific raw resource directory e.g. raw/browsersearch.json, raw-pt-rBR/browsersearch.json.

mozbuild.action.generate_browsersearch.main(args)
mozbuild.action.generate_browsersearch.merge_properties(filename, srcdirs)

Merges properties from the given file in the given source directories.

mozbuild.action.generate_searchjson module

mozbuild.action.generate_suggestedsites module

Script to generate the suggestedsites.json file for Fennec.

This script follows these steps:

1. Read the region.properties file in all the given source directories (see srcdir option). Merge all properties into a single dict accounting for the priority of source directories.

2. Read the list of sites from the list ‘browser.suggestedsites.list.INDEX’ and ‘browser.suggestedsites.restricted.list.INDEX’ properties with value of these keys being an identifier for each suggested site e.g. browser.suggestedsites.list.0=mozilla, browser.suggestedsites.list.1=fxmarketplace.

3. For each site identifier defined by the list keys, look for matching branches containing the respective properties i.e. url, title, etc. For example, for a ‘mozilla’ identifier, we’ll look for keys like: browser.suggestedsites.mozilla.url, browser.suggestedsites.mozilla.title, etc.

4. Generate a JSON representation of each site, join them in a JSON array, and write the result to suggestedsites.json on the locale-specific raw resource directory e.g. raw/suggestedsites.json, raw-pt-rBR/suggestedsites.json.

mozbuild.action.generate_suggestedsites.main(args)
mozbuild.action.generate_suggestedsites.merge_properties(filename, srcdirs)

Merges properties from the given file in the given source directories.

mozbuild.action.generate_symbols_file module

mozbuild.action.generate_symbols_file.generate_symbols_file(output, *args)

mozbuild.action.jar_maker module

mozbuild.action.jar_maker.main(args)

mozbuild.action.langpack_manifest module

mozbuild.action.langpack_manifest.build_author_string(author, contributors)
mozbuild.action.langpack_manifest.convert_contributors(str)
mozbuild.action.langpack_manifest.convert_entry_flags_to_platform_codes(flags)
mozbuild.action.langpack_manifest.create_webmanifest(locstr, min_app_ver, max_app_ver, app_name, l10n_basedir, defines, chrome_entries)
mozbuild.action.langpack_manifest.get_dt_from_hg(path)
mozbuild.action.langpack_manifest.get_timestamp_for_locale(path)
mozbuild.action.langpack_manifest.main(args)
mozbuild.action.langpack_manifest.parse_chrome_manifest(path, base_path, chrome_entries)
mozbuild.action.langpack_manifest.parse_defines(paths)
mozbuild.action.langpack_manifest.write_file(path, content)

mozbuild.action.make_dmg module

mozbuild.action.make_dmg.main(args)

mozbuild.action.make_unzip module

mozbuild.action.make_unzip.main(args)
mozbuild.action.make_unzip.make_unzip(package)

mozbuild.action.make_zip module

mozbuild.action.make_zip.main(args)
mozbuild.action.make_zip.make_zip(source, package)

mozbuild.action.output_searchplugins_list module

mozbuild.action.package_fennec_apk module

Script to produce an Android package (.apk) for Fennec.

mozbuild.action.package_fennec_apk.main(args)
mozbuild.action.package_fennec_apk.package_fennec_apk(inputs=[], omni_ja=None, classes_dex=None, lib_dirs=[], assets_dirs=[], features_dirs=[], root_files=[], verbose=False)

mozbuild.action.package_generated_sources module

mozbuild.action.package_generated_sources.main(argv)

mozbuild.action.preprocessor module

mozbuild.action.preprocessor.generate(output, *args)
mozbuild.action.preprocessor.main(args)

mozbuild.action.process_define_files module

mozbuild.action.process_define_files.main(argv)
mozbuild.action.process_define_files.process_define_file(output, input)

Creates the given config header. A config header is generated by taking the corresponding source file and replacing some #define/#undef occurences:

“#undef NAME” is turned into “#define NAME VALUE” “#define NAME” is unchanged “#define NAME ORIGINAL_VALUE” is turned into “#define NAME VALUE” “#undef UNKNOWN_NAME” is turned into “/* #undef UNKNOWN_NAME */” Whitespaces are preserved.

As a special rule, “#undef ALLDEFINES” is turned into “#define NAME VALUE” for all the defined variables.

mozbuild.action.process_install_manifest module

mozbuild.action.process_install_manifest.main(argv)
mozbuild.action.process_install_manifest.process_manifest(destdir, paths, track, no_symlinks=False, defines={})

mozbuild.action.symbols_archive module

mozbuild.action.symbols_archive.main(argv)
mozbuild.action.symbols_archive.make_archive(archive_name, base, exclude, include, compress)

mozbuild.action.test_archive module

mozbuild.action.tooltool module

exception mozbuild.action.tooltool.BadFilenameException(filename)

Bases: mozbuild.action.tooltool.ExceptionWithFilename

exception mozbuild.action.tooltool.DigestMismatchException(filename)

Bases: mozbuild.action.tooltool.ExceptionWithFilename

exception mozbuild.action.tooltool.ExceptionWithFilename(filename)

Bases: exceptions.Exception

class mozbuild.action.tooltool.FileRecord(filename, size, digest, algorithm, unpack=False, version=None, visibility=None, setup=None)

Bases: object

describe()
present()
validate()
validate_digest()
validate_size()
class mozbuild.action.tooltool.FileRecordJSONDecoder(encoding=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, strict=True, object_pairs_hook=None)

Bases: json.decoder.JSONDecoder

I help the json module materialize a FileRecord from a JSON file. I understand FileRecords and lists of FileRecords. I ignore things that I don’t expect for now

decode(s)
process_file_records(obj)
class mozbuild.action.tooltool.FileRecordJSONEncoder(skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, encoding='utf-8', default=None)

Bases: json.encoder.JSONEncoder

default(f)
encode_file_record(obj)
exception mozbuild.action.tooltool.FileRecordJSONEncoderException

Bases: exceptions.Exception

exception mozbuild.action.tooltool.InvalidManifest

Bases: exceptions.Exception

class mozbuild.action.tooltool.Manifest(file_records=None)

Bases: object

copy()
dump(output_file, fmt='json')
dumps(fmt='json')
load(data_file, fmt='json')
loads(data_string, fmt='json')
present()
valid_formats = ('json',)
validate()
validate_digests()
validate_sizes()
exception mozbuild.action.tooltool.MissingFileException(filename)

Bases: mozbuild.action.tooltool.ExceptionWithFilename

mozbuild.action.tooltool.add_files(manifest_file, algorithm, filenames, version, visibility, unpack)
mozbuild.action.tooltool.clean_path(dirname)

Remove a subtree if is exists. Helper for unpack_file().

mozbuild.action.tooltool.create_file_record(filename, algorithm)
mozbuild.action.tooltool.digest_file(f, a)

I take a file like object ‘f’ and return a hex-string containing of the result of the algorithm ‘a’ applied to ‘f’.

mozbuild.action.tooltool.execute(cmd)

Execute CMD, logging its stdout at the info level

mozbuild.action.tooltool.fetch_file(base_urls, file_record, grabchunk=4096, auth_file=None, region=None)
mozbuild.action.tooltool.fetch_files(manifest_file, base_urls, filenames=[], cache_folder=None, auth_file=None, region=None)
mozbuild.action.tooltool.freespace(p)

Returns the number of bytes free under directory p

mozbuild.action.tooltool.list_manifest(manifest_file)

I know how print all the files in a location

mozbuild.action.tooltool.main(argv, _skip_logging=False)
mozbuild.action.tooltool.open_manifest(manifest_file)

I know how to take a filename and load it into a Manifest object

mozbuild.action.tooltool.process_command(options, args)

I know how to take a list of program arguments and start doing the right thing with them

mozbuild.action.tooltool.purge(folder, gigs)

If gigs is non 0, it deletes files in folder until gigs GB are free, starting from older files. If gigs is 0, a full purge will be performed. No recursive deletion of files in subfolder is performed.

mozbuild.action.tooltool.touch(f)

Used to modify mtime in cached files; mtime is used by the purge command

mozbuild.action.tooltool.unpack_file(filename, setup=None)

Untar filename, assuming it is uncompressed or compressed with bzip2, xz, gzip, or unzip a zip file. The file is assumed to contain a single directory with a name matching the base of the given filename. Xz support is handled by shelling out to ‘tar’.

mozbuild.action.tooltool.upload(manifest, message, base_urls, auth_file, region)
mozbuild.action.tooltool.validate_manifest(manifest_file)

I validate that all files in a manifest are present and valid but don’t fetch or delete them if they aren’t

mozbuild.action.unpack_dmg module

mozbuild.action.unpack_dmg.main(args)

mozbuild.action.webidl module

mozbuild.action.webidl.main(argv)

Perform WebIDL code generation required by the build system.

mozbuild.action.xpccheck module

A generic script to verify all test files are in the corresponding .ini file.

Usage: xpccheck.py <directory> [<directory> …]

mozbuild.action.xpccheck.getIniTests(testdir)
mozbuild.action.xpccheck.main(argv)
mozbuild.action.xpccheck.verifyDirectory(initests, directory)
mozbuild.action.xpccheck.verifyIniFile(initests, directory)

mozbuild.action.xpidl-process module

mozbuild.action.zip module

mozbuild.action.zip.main(args)

Module contents