2012-05-21 11:12:37 +00:00
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
2018-05-21 22:01:01 +00:00
|
|
|
import os
|
|
|
|
import string
|
2010-04-02 17:58:11 +00:00
|
|
|
|
2022-11-23 22:04:39 +00:00
|
|
|
from mozbuild.util import FileAvoidWrite
|
2018-05-21 22:01:01 +00:00
|
|
|
|
2017-11-08 22:42:27 +00:00
|
|
|
# The 'unused' arg is the output file from the file_generate action. We actually
|
|
|
|
# generate all the files in header_list
|
2018-05-21 22:01:01 +00:00
|
|
|
|
|
|
|
|
2023-04-20 21:49:03 +00:00
|
|
|
def gen_wrappers(unused, template_file, outdir, compiler, *header_list):
|
2010-04-02 17:58:11 +00:00
|
|
|
template = open(template_file, "r").read()
|
2010-04-20 20:12:02 +00:00
|
|
|
|
2017-11-08 22:42:27 +00:00
|
|
|
for header in header_list:
|
2013-09-06 00:22:39 +00:00
|
|
|
with FileAvoidWrite(os.path.join(outdir, header)) as f:
|
2020-02-28 21:41:18 +00:00
|
|
|
f.write(string.Template(template).substitute(HEADER=header))
|