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 absolute_import
5 from __future__
import print_function
8 from mozbuild
.util
import FileAvoidWrite
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 with
FileAvoidWrite(os
.path
.join(outdir
, header
)) as f
:
20 f
.write(string
.Template(template
).substitute(HEADER
=header
))