31for arg
in sys.argv[2:]:
32 if arg.startswith(
"--"):
33 bazel_args.append(arg)
39 bazel_file, output_path = arg.split(
"=")
40 outputs[bazel_file] = output_path
45 outputs[arg] = os.path.basename(arg)
47print(
"Invoking bazelisk from ", os.getcwd())
49subprocess.run([
"bazelisk",
"build", target ] + bazel_args, check=
True)
51for bazel_file, output_path
in outputs.items():
54 expected_output = os.path.join(os.getcwd(), output_path)
55 if not os.path.exists(expected_output):
56 shutil.copyfile(bazel_file, expected_output)
57 os.chmod(expected_output, 0o755)
62 created_hash = hashlib.sha256(open(bazel_file,
'rb').
read()).hexdigest()
63 existing_hash = hashlib.sha256(open(expected_output,
'rb').
read()).hexdigest()
64 if created_hash != existing_hash:
65 os.remove(expected_output)
66 shutil.copyfile(bazel_file, expected_output)
67 os.chmod(expected_output, 0o755)
static bool read(SkStream *stream, void *buffer, size_t amount)
def print(*args, **kwargs)