feat: write_source_files bulk write for windows (#43)
This commit is contained in:
parent
71c1b893d6
commit
ca764e53e8
|
@ -61,6 +61,8 @@ def _write_source_files_bat(ctx):
|
|||
ctx.label.name + "_update.bat",
|
||||
)
|
||||
|
||||
additional_update_scripts = [target[_WriteSourceFilesInfo].executable for target in ctx.attr.additional_update_targets]
|
||||
|
||||
content = """
|
||||
@rem Generated by write_source_files.bzl, do not edit.
|
||||
@echo off
|
||||
|
@ -85,7 +87,13 @@ echo Copying %in% to %out% in %cd%
|
|||
copy %in% %out% >NUL
|
||||
""".format(in_file = ctx.files.in_files[i].short_path.replace("/", "\\"), out_file = ctx.files.out_files[i].short_path).replace("/", "\\")
|
||||
for i in range(len(ctx.attr.in_files))
|
||||
])
|
||||
]) + """
|
||||
cd %runfiles_dir%
|
||||
|
||||
@rem Run the update scripts for all write_source_file deps
|
||||
""" + "\n".join(["""
|
||||
call {update_script}
|
||||
""".format(update_script = update_script.short_path) for update_script in additional_update_scripts])
|
||||
|
||||
content = content.replace("\n", "\r\n")
|
||||
|
||||
|
|
Loading…
Reference in New Issue