summaryrefslogtreecommitdiff
path: root/adservices/service-core/Android.bp
blob: 13786cca158c50c68a89d0a95987fe9d3098f8a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// Copyright (C) 2022 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package {
    default_applicable_licenses: ["Android-Apache-2.0"],
}

genrule {
    name: "statslog-adservices-java-gen",
    tools: ["stats-log-api-gen"],
    cmd: "$(location stats-log-api-gen) --java $(out) --module adservices" +
         " --javaPackage com.android.adservices.service.stats --javaClass AdServicesStatsLog",
    out: ["com/android/adservices/service/stats/AdServicesStatsLog.java"],
}

filegroup {
    name: "adservices-service-core-sources",
    srcs: [
        "java/**/*.java",
    ],
    path: "java",
    visibility: [
        "//packages/modules/AdServices/adservices/tests:__subpackages__",
    ],
}

filegroup {
    name: "adservices-service-core-jni-sources",
    srcs: [
        "jni/java/**/*.java"
    ],
    path: "jni",
    visibility: [
        "//packages/modules/AdServices/adservices:__subpackages__",
    ],
}

android_library {
    name: "adservices-service-core",
    sdk_version: "module_current",
    min_sdk_version: "Tiramisu",
    srcs: [
        ":adservices-service-core-sources",
        ":adservices-service-core-jni-sources",
        ":statslog-adservices-java-gen",
    ],
    manifest: "AndroidManifest.xml",
    plugins: [
        "androidx.room_room-compiler-plugin",
        "auto_value_plugin",
        "auto_annotation_plugin"
    ],
    javacflags: [
        "-Aroom.schemaLocation=packages/modules/AdServices/adservices/service-core/schemas",
    ],
    libs: [
        "androidx.room_room-runtime",
        "framework-annotations-lib", // For @SystemApi, etc
        "framework-adservices.impl",
        "framework-sdksandbox.impl",
        "framework-statsd.stubs.module_lib", // For WW logging
        "jsr305",
        "auto_value_annotations"
    ],
    static_libs: [
        "androidx.concurrent_concurrent-futures",
        "androidx.annotation_annotation",
        "cbor-java",
        "guava",
        "mobile_data_downloader_lib",
        "modules-utils-preconditions",
        "tflite_support_classifiers_java",
        "mobile_data_downloader_lib",
        "androidx.webkit_webkit",
        "androidx.javascriptengine_javascriptengine",
        "adservices-proto-lite",
        "adservices-grpclib-lite",
    ],
    apex_available: ["com.android.adservices"],
}

cc_library_shared {
    name: "libhpke_jni",
    min_sdk_version: "33",
    sdk_version: "current",
    stl: "libc++_static",
    cflags: [
        "-Werror",
        "-Wno-unused-parameter",
        "-Wno-unused-but-set-variable",
    ],
    srcs: ["jni/cpp/hpke_jni.cpp"],
    include_dirs: ["packages/modules/AdServices/adservices/service-core/jni/include"],
    header_libs: [ "jni_headers"  ],
    shared_libs: ["libcrypto"],
    apex_available: ["com.android.adservices"],
    visibility: ["//packages/modules/AdServices:__subpackages__"],
}

// Schemas needs to be bundled via this android_library since service-core unit tests for schema
// migration will need this.
android_library {
    name: "adservices-service-core-schema",
    sdk_version: "module_current",
    min_sdk_version: "Tiramisu",
    asset_dirs: [
        "schemas",
    ],
    // Must use EmptyManifest.xml since this will be used by the service-core tests. If we use the
    // normal "AndroidManifest.xml", we may introduce potential error like redeclare permissions.
    // See b/228270294 for the error about duplicated permissions.
    manifest: "EmptyManifest.xml",
}