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