1// Copyright (C) 2023 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
15package {
16    default_applicable_licenses: ["Android-Apache-2.0"],
17}
18
19android_library {
20    name: "adservices-cobalt",
21    sdk_version: "module_current",
22    min_sdk_version: "30",
23    srcs: [
24        "java/**/*.java",
25    ],
26    exclude_srcs: [
27        "java/**/testing/*.java",
28    ],
29    plugins: [
30        "androidx.room_room-compiler-plugin",
31        "auto_value_plugin",
32        "auto_annotation_plugin",
33    ],
34    javacflags: [
35        "-Aroom.schemaLocation=packages/modules/AdServices/adservices/libraries/cobalt/schemas",
36    ],
37    libs: [
38        "androidx.room_room-runtime",
39        "auto_value_annotations",
40        "framework-annotations-lib",
41    ],
42    static_libs: [
43        "adservices-cobalt-proto-lite",
44        "androidx.annotation_annotation",
45        "androidx.sqlite_sqlite",
46        "guava",
47        "libprotobuf-java-lite",
48    ],
49    apex_available: [
50        "com.android.adservices",
51        "com.android.extservices",
52    ],
53    lint: {
54        extra_check_modules: ["AdServicesProdLintChecker"],
55        disabled_checks: ["RoomDatabaseChange"], // TODO(b/329688645): Add Room DB migration guardrail tests.
56    },
57}
58
59android_library {
60    name: "adservices-cobalt-testing",
61    sdk_version: "module_current",
62    min_sdk_version: "30",
63    srcs: [
64        "java/**/testing/*.java",
65    ],
66    libs: [
67        "framework-annotations-lib",
68    ],
69    static_libs: [
70        "adservices-cobalt",
71        "adservices-cobalt-proto-lite",
72        "androidx.annotation_annotation",
73        "guava",
74        "libprotobuf-java-lite",
75    ],
76    apex_available: [
77        "com.android.adservices",
78        "com.android.extservices",
79    ],
80    lint: {
81        extra_check_modules: ["AdServicesProdLintChecker"],
82        disabled_checks: ["RoomDatabaseChange"], // TODO(b/329688645): Add Room DB migration guardrail tests.
83    },
84}
85
86// Schemas needs to be bundled via this android_library since Cobalt unit tests for schema
87// migration will need this.
88android_library {
89    name: "adservices-cobalt-schema",
90    sdk_version: "module_current",
91    min_sdk_version: "30",
92    asset_dirs: [
93        "schemas",
94    ],
95    manifest: "AndroidManifest.xml",
96}
97