Avoid Rust source provider rule duplication
Until now, source provider modules duplicated the rule to generate the source for each variant. Add a inter-variant dependency between the source and the other variants (e.g. rlib, dylib) to avoid this duplication. Add documentation on this behaviour. Bug: 162588681 Test: m Change-Id: I41c9e2220f8875245415e17374852e540dfd47ec
This commit is contained in:
@@ -41,7 +41,7 @@ func TestRustBindgen(t *testing.T) {
|
||||
export_include_dirs: ["static_include"],
|
||||
}
|
||||
`)
|
||||
libbindgen := ctx.ModuleForTests("libbindgen", "android_arm64_armv8-a").Output("bindings.rs")
|
||||
libbindgen := ctx.ModuleForTests("libbindgen", "android_arm64_armv8-a_source").Output("bindings.rs")
|
||||
// Ensure that the flags are present and escaped
|
||||
if !strings.Contains(libbindgen.Args["flags"], "'--bindgen-flag.*'") {
|
||||
t.Errorf("missing bindgen flags in rust_bindgen rule: flags %#v", libbindgen.Args["flags"])
|
||||
@@ -73,7 +73,7 @@ func TestRustBindgenCustomBindgen(t *testing.T) {
|
||||
}
|
||||
`)
|
||||
|
||||
libbindgen := ctx.ModuleForTests("libbindgen", "android_arm64_armv8-a").Output("bindings.rs")
|
||||
libbindgen := ctx.ModuleForTests("libbindgen", "android_arm64_armv8-a_source").Output("bindings.rs")
|
||||
|
||||
// The rule description should contain the custom binary name rather than bindgen, so checking the description
|
||||
// should be sufficient.
|
||||
|
Reference in New Issue
Block a user