tor-browser

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

write_framework_modulemap.py (705B)


      1 # Copyright 2016 The Chromium Authors
      2 # Use of this source code is governed by a BSD-style license that can be
      3 # found in the LICENSE file.
      4 
      5 import os
      6 import sys
      7 
      8 MODULE_MAP_TEMPLATE = '''\
      9 framework module %(framework_name)s {
     10  umbrella header "%(framework_name)s.h"
     11 
     12  export *
     13  module * { export * }
     14 }
     15 '''
     16 
     17 
     18 def Main(framework_name, modules_dir):
     19  # Find the name of the binary based on the part before the ".framework".
     20  if not os.path.isdir(modules_dir):
     21    os.makedirs(modules_dir)
     22 
     23  with open(os.path.join(modules_dir, 'module.modulemap'), 'w') as module_file:
     24    module_file.write(MODULE_MAP_TEMPLATE % {'framework_name': framework_name})
     25 
     26 
     27 if __name__ == '__main__':
     28  Main(*sys.argv[1:])