xref: /aosp_15_r20/external/cronet/build/config/ios/write_framework_modulemap.py (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
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
5import os
6import sys
7
8MODULE_MAP_TEMPLATE = '''\
9framework module %(framework_name)s {
10  umbrella header "%(framework_name)s.h"
11
12  export *
13  module * { export * }
14}
15'''
16
17
18def 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
27if __name__ == '__main__':
28  Main(*sys.argv[1:])
29