Dan Harms | 25fbf1b | 2019-07-25 16:09:17 -0700 | [diff] [blame] | 1 | // Copyright (C) 2019 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 | // |
| 15 | // |
| 16 | |
| 17 | // Build the Car service. |
| 18 | |
Muhammad Qureshi | 94524cd | 2020-01-25 23:47:38 -0800 | [diff] [blame] | 19 | genrule { |
| 20 | name: "statslog-Car-java-gen", |
| 21 | tools: ["stats-log-api-gen"], |
| 22 | cmd: "$(location stats-log-api-gen) --java $(out) --module car --javaPackage com.android.car" |
| 23 | + " --javaClass CarStatsLog", |
| 24 | out: ["com/android/car/CarStatsLog.java"], |
| 25 | } |
| 26 | |
| 27 | car_service_sources = [ |
| 28 | "src/**/*.java", |
| 29 | ":statslog-Car-java-gen", |
| 30 | ] |
Dan Harms | 25fbf1b | 2019-07-25 16:09:17 -0700 | [diff] [blame] | 31 | |
tadvana | f7746cd | 2019-10-04 16:02:56 -0700 | [diff] [blame] | 32 | common_lib_deps = [ |
| 33 | "android.car.userlib", |
Eric Jeong | 6df075f | 2020-03-11 16:12:23 -0700 | [diff] [blame^] | 34 | "android.car.watchdoglib", |
tadvana | f7746cd | 2019-10-04 16:02:56 -0700 | [diff] [blame] | 35 | "android.hidl.base-V1.0-java", |
| 36 | "android.hardware.automotive.audiocontrol-V1.0-java", |
| 37 | "android.hardware.automotive.vehicle-V2.0-java", |
| 38 | "android.hardware.health-V1.0-java", |
| 39 | "android.hardware.health-V2.0-java", |
Michael Keller | c0f0bdb | 2019-12-11 14:58:19 -0800 | [diff] [blame] | 40 | "android.hardware.automotive.occupant_awareness-java", |
tadvana | f7746cd | 2019-10-04 16:02:56 -0700 | [diff] [blame] | 41 | "vehicle-hal-support-lib", |
| 42 | "car-systemtest", |
| 43 | "com.android.car.procfsinspector-client", |
| 44 | "blestream-protos", |
| 45 | "SettingsLib", |
| 46 | "androidx.preference_preference", |
| 47 | "EncryptionRunner", |
| 48 | ] |
| 49 | |
Dan Harms | 25fbf1b | 2019-07-25 16:09:17 -0700 | [diff] [blame] | 50 | android_app { |
| 51 | name: "CarService", |
| 52 | |
| 53 | srcs: car_service_sources, |
| 54 | |
| 55 | resource_dirs: ["res"], |
| 56 | |
| 57 | platform_apis: true, |
| 58 | |
| 59 | // Each update should be signed by OEMs |
| 60 | certificate: "platform", |
| 61 | privileged: true, |
| 62 | |
| 63 | optimize: { |
| 64 | proguard_flags_files: ["proguard.flags"], |
| 65 | enabled: false, |
| 66 | }, |
| 67 | |
| 68 | libs: ["android.car"], |
| 69 | |
tadvana | f7746cd | 2019-10-04 16:02:56 -0700 | [diff] [blame] | 70 | static_libs: common_lib_deps + [ |
Dan Harms | 25fbf1b | 2019-07-25 16:09:17 -0700 | [diff] [blame] | 71 | "car-frameworks-service", |
Dan Harms | 25fbf1b | 2019-07-25 16:09:17 -0700 | [diff] [blame] | 72 | ], |
| 73 | |
| 74 | required: ["privapp_whitelist_com.android.car"], |
| 75 | |
| 76 | // Disable build in PDK, missing aidl import breaks build |
| 77 | product_variables: { |
| 78 | pdk: { |
| 79 | enabled: false, |
| 80 | }, |
| 81 | }, |
| 82 | } |
| 83 | |
Keun young Park | 9a91efb | 2019-11-15 18:10:47 -0800 | [diff] [blame] | 84 | java_library { |
| 85 | |
| 86 | name: "car-service-common-util-static-lib", |
| 87 | |
| 88 | srcs: [ |
| 89 | "src/com/android/car/CarServiceBase.java", |
| 90 | "src/com/android/car/CarServiceUtils.java", |
| 91 | "src/com/android/car/CarLog.java", |
Jordan Jozwiak | 9789ac5 | 2019-12-06 16:52:26 -0800 | [diff] [blame] | 92 | "src/com/android/car/Utils.java", |
Keun young Park | 9a91efb | 2019-11-15 18:10:47 -0800 | [diff] [blame] | 93 | ], |
| 94 | |
| 95 | product_variables: { |
| 96 | pdk: { |
| 97 | enabled: false, |
| 98 | }, |
| 99 | }, |
| 100 | } |
| 101 | |
Dan Harms | 25fbf1b | 2019-07-25 16:09:17 -0700 | [diff] [blame] | 102 | //#################################################################################### |
tadvana | f7746cd | 2019-10-04 16:02:56 -0700 | [diff] [blame] | 103 | // Build a static library to help mocking various car services in testing. This is meant to be used |
| 104 | // for internal unit tests around the car service. |
Dan Harms | 25fbf1b | 2019-07-25 16:09:17 -0700 | [diff] [blame] | 105 | //#################################################################################### |
| 106 | android_library { |
tadvana | f7746cd | 2019-10-04 16:02:56 -0700 | [diff] [blame] | 107 | name: "car-service-test-static-lib", |
Dan Harms | 25fbf1b | 2019-07-25 16:09:17 -0700 | [diff] [blame] | 108 | |
| 109 | srcs: car_service_sources, |
| 110 | |
| 111 | resource_dirs: ["res"], |
| 112 | |
| 113 | libs: [ |
| 114 | "android.car", |
| 115 | "car-frameworks-service", |
| 116 | ], |
| 117 | |
tadvana | f7746cd | 2019-10-04 16:02:56 -0700 | [diff] [blame] | 118 | static_libs: common_lib_deps, |
| 119 | |
| 120 | min_sdk_version: "25", |
| 121 | |
| 122 | product_variables: { |
| 123 | pdk: { |
| 124 | enabled: false, |
| 125 | }, |
| 126 | }, |
| 127 | } |
| 128 | |
| 129 | //#################################################################################### |
| 130 | // Build a library to help generate a testing library for external apps. |
| 131 | // We do not want to use statically linked libraries, as this will bloat the output jar with classes |
| 132 | // that can conflict with the user's environment. |
| 133 | //#################################################################################### |
| 134 | android_library { |
| 135 | name: "car-service-test-lib", |
| 136 | |
| 137 | srcs: car_service_sources, |
| 138 | |
| 139 | resource_dirs: ["res"], |
| 140 | |
| 141 | libs: common_lib_deps + [ |
| 142 | "android.car", |
| 143 | "car-frameworks-service", |
Dan Harms | 25fbf1b | 2019-07-25 16:09:17 -0700 | [diff] [blame] | 144 | ], |
| 145 | |
| 146 | min_sdk_version: "25", |
| 147 | |
| 148 | product_variables: { |
| 149 | pdk: { |
| 150 | enabled: false, |
| 151 | }, |
| 152 | }, |
| 153 | } |
tadvana | f7746cd | 2019-10-04 16:02:56 -0700 | [diff] [blame] | 154 | |