blob: de6a2523d9de5ae383aa1660c1f730d2651d832a [file] [log] [blame]
Allen Webbed175c72019-09-25 10:36:34 -07001// 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
9use std::path::Path;
10
Allen Webb91bf46e2020-09-18 12:02:28 -070011use chromeos_dbus_bindings::{self, generate_module, BindingsType};
Allen Webbed175c72019-09-25 10:36:34 -070012
13// The parent path of system_api.
14const 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 Webb91bf46e2020-09-18 12:02:28 -070019const BINDINGS_TO_GENERATE: &[(&str, &str, BindingsType)] = &[
Allen Webbed175c72019-09-25 10:36:34 -070020 (
21 "org_chromium_authpolicy",
22 "authpolicy/dbus_bindings/org.chromium.AuthPolicy.xml",
Allen Webb91bf46e2020-09-18 12:02:28 -070023 BindingsType::Client,
Allen Webbed175c72019-09-25 10:36:34 -070024 ),
25 (
26 "org_chromium_debugd",
27 "debugd/dbus_bindings/org.chromium.debugd.xml",
Allen Webb91bf46e2020-09-18 12:02:28 -070028 BindingsType::Client,
Allen Webbed175c72019-09-25 10:36:34 -070029 ),
30 (
31 "org_chromium_sessionmanagerinterface",
32 "login_manager/dbus_bindings/org.chromium.SessionManagerInterface.xml",
Allen Webb91bf46e2020-09-18 12:02:28 -070033 BindingsType::Client,
Allen Webbed175c72019-09-25 10:36:34 -070034 ),
35];
36
37fn main() {
38 generate_module(Path::new(SOURCE_DIR), BINDINGS_TO_GENERATE).unwrap();
39}