1// Copyright (C) 2025 The Android Open Source Project 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15rust_binary { 16 name: "hello-world-service-test", 17 srcs: [ 18 "service_main.rs", 19 ], 20 rustlibs: [ 21 "libhello_service", 22 "libbinder_rs", 23 "liblog_rust", 24 // The generated AIDL libraries have the backend appended to the 25 // end of the name. 26 // `hello.world-<backend>`. In this case the backend is `rust` 27 "hello.world-rust", 28 ], 29 init_rc: ["hello-world-service-test.rc"], 30} 31 32rust_fuzz { 33 name: "hello-world-fuzzer", 34 srcs: ["service_fuzzer.rs"], 35 // These fuzzer defaults have everything needed for the service fuzzer outside 36 // of the specific dependencies of this service. 37 defaults: ["service_fuzzer_defaults_rs"], 38 rustlibs: [ 39 "libhello_service", 40 "liblog_rust", 41 "hello.world-rust", 42 ], 43} 44 45// Implementation of the interface. This is in its own library 46// so we can use it for the service on the device AND use it in the fuzzer 47// to find bugs. 48rust_library { 49 name: "libhello_service", 50 crate_name: "hello_service", 51 srcs: ["hello_service.rs"], 52 rustlibs: [ 53 "libbinder_rs", 54 "liblog_rust", 55 "hello.world-rust", 56 ], 57} 58