1#!/usr/bin/env vpython3 2 3# Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. 4# 5# Use of this source code is governed by a BSD-style license 6# that can be found in the LICENSE file in the root of the source 7# tree. An additional intellectual property rights grant can be found 8# in the file PATENTS. All contributing project authors may 9# be found in the AUTHORS file in the root of the source tree. 10 11import argparse 12import sys 13 14 15def GenerateModulemap(): 16 parser = argparse.ArgumentParser(description='Generate modulemap') 17 parser.add_argument("-o", "--out", type=str, help="Output file.") 18 parser.add_argument("-n", "--name", type=str, help="Name of binary.") 19 20 args = parser.parse_args() 21 22 with open(args.out, "w") as outfile: 23 module_template = 'framework module %s {\n' \ 24 ' umbrella header "%s.h"\n' \ 25 '\n' \ 26 ' export *\n' \ 27 ' module * { export * }\n' \ 28 '}\n' % (args.name, args.name) 29 outfile.write(module_template) 30 return 0 31 32 33if __name__ == '__main__': 34 sys.exit(GenerateModulemap()) 35