blob: 3549735eb625eadeff7ee5ed8ce8f0309546b3fd [file] [log] [blame]
Anders Carlssondc6b4772018-01-15 13:31:03 +01001# Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
2#
3# Use of this source code is governed by a BSD-style license
4# that can be found in the LICENSE file in the root of the source
5# tree. An additional intellectual property rights grant can be found
6# in the file PATENTS. All contributing project authors may
7# be found in the AUTHORS file in the root of the source tree.
8
9import argparse
10import datetime
Anders Carlsson7bca8ca2018-08-30 09:30:29 +020011import os
Anders Carlssondc6b4772018-01-15 13:31:03 +010012import sys
Anders Carlsson7bca8ca2018-08-30 09:30:29 +020013import textwrap
Anders Carlssondc6b4772018-01-15 13:31:03 +010014
15
16def GenerateUmbrellaHeader():
17 parser = argparse.ArgumentParser(description='Generate umbrella header')
18 parser.add_argument("-o", "--out", type=str, help="Output file.")
19 parser.add_argument("-s", "--sources", default=[], type=str, nargs='+',
20 help="Headers to include.")
21
22 args = parser.parse_args()
23
24 with open(args.out, "w") as outfile:
Anders Carlsson7bca8ca2018-08-30 09:30:29 +020025 outfile.write(textwrap.dedent("""\
26 /*
Anders Carlssondc6b4772018-01-15 13:31:03 +010027 * Copyright %d The WebRTC project authors. All Rights Reserved.
28 *
29 * Use of this source code is governed by a BSD-style license
30 * that can be found in the LICENSE file in the root of the source
31 * tree. An additional intellectual property rights grant can be found
32 * in the file PATENTS. All contributing project authors may
33 * be found in the AUTHORS file in the root of the source tree.
Anders Carlsson7bca8ca2018-08-30 09:30:29 +020034 */\n\n""" % datetime.datetime.now().year))
Anders Carlssondc6b4772018-01-15 13:31:03 +010035
36 for s in args.sources:
Anders Carlsson7bca8ca2018-08-30 09:30:29 +020037 outfile.write("#import <WebRTC/{}>\n".format(os.path.basename(s)))
Anders Carlssondc6b4772018-01-15 13:31:03 +010038
39 return 0
40
41
42if __name__ == '__main__':
43 sys.exit(GenerateUmbrellaHeader())