summaryrefslogtreecommitdiff
path: root/rust/bindgen.go
diff options
context:
space:
mode:
author Ivan Lozano <ivanlozano@google.com> 2020-07-22 16:48:53 -0400
committer Ivan Lozano <ivanlozano@google.com> 2020-07-22 16:51:33 -0400
commitec54eec571eb1b38cc8e56dc1eb8e08d53f86472 (patch)
treed285e312c2a0d0c529a492f02fcc426be9456a05 /rust/bindgen.go
parent188f2ee1eed92a3bc384128354ef71c9da177062 (diff)
Call rustfmt on rust_bindgen bindings.
This makes debugging easier when the bindings contain errors. Bug: 161730753 Test: Generated bindings are formatted. Change-Id: Ic46f69d8b6d07b4dc6912b7f02d7427ea6c11cde
Diffstat (limited to 'rust/bindgen.go')
-rw-r--r--rust/bindgen.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/rust/bindgen.go b/rust/bindgen.go
index 859223abf..24382a04b 100644
--- a/rust/bindgen.go
+++ b/rust/bindgen.go
@@ -24,7 +24,7 @@ import (
)
var (
- defaultBindgenFlags = []string{"--no-rustfmt-bindings"}
+ defaultBindgenFlags = []string{""}
// bindgen should specify its own Clang revision so updating Clang isn't potentially blocked on bindgen failures.
bindgenClangVersion = "clang-r383902c"
@@ -40,7 +40,8 @@ var (
//TODO(ivanlozano) Switch this to RuleBuilder
bindgen = pctx.AndroidStaticRule("bindgen",
blueprint.RuleParams{
- Command: "CLANG_PATH=$bindgenClang LIBCLANG_PATH=$bindgenLibClang $bindgenCmd $flags $in -o $out -- $cflags",
+ Command: "CLANG_PATH=$bindgenClang LIBCLANG_PATH=$bindgenLibClang RUSTFMT=${config.RustBin}/rustfmt " +
+ "$bindgenCmd $flags $in -o $out -- $cflags",
CommandDeps: []string{"$bindgenCmd"},
},
"flags", "cflags")