tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

node-templates.mozbuild (1525B)


      1 # vim: set filetype=python:
      2 # This Source Code Form is subject to the terms of the Mozilla Public
      3 # License, v. 2.0. If a copy of the MPL was not distributed with this
      4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
      5 
      6 
      7 @template
      8 def CompiledModules(*modules):
      9     compiled_directory_whitelist = ("devtools/client/debugger/src",)
     10 
     11     if not RELATIVEDIR.startswith(compiled_directory_whitelist):
     12         error(
     13             "File in directory provided to CompiledModules not allowed: " + RELATIVEDIR
     14         )
     15 
     16     # HACK. Template export() propagation is janky so we have to re-implement the
     17     # logic for computing FINAL_TARGET from scratch. Here we emulate the
     18     # DIST_SUBDIR export in devtools/moz.build.
     19     if CONFIG["MOZ_BUILD_APP"] == "browser":
     20         final_target = "/dist/bin/browser"
     21     else:
     22         final_target = "/dist/bin"
     23 
     24     final = "/".join([final_target, "chrome/devtools/modules", RELATIVEDIR])
     25     # For the same reason as https://searchfox.org/mozilla-central/source/mobile/android/base/moz.build#180-184
     26     # we have to insert a first entry as recursivemake overrides the first entry and we end up with empty files
     27     # for the first file only.
     28     GeneratedFile(
     29         "node.stub",
     30         *[final + "/" + module for module in modules],
     31         script="/python/mozbuild/mozbuild/action/node.py",
     32         entry_point="generate",
     33         inputs=["/devtools/client/shared/build/build.js"]
     34         + [module for module in modules],
     35         flags=["/".join([TOPOBJDIR, final])]
     36     )