1// Copyright (C) 2018 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
15filegroup {
16    name: "libcarpowermanager_aidl",
17    srcs: [
18        "src/android/car/ICar.aidl",
19        "src/android/car/hardware/power/ICarPower.aidl",
20        "src/android/car/hardware/power/ICarPowerStateListener.aidl",
21    ],
22    path: "src",
23}
24
25cc_library {
26    name: "libcarpowermanager",
27    vendor_available: true,
28
29    aidl: {
30        export_aidl_headers: true,
31        local_include_dirs: [
32            "src",
33        ],
34    },
35
36    cflags: [
37        "-Wall",
38        "-Werror",
39        "-Wextra",
40        "-Wno-unused-parameter",
41    ],
42
43    include_dirs: [
44        "packages/services/Car/car-lib/native/include",
45    ],
46
47    shared_libs: [
48        "libbinder",
49        "liblog",
50        "libutils",
51    ],
52
53    srcs: [
54        ":libcarpowermanager_aidl",
55        "native/CarPowerManager/CarPowerManager.cpp",
56    ],
57}
58
59java_library {
60    name: "android.car.cluster.navigation",
61    proto: {
62        type: "lite",
63    },
64    static_libs: ["libprotobuf-java-lite"],
65    srcs: ["src/android/car/navigation/navigation_state.proto"]
66}
67
68// library to access settings from CarSettings
69java_library {
70    name: "android.car.settings",
71    srcs: ["src/android/car/settings/CarSettings.java"]
72}
73
74java_library {
75    name: "android.car",
76    srcs: [
77        "src/**/*.java",
78        "src/**/I*.aidl",
79    ],
80    aidl: {
81        include_dirs: [
82            "system/bt/binder",
83            "packages/services/Car/watchdog/aidl",
84        ],
85    },
86    exclude_srcs: [
87        "src/android/car/storagemonitoring/IoStats.aidl",
88        "src/android/car/storagemonitoring/IoStatsEntry.aidl",
89    ],
90    static_libs: [
91        "android.car.internal.event-log-tags",
92        "carwatchdog_aidl_interface-java",
93    ],
94    product_variables: {
95        pdk: {
96            enabled: false,
97        },
98    },
99    installable: true,
100}
101
102stubs_defaults {
103    name: "android.car-docs-default",
104    srcs: [
105        "src/**/*.java",
106    ],
107    libs: [
108        "android.car",
109    ],
110    product_variables: {
111        pdk: {
112            enabled: false,
113        },
114    },
115}
116
117genrule {
118    name: "android-car-last-released-api",
119    srcs: [
120        "api/released/*.txt",
121    ],
122    cmd: "cp -f $$(echo $(in) | tr \" \" \"\\n\" | sort -n | tail -1) $(genDir)/last-released-api.txt",
123    out: [
124        "last-released-api.txt",
125    ],
126}
127
128genrule {
129    name: "android-car-last-released-system-api",
130    srcs: [
131        "api/system-released/*.txt",
132    ],
133    cmd: "cp -f $$(echo $(in) | tr \" \" \"\\n\" | sort -n | tail -1) $(genDir)/last-released-system-api.txt",
134    out: [
135        "last-released-system-api.txt",
136    ],
137}
138
139droidstubs {
140    name: "android.car-stubs-docs",
141    defaults: ["android.car-docs-default"],
142    removed_dex_api_filename: "removed-dex.txt",
143    args: "--hide UnavailableSymbol --no-docs --stub-packages android.car* ",
144    installable: false,
145    check_api: {
146        last_released: {
147            api_file: ":android-car-last-released-api",
148            removed_api_file: "api/removed.txt",
149            args: " -hide 2 -hide 3 -hide 4 -hide 5 -hide 6 -hide 24 -hide 25 -hide 26 -hide 27 " +
150                " -warning 7 -warning 8 -warning 9 -warning 10 -warning 11 -warning 12 " +
151                " -warning 13 -warning 14 -warning 15 -warning 16 -warning 17 -warning 18 -hide 113 ",
152        },
153        current: {
154            api_file: "api/current.txt",
155            removed_api_file: "api/removed.txt",
156            args: " -error 2 -error 3 -error 4 -error 5 -error 6 -error 7 -error 8 -error 9 -error 10 -error 11 " +
157                " -error 12 -error 13 -error 14 -error 15 -error 16 -error 17 -error 18 -error 19 -error 20 " +
158                " -error 21 -error 23 -error 24 -error 25 -hide 113 ",
159        },
160        api_lint: {
161            enabled: true,
162            baseline_file: "api/lint-baseline.txt",
163        }
164    },
165}
166
167droidstubs {
168    name: "android.car-system-stubs-docs",
169    defaults: ["android.car-docs-default"],
170    removed_dex_api_filename: "system-removed-dex.txt",
171    args: "--hide UnavailableSymbol --no-docs --stub-packages android.car* " +
172        "--show-annotation android.annotation.SystemApi ",
173    installable: false,
174    check_api: {
175        last_released: {
176            api_file: ":android-car-last-released-system-api",
177            removed_api_file: "api/system-removed.txt",
178            args: " -hide 2 -hide 3 -hide 4 -hide 5 -hide 6 -hide 24 -hide 25 -hide 26 -hide 27 " +
179                " -warning 7 -warning 8 -warning 9 -warning 10 -warning 11 -warning 12 " +
180                " -warning 13 -warning 14 -warning 15 -warning 16 -warning 17 -warning 18 -hide 113 ",
181        },
182        current: {
183            api_file: "api/system-current.txt",
184            removed_api_file: "api/system-removed.txt",
185            args: " -error 2 -error 3 -error 4 -error 5 -error 6 -error 7 -error 8 -error 9 -error 10 -error 11 " +
186                " -error 12 -error 13 -error 14 -error 15 -error 16 -error 17 -error 18 -error 19 -error 20 " +
187                " -error 21 -error 23 -error 24 -error 25 -hide 113 ",
188        },
189        api_lint: {
190            enabled: true,
191            baseline_file: "api/system-lint-baseline.txt",
192        }
193    },
194}
195
196droidstubs {
197    name: "android.car-test-stubs-docs",
198    defaults: ["android.car-docs-default"],
199    args: "--hide HiddenSuperclass --hide UnavailableSymbol --no-docs --stub-packages android.car* " +
200        "--show-annotation android.annotation.TestApi ",
201    installable: false,
202    check_api: {
203        current: {
204            api_file: "api/test-current.txt",
205            removed_api_file: "api/test-removed.txt",
206            args: " -error 2 -error 3 -error 4 -error 5 -error 6 -error 7 -error 8 -error 9 -error 10 -error 11 " +
207                  " -error 12 -error 13 -error 14 -error 15 -error 16 -error 17 -error 18 -error 19 -error 20 " +
208                  " -error 21 -error 23 -error 24 -error 25 -hide 113 ",
209        },
210    },
211}
212
213droidstubs {
214    name: "android.car-stub-docs",
215    srcs: [
216        "src/**/*.java",
217    ],
218    libs: [
219        "android.car",
220    ],
221    api_filename: "api.txt",
222    args: "--hide HiddenSuperclass --hide UnavailableSymbol --no-docs --stub-packages android.car* ",
223    installable: false,
224    product_variables: {
225        pdk: {
226            enabled: false,
227        },
228    },
229}
230
231java_library {
232    name: "android.car-stubs",
233    srcs: [
234        ":android.car-stub-docs",
235    ],
236    sdk_version: "current",
237    product_variables: {
238        pdk: {
239            enabled: false,
240        },
241    },
242    installable: false,
243    dist: {
244        targets: ["dist_files"],
245    }
246}
247
248java_library {
249    name: "android.car-stubs-dex",
250    static_libs: ["android.car-stubs"],
251    sdk_version: "current",
252    product_variables: {
253        pdk: {
254            enabled: false,
255        },
256    },
257    compile_dex: true,
258}
259
260java_library {
261    name: "android.car-system-stubs",
262    srcs: [
263        ":android.car-system-stubs-docs",
264    ],
265    sdk_version: "system_current",
266    product_variables: {
267        pdk: {
268            enabled: false,
269        },
270    },
271    installable: false,
272    dist: {
273        targets: ["dist_files"],
274    }
275}
276
277java_library {
278    name: "android.car-system-stubs-dex",
279    static_libs: ["android.car-system-stubs"],
280    sdk_version: "system_current",
281    product_variables: {
282        pdk: {
283            enabled: false,
284        },
285    },
286    compile_dex: true,
287}
288
289java_library {
290    name: "android.car-test-stubs",
291    srcs: [
292        ":android.car-test-stubs-docs",
293    ],
294    sdk_version: "test_current",
295    product_variables: {
296        pdk: {
297            enabled: false,
298        },
299    },
300    installable: false,
301}
302
303java_library {
304    name: "android.car-test-stubs-dex",
305    static_libs: ["android.car-test-stubs"],
306    sdk_version: "test_current",
307    product_variables: {
308        pdk: {
309            enabled: false,
310        },
311    },
312    compile_dex: true,
313    dist: {
314        targets: ["dist_files"],
315    }
316}
317
318// Export the api/system-current.txt file.
319filegroup {
320    name: "car-api-system-current.txt",
321    visibility: [
322        "//cts/tests/signature/api",
323    ],
324    srcs: [
325        "api/system-current.txt",
326    ],
327}
328
329// Export the api/system-removed.txt file.
330filegroup {
331    name: "car-api-system-removed.txt",
332    visibility: [
333        "//cts/tests/signature/api",
334    ],
335    srcs: [
336        "api/system-removed.txt",
337    ],
338}
339