diff options
author | Cole Faust <colefaust@google.com> | 2023-11-14 11:59:07 -0800 |
---|---|---|
committer | Cole Faust <colefaust@google.com> | 2023-11-14 11:59:07 -0800 |
commit | 68a3dea0c4193223a0349cb5de1461eae3c7566e (patch) | |
tree | 46c8c6c51a3bb51c7abadce4b9033025d596b15d | |
parent | 18fd6b73183cd59644c662d5b4bc844628db7f77 (diff) | |
download | uwb-68a3dea0c4193223a0349cb5de1461eae3c7566e.tar.gz |
Sandbox uwb genrules
go/roboleaf-busy-beavers-sandboxing
Bug: 307824623
Test: ./build/soong/tests/genrule_sandbox_test.py gen_uwb_core_proto uwb_core_artifacts
Change-Id: I3f45423d14ea15cbfb75237c9e8682e5919c77c9
-rwxr-xr-x | src/Android.bp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/Android.bp b/src/Android.bp index 16cb3a1..500bbd1 100755 --- a/src/Android.bp +++ b/src/Android.bp @@ -210,7 +210,6 @@ genrule { tools: ["aprotoc", "protoc-gen-rust"], cmd: "$(location aprotoc)" + " --proto_path=`dirname $(in)`" + - " --dependency_out=$(depfile)" + " --plugin=protoc-gen-rust=$(location protoc-gen-rust)" + " --rust_out=$(genDir) $(in)", srcs: [ @@ -219,7 +218,6 @@ genrule { out: [ "uwb_service.rs", ], - depfile: true, } genrule { @@ -363,23 +361,28 @@ genrule { "pdlc", "soong_zip", ], + srcs: [ + "rust/uwb_core/**/*", + "rust/uwb_uci_packets/**/*", + "rust/Cargo.toml", + ], cmd: // Create a artifacts directory and copy the source code into it. - "mkdir $(genDir)/artifacts;" + + "mkdir $(genDir)/artifacts && " + "cp -r external/uwb/src/rust/uwb_core " + " external/uwb/src/rust/uwb_uci_packets " + " external/uwb/src/rust/Cargo.toml " + - " $(genDir)/artifacts;" + + " $(genDir)/artifacts && " + // Generate uci_packets.rs at $(genDir)/artifacts/uwb_uci_packets/. "$(location pdlc) --output-format rust " + " external/uwb/src/rust/uwb_uci_packets/uci_packets.pdl " + - " > $(genDir)/artifacts/uwb_uci_packets/uci_packets.rs;" + + " > $(genDir)/artifacts/uwb_uci_packets/uci_packets.rs && " + // Pack the artifacts directory and clean up the directory. "$(location soong_zip) -o $(out) " + " -C $(genDir)/artifacts " + - " -D $(genDir)/artifacts;" + + " -D $(genDir)/artifacts && " + "rm -rf $(genDir)/artifacts", out: [ "uwb_core_artifacts.zip", |