mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-06-22 23:19:25 -04:00
Merge branch 'wip/alice/skip-unchanged' into 'main'
main: Skip unchanged blp files in batch-compile See merge request GNOME/blueprint-compiler!251
This commit is contained in:
commit
642a18be92
1 changed files with 12 additions and 6 deletions
|
@ -170,6 +170,18 @@ class BlueprintApp:
|
||||||
add_typelib_search_path(typelib_path)
|
add_typelib_search_path(typelib_path)
|
||||||
|
|
||||||
for file in opts.inputs:
|
for file in opts.inputs:
|
||||||
|
path = os.path.join(
|
||||||
|
opts.output_dir,
|
||||||
|
os.path.relpath(os.path.splitext(file.name)[0] + ".ui", opts.input_dir),
|
||||||
|
)
|
||||||
|
|
||||||
|
if os.path.isfile(path):
|
||||||
|
in_time = os.path.getmtime(file.name)
|
||||||
|
out_time = os.path.getmtime(path)
|
||||||
|
|
||||||
|
if out_time >= in_time:
|
||||||
|
continue
|
||||||
|
|
||||||
data = file.read()
|
data = file.read()
|
||||||
file_abs = os.path.abspath(file.name)
|
file_abs = os.path.abspath(file.name)
|
||||||
input_dir_abs = os.path.abspath(opts.input_dir)
|
input_dir_abs = os.path.abspath(opts.input_dir)
|
||||||
|
@ -186,12 +198,6 @@ class BlueprintApp:
|
||||||
for warning in warnings:
|
for warning in warnings:
|
||||||
warning.pretty_print(file.name, data, stream=sys.stderr)
|
warning.pretty_print(file.name, data, stream=sys.stderr)
|
||||||
|
|
||||||
path = os.path.join(
|
|
||||||
opts.output_dir,
|
|
||||||
os.path.relpath(
|
|
||||||
os.path.splitext(file.name)[0] + ".ui", opts.input_dir
|
|
||||||
),
|
|
||||||
)
|
|
||||||
os.makedirs(os.path.dirname(path), exist_ok=True)
|
os.makedirs(os.path.dirname(path), exist_ok=True)
|
||||||
with open(path, "w") as file:
|
with open(path, "w") as file:
|
||||||
file.write(xml)
|
file.write(xml)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue