MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / write_plist

Function write_plist

crates/chat-cli/build.rs:51–81  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49/// the binary.
50#[cfg(target_os = "macos")]
51fn write_plist() {
52 let plist = format!(
53 r#"<?xml version="1.0" encoding="UTF-8"?>
54<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
55<plist version="1.0">
56<dict>
57 <key>CFBundlePackageType</key>
58 <string>APPL</string>
59 <key>CFBundleIdentifier</key>
60 <string>{}</string>
61 <key>CFBundleName</key>
62 <string>{}</string>
63 <key>CFBundleVersion</key>
64 <string>{}</string>
65 <key>CFBundleShortVersionString</key>
66 <string>{}</string>
67 <key>CFBundleInfoDictionaryVersion</key>
68 <string>6.0</string>
69 <key>NSHumanReadableCopyright</key>
70 <string>Copyright © 2022 Amazon Q CLI Team (q-cli@amazon.com):Chay Nabors (nabochay@amazon.com):Brandon Kiser (bskiser@amazon.com) All rights reserved.</string>
71</dict>
72</plist>
73"#,
74 MACOS_BUNDLE_IDENTIFIER,
75 option_env!("AMAZON_Q_BUILD_HASH").unwrap_or("unknown"),
76 option_env!("AMAZON_Q_BUILD_DATETIME").unwrap_or("unknown"),
77 env!("CARGO_PKG_VERSION")
78 );
79
80 std::fs::write("src/Info.plist", plist).expect("writing the Info.plist should not fail");
81}
82
83fn main() {
84 println!("cargo:rerun-if-changed=def.json");

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected