16SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
21 "--deep",
"--force",
"--verify",
"--verbose",
"--timestamp",
22 "--options",
"runtime",
"--sign", identity
25 name = os.path.basename(binary)
32 entitlements_file = os.path.join(SCRIPT_DIR,
"entitlements",
34 if os.path.exists(entitlements_file):
35 codesign_args += [
"--entitlements", entitlements_file]
36 cmd = [
"codesign"] + codesign_args + [binary]
37 result = subprocess.run(cmd, capture_output=
True, encoding=
"utf8")
38 if result.returncode != 0:
40 print(f
"exit code: {result.returncode}")
45 raise Exception(
"failed to codesign")
48parser = optparse.OptionParser()
49parser.add_option(
"--identity", type=
"string", help=
"Code signing identity")
50parser.add_option(
"--binary",
53 help=
"Binary to sign")
54options = parser.parse_args()[0]
56if not options.identity:
57 raise Exception(
"Missing code signing identity (--identity)")
60 raise Exception(
"Missing binaries to sign (--binary)")
62for binary
in options.binary:
def SignBinary(identity, binary)
def print(*args, **kwargs)
static SkString join(const CommandLineFlags::StringArray &)