blob: 1fd1eed38eedd64b11302c962d24c0cb0f60dc99 [file] [log] [blame]
Christoffer Jansson4e8a7732022-02-08 08:01:121#!/usr/bin/env vpython3
2
Anders Carlssondc6b4772018-01-15 12:31:033# 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 datetime
Anders Carlsson7bca8ca2018-08-30 07:30:2913import os
Anders Carlssondc6b4772018-01-15 12:31:0314import sys
Anders Carlsson7bca8ca2018-08-30 07:30:2915import textwrap
Anders Carlssondc6b4772018-01-15 12:31:0316
17
18def GenerateUmbrellaHeader():
Christoffer Jansson4e8a7732022-02-08 08:01:1219 parser = argparse.ArgumentParser(description='Generate umbrella header')
20 parser.add_argument("-o", "--out", type=str, help="Output file.")
21 parser.add_argument("-s",
22 "--sources",
23 default=[],
24 type=str,
25 nargs='+',
26 help="Headers to include.")
Anders Carlssondc6b4772018-01-15 12:31:0327
Christoffer Jansson4e8a7732022-02-08 08:01:1228 args = parser.parse_args()
Anders Carlssondc6b4772018-01-15 12:31:0329
Christoffer Jansson4e8a7732022-02-08 08:01:1230 with open(args.out, "w") as outfile:
31 outfile.write(
32 textwrap.dedent("""\
Anders Carlsson7bca8ca2018-08-30 07:30:2933 /*
Anders Carlssondc6b4772018-01-15 12:31:0334 * Copyright %d The WebRTC project authors. All Rights Reserved.
35 *
36 * Use of this source code is governed by a BSD-style license
37 * that can be found in the LICENSE file in the root of the source
38 * tree. An additional intellectual property rights grant can be found
39 * in the file PATENTS. All contributing project authors may
40 * be found in the AUTHORS file in the root of the source tree.
Anders Carlsson7bca8ca2018-08-30 07:30:2941 */\n\n""" % datetime.datetime.now().year))
Anders Carlssondc6b4772018-01-15 12:31:0342
Christoffer Jansson4e8a7732022-02-08 08:01:1243 for s in args.sources:
44 outfile.write("#import <WebRTC/{}>\n".format(os.path.basename(s)))
Anders Carlssondc6b4772018-01-15 12:31:0345
Christoffer Jansson4e8a7732022-02-08 08:01:1246 return 0
Anders Carlssondc6b4772018-01-15 12:31:0347
48
49if __name__ == '__main__':
Christoffer Jansson4e8a7732022-02-08 08:01:1250 sys.exit(GenerateUmbrellaHeader())