New API

警告

此功能是实验性的,可能会发生重大更改。有关更多信息,请参阅 Conan 稳定性 部分。

class NewAPI(conan_api)
save_template(template, defines=None, output_folder=None, force=False)

将 'template' 文件保存在 output_folder 中,用 'defines' 替换模板变量 :param template: 要使用的模板名称 :param defines: 一个包含要在模板中替换的 'k=v' 变量的列表 :param output_folder: 将保存模板文件的文件夹,如果为 None 则为当前工作目录 :param force: 如果为 True,则覆盖已存在的文件,否则引发错误

get_template(template_folder)

从用户绝对文件夹加载模板

get_home_template(template_name)

从 Conan 主目录的 templates/command/new 文件夹加载模板