1*c2e18aaaSAndroid Build Coastguard Worker// Copyright (C) 2019 The Android Open Source Project 2*c2e18aaaSAndroid Build Coastguard Worker// 3*c2e18aaaSAndroid Build Coastguard Worker// Licensed under the Apache License, Version 2.0 (the "License"); 4*c2e18aaaSAndroid Build Coastguard Worker// you may not use this file except in compliance with the License. 5*c2e18aaaSAndroid Build Coastguard Worker// You may obtain a copy of the License at 6*c2e18aaaSAndroid Build Coastguard Worker// 7*c2e18aaaSAndroid Build Coastguard Worker// http://www.apache.org/licenses/LICENSE-2.0 8*c2e18aaaSAndroid Build Coastguard Worker// 9*c2e18aaaSAndroid Build Coastguard Worker// Unless required by applicable law or agreed to in writing, software 10*c2e18aaaSAndroid Build Coastguard Worker// distributed under the License is distributed on an "AS IS" BASIS, 11*c2e18aaaSAndroid Build Coastguard Worker// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12*c2e18aaaSAndroid Build Coastguard Worker// See the License for the specific language governing permissions and 13*c2e18aaaSAndroid Build Coastguard Worker// limitations under the License. 14*c2e18aaaSAndroid Build Coastguard Worker 15*c2e18aaaSAndroid Build Coastguard Workerrust_test_host { 16*c2e18aaaSAndroid Build Coastguard Worker name: "adevice_test", 17*c2e18aaaSAndroid Build Coastguard Worker srcs: [ 18*c2e18aaaSAndroid Build Coastguard Worker "src/lib.rs", 19*c2e18aaaSAndroid Build Coastguard Worker ], 20*c2e18aaaSAndroid Build Coastguard Worker defaults: ["adevice_deps_defaults"], 21*c2e18aaaSAndroid Build Coastguard Worker rustlibs: ["libgoogletest_rust"], 22*c2e18aaaSAndroid Build Coastguard Worker test_options: { 23*c2e18aaaSAndroid Build Coastguard Worker unit_test: true, 24*c2e18aaaSAndroid Build Coastguard Worker }, 25*c2e18aaaSAndroid Build Coastguard Worker test_suites: ["general-tests"], 26*c2e18aaaSAndroid Build Coastguard Worker} 27*c2e18aaaSAndroid Build Coastguard Worker 28*c2e18aaaSAndroid Build Coastguard Workerrust_binary_host { 29*c2e18aaaSAndroid Build Coastguard Worker name: "adevice", 30*c2e18aaaSAndroid Build Coastguard Worker srcs: [ 31*c2e18aaaSAndroid Build Coastguard Worker "src/main.rs", 32*c2e18aaaSAndroid Build Coastguard Worker ], 33*c2e18aaaSAndroid Build Coastguard Worker defaults: ["adevice_deps_defaults"], 34*c2e18aaaSAndroid Build Coastguard Worker} 35*c2e18aaaSAndroid Build Coastguard Worker 36*c2e18aaaSAndroid Build Coastguard Workerrust_binary { 37*c2e18aaaSAndroid Build Coastguard Worker name: "adevice_fingerprint", 38*c2e18aaaSAndroid Build Coastguard Worker srcs: [ 39*c2e18aaaSAndroid Build Coastguard Worker "src/adevice_fingerprint.rs", 40*c2e18aaaSAndroid Build Coastguard Worker ], 41*c2e18aaaSAndroid Build Coastguard Worker defaults: ["adevice_deps_defaults"], 42*c2e18aaaSAndroid Build Coastguard Worker static_executable: true, 43*c2e18aaaSAndroid Build Coastguard Worker} 44*c2e18aaaSAndroid Build Coastguard Worker 45*c2e18aaaSAndroid Build Coastguard Workerrust_test { 46*c2e18aaaSAndroid Build Coastguard Worker name: "adevice_fingerprint_test", 47*c2e18aaaSAndroid Build Coastguard Worker auto_gen_config: true, 48*c2e18aaaSAndroid Build Coastguard Worker defaults: ["adevice_deps_defaults"], 49*c2e18aaaSAndroid Build Coastguard Worker srcs: [ 50*c2e18aaaSAndroid Build Coastguard Worker "src/adevice_fingerprint.rs", 51*c2e18aaaSAndroid Build Coastguard Worker ], 52*c2e18aaaSAndroid Build Coastguard Worker rustlibs: ["libgoogletest_rust"], 53*c2e18aaaSAndroid Build Coastguard Worker static_executable: true, 54*c2e18aaaSAndroid Build Coastguard Worker test_suites: ["general-tests"], 55*c2e18aaaSAndroid Build Coastguard Worker test_options: { 56*c2e18aaaSAndroid Build Coastguard Worker unit_test: true, 57*c2e18aaaSAndroid Build Coastguard Worker }, 58*c2e18aaaSAndroid Build Coastguard Worker} 59*c2e18aaaSAndroid Build Coastguard Worker 60*c2e18aaaSAndroid Build Coastguard Workerrust_protobuf { 61*c2e18aaaSAndroid Build Coastguard Worker name: "libadevice_proto_rust", 62*c2e18aaaSAndroid Build Coastguard Worker crate_name: "adevice_proto", 63*c2e18aaaSAndroid Build Coastguard Worker host_supported: true, 64*c2e18aaaSAndroid Build Coastguard Worker source_stem: "adevice_proto", 65*c2e18aaaSAndroid Build Coastguard Worker protos: [ 66*c2e18aaaSAndroid Build Coastguard Worker "src/protos/clientanalytics.proto", 67*c2e18aaaSAndroid Build Coastguard Worker "src/protos/user_log.proto", 68*c2e18aaaSAndroid Build Coastguard Worker ], 69*c2e18aaaSAndroid Build Coastguard Worker} 70*c2e18aaaSAndroid Build Coastguard Worker 71*c2e18aaaSAndroid Build Coastguard Workerrust_library { 72*c2e18aaaSAndroid Build Coastguard Worker name: "libadevice", 73*c2e18aaaSAndroid Build Coastguard Worker srcs: ["src/lib.rs"], 74*c2e18aaaSAndroid Build Coastguard Worker crate_name: "adevice", 75*c2e18aaaSAndroid Build Coastguard Worker defaults: ["adevice_deps_defaults"], 76*c2e18aaaSAndroid Build Coastguard Worker host_supported: true, 77*c2e18aaaSAndroid Build Coastguard Worker lints: "none", 78*c2e18aaaSAndroid Build Coastguard Worker} 79*c2e18aaaSAndroid Build Coastguard Worker 80*c2e18aaaSAndroid Build Coastguard Workerrust_defaults { 81*c2e18aaaSAndroid Build Coastguard Worker name: "adevice_deps_defaults", 82*c2e18aaaSAndroid Build Coastguard Worker rustlibs: [ 83*c2e18aaaSAndroid Build Coastguard Worker "libadevice_proto_rust", 84*c2e18aaaSAndroid Build Coastguard Worker "libanyhow", 85*c2e18aaaSAndroid Build Coastguard Worker "libatty", 86*c2e18aaaSAndroid Build Coastguard Worker "libclap", 87*c2e18aaaSAndroid Build Coastguard Worker "libhex", 88*c2e18aaaSAndroid Build Coastguard Worker "libitertools", 89*c2e18aaaSAndroid Build Coastguard Worker "librayon", 90*c2e18aaaSAndroid Build Coastguard Worker "libregex", 91*c2e18aaaSAndroid Build Coastguard Worker "libring", 92*c2e18aaaSAndroid Build Coastguard Worker "libserde", 93*c2e18aaaSAndroid Build Coastguard Worker "libserde_json", 94*c2e18aaaSAndroid Build Coastguard Worker "libtempfile", 95*c2e18aaaSAndroid Build Coastguard Worker "libtracing", 96*c2e18aaaSAndroid Build Coastguard Worker "libtracing_subscriber", 97*c2e18aaaSAndroid Build Coastguard Worker "libwalkdir", 98*c2e18aaaSAndroid Build Coastguard Worker "libprotobuf", 99*c2e18aaaSAndroid Build Coastguard Worker "libuuid", 100*c2e18aaaSAndroid Build Coastguard Worker ], 101*c2e18aaaSAndroid Build Coastguard Worker} 102*c2e18aaaSAndroid Build Coastguard Worker 103*c2e18aaaSAndroid Build Coastguard Worker// Automate as much of the tool invocation testing that we can. 104*c2e18aaaSAndroid Build Coastguard Worker// It is still TBD what we will do to inject a product out tree 105*c2e18aaaSAndroid Build Coastguard Worker// and a device in CI. 106*c2e18aaaSAndroid Build Coastguard Workersh_test_host { 107*c2e18aaaSAndroid Build Coastguard Worker name: "adevice_integration_test", 108*c2e18aaaSAndroid Build Coastguard Worker src: "adevice_integration_test.sh", 109*c2e18aaaSAndroid Build Coastguard Worker data_bins: [ 110*c2e18aaaSAndroid Build Coastguard Worker "adevice", 111*c2e18aaaSAndroid Build Coastguard Worker ], 112*c2e18aaaSAndroid Build Coastguard Worker test_suites: ["general-tests"], 113*c2e18aaaSAndroid Build Coastguard Worker} 114*c2e18aaaSAndroid Build Coastguard Worker 115*c2e18aaaSAndroid Build Coastguard Workerrust_test { 116*c2e18aaaSAndroid Build Coastguard Worker name: "adevice_whole_program_test", 117*c2e18aaaSAndroid Build Coastguard Worker auto_gen_config: true, 118*c2e18aaaSAndroid Build Coastguard Worker defaults: ["adevice_deps_defaults"], 119*c2e18aaaSAndroid Build Coastguard Worker srcs: [ 120*c2e18aaaSAndroid Build Coastguard Worker "tests/whole_program_tests.rs", 121*c2e18aaaSAndroid Build Coastguard Worker ], 122*c2e18aaaSAndroid Build Coastguard Worker rustlibs: [ 123*c2e18aaaSAndroid Build Coastguard Worker "libgoogletest_rust", 124*c2e18aaaSAndroid Build Coastguard Worker "libadevice", 125*c2e18aaaSAndroid Build Coastguard Worker ], 126*c2e18aaaSAndroid Build Coastguard Worker static_executable: true, 127*c2e18aaaSAndroid Build Coastguard Worker test_suites: ["general-tests"], 128*c2e18aaaSAndroid Build Coastguard Worker test_options: { 129*c2e18aaaSAndroid Build Coastguard Worker unit_test: true, 130*c2e18aaaSAndroid Build Coastguard Worker }, 131*c2e18aaaSAndroid Build Coastguard Worker} 132*c2e18aaaSAndroid Build Coastguard Worker 133*c2e18aaaSAndroid Build Coastguard Workerrust_test { 134*c2e18aaaSAndroid Build Coastguard Worker name: "adevice_partial_program_test", 135*c2e18aaaSAndroid Build Coastguard Worker auto_gen_config: true, 136*c2e18aaaSAndroid Build Coastguard Worker defaults: ["adevice_deps_defaults"], 137*c2e18aaaSAndroid Build Coastguard Worker srcs: [ 138*c2e18aaaSAndroid Build Coastguard Worker "tests/partial_program_tests.rs", 139*c2e18aaaSAndroid Build Coastguard Worker ], 140*c2e18aaaSAndroid Build Coastguard Worker rustlibs: [ 141*c2e18aaaSAndroid Build Coastguard Worker "libgoogletest_rust", 142*c2e18aaaSAndroid Build Coastguard Worker "libadevice", 143*c2e18aaaSAndroid Build Coastguard Worker ], 144*c2e18aaaSAndroid Build Coastguard Worker static_executable: true, 145*c2e18aaaSAndroid Build Coastguard Worker test_suites: ["general-tests"], 146*c2e18aaaSAndroid Build Coastguard Worker test_options: { 147*c2e18aaaSAndroid Build Coastguard Worker unit_test: true, 148*c2e18aaaSAndroid Build Coastguard Worker }, 149*c2e18aaaSAndroid Build Coastguard Worker} 150