Allen Webb | ed175c7 | 2019-09-25 10:36:34 -0700 | [diff] [blame] | 1 | // Copyright 2019 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | // Generates the Rust D-Bus bindings for system_api. The generated bindings are included in the |
| 6 | // published crate since the source XML files are only available from the original path or the |
| 7 | // ebuild. |
| 8 | |
| 9 | use std::path::Path; |
| 10 | |
Allen Webb | 91bf46e | 2020-09-18 12:02:28 -0700 | [diff] [blame] | 11 | use chromeos_dbus_bindings::{self, generate_module, BindingsType}; |
Allen Webb | ed175c7 | 2019-09-25 10:36:34 -0700 | [diff] [blame] | 12 | |
| 13 | // The parent path of system_api. |
| 14 | const SOURCE_DIR: &str = ".."; |
| 15 | |
| 16 | // (<module name>, <relative path to source xml>) |
| 17 | // When adding additional bindings, remember to include the source project and subtree in the |
| 18 | // ebuild. Otherwise, the source files will not be accessible when building system_api-rust. |
Allen Webb | 91bf46e | 2020-09-18 12:02:28 -0700 | [diff] [blame] | 19 | const BINDINGS_TO_GENERATE: &[(&str, &str, BindingsType)] = &[ |
Allen Webb | ed175c7 | 2019-09-25 10:36:34 -0700 | [diff] [blame] | 20 | ( |
| 21 | "org_chromium_authpolicy", |
| 22 | "authpolicy/dbus_bindings/org.chromium.AuthPolicy.xml", |
Allen Webb | 91bf46e | 2020-09-18 12:02:28 -0700 | [diff] [blame] | 23 | BindingsType::Client, |
Allen Webb | ed175c7 | 2019-09-25 10:36:34 -0700 | [diff] [blame] | 24 | ), |
| 25 | ( |
| 26 | "org_chromium_debugd", |
| 27 | "debugd/dbus_bindings/org.chromium.debugd.xml", |
Allen Webb | 91bf46e | 2020-09-18 12:02:28 -0700 | [diff] [blame] | 28 | BindingsType::Client, |
Allen Webb | ed175c7 | 2019-09-25 10:36:34 -0700 | [diff] [blame] | 29 | ), |
| 30 | ( |
Jie Jiang | ca887ae | 2021-06-03 21:04:58 +0900 | [diff] [blame] | 31 | "org_chromium_flimflam_manager", |
| 32 | "shill/dbus_bindings/org.chromium.flimflam.Manager.dbus-xml", |
| 33 | BindingsType::Client, |
| 34 | ), |
| 35 | ( |
| 36 | "org_chromium_flimflam_service", |
| 37 | "shill/dbus_bindings/org.chromium.flimflam.Service.dbus-xml", |
| 38 | BindingsType::Client, |
| 39 | ), |
| 40 | ( |
Allen Webb | ed175c7 | 2019-09-25 10:36:34 -0700 | [diff] [blame] | 41 | "org_chromium_sessionmanagerinterface", |
| 42 | "login_manager/dbus_bindings/org.chromium.SessionManagerInterface.xml", |
Allen Webb | 91bf46e | 2020-09-18 12:02:28 -0700 | [diff] [blame] | 43 | BindingsType::Client, |
Allen Webb | ed175c7 | 2019-09-25 10:36:34 -0700 | [diff] [blame] | 44 | ), |
Ryo Hashimoto | 9976901 | 2021-07-08 20:34:43 +0900 | [diff] [blame^] | 45 | ( |
| 46 | "org_chromium_userdataauth", |
| 47 | "cryptohome/dbus_bindings/org.chromium.UserDataAuth.xml", |
| 48 | BindingsType::Client, |
| 49 | ), |
Allen Webb | ed175c7 | 2019-09-25 10:36:34 -0700 | [diff] [blame] | 50 | ]; |
| 51 | |
| 52 | fn main() { |
| 53 | generate_module(Path::new(SOURCE_DIR), BINDINGS_TO_GENERATE).unwrap(); |
| 54 | } |