Anders Carlsson | dc6b477 | 2018-01-15 13:31:03 +0100 | [diff] [blame] | 1 | # 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 | |
| 9 | import argparse |
| 10 | import datetime |
| 11 | import sys |
| 12 | |
| 13 | |
| 14 | def GenerateUmbrellaHeader(): |
| 15 | parser = argparse.ArgumentParser(description='Generate umbrella header') |
| 16 | parser.add_argument("-o", "--out", type=str, help="Output file.") |
| 17 | parser.add_argument("-s", "--sources", default=[], type=str, nargs='+', |
| 18 | help="Headers to include.") |
| 19 | |
| 20 | args = parser.parse_args() |
| 21 | |
| 22 | with open(args.out, "w") as outfile: |
| 23 | outfile.write("""/* |
| 24 | * Copyright %d The WebRTC project authors. All Rights Reserved. |
| 25 | * |
| 26 | * Use of this source code is governed by a BSD-style license |
| 27 | * that can be found in the LICENSE file in the root of the source |
| 28 | * tree. An additional intellectual property rights grant can be found |
| 29 | * in the file PATENTS. All contributing project authors may |
| 30 | * be found in the AUTHORS file in the root of the source tree. |
| 31 | */\n\n""" % datetime.datetime.now().year) |
| 32 | |
| 33 | for s in args.sources: |
| 34 | outfile.write("#import <{}>\n".format(s)) |
| 35 | |
| 36 | return 0 |
| 37 | |
| 38 | |
| 39 | if __name__ == '__main__': |
| 40 | sys.exit(GenerateUmbrellaHeader()) |