Bug 1523562 [wpt PR 14965] - Sync Mozilla CSS tests as of 2019-01-20, a=testonly
[gecko.git] / config / make-stl-wrappers.py
blob7e6da5150bfff30bb8ffa56775770576cf0d4cb2
1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
4 from __future__ import print_function
5 import os
6 import string
7 from mozbuild.util import FileAvoidWrite
8 from system_header_util import header_path
11 # The 'unused' arg is the output file from the file_generate action. We actually
12 # generate all the files in header_list
15 def gen_wrappers(unused, outdir, compiler, template_file, *header_list):
16 template = open(template_file, 'r').read()
18 for header in header_list:
19 path = header_path(header, compiler)
20 with FileAvoidWrite(os.path.join(outdir, header)) as f:
21 f.write(string.Template(template).substitute(HEADER=header,
22 HEADER_PATH=path))