blob: f62919f6275509e0d3ccecbdb15c6e72c4dfb893 [file] [log] [blame]
Allen Webb09093e92019-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
11use chromeos_dbus_bindings::{self, generate_module};
12
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.
19const BINDINGS_TO_GENERATE: &[(&str, &str)] = &[
20 (
21 "org_chromium_authpolicy",
22 "authpolicy/dbus_bindings/org.chromium.AuthPolicy.xml",
23 ),
24 (
25 "org_chromium_debugd",
26 "debugd/dbus_bindings/org.chromium.debugd.xml",
27 ),
28 (
29 "org_chromium_sessionmanagerinterface",
30 "login_manager/dbus_bindings/org.chromium.SessionManagerInterface.xml",
31 ),
32];
33
34fn main() {
35 generate_module(Path::new(SOURCE_DIR), BINDINGS_TO_GENERATE).unwrap();
36}