blob: 163512e269d6426b8e5cfa4da3cfb66697b529bb [file] [log] [blame]
Tony Mak608b1ae2019-08-13 20:02:00 +01001//
2// Copyright (C) 2019 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17// A standalone TextClassifierService app for testing.
18android_app {
19 name: "TextClassifierService",
20 static_libs: ["TextClassifierServiceLib"],
21 jni_libs: ["libtextclassifier"],
22 sdk_version: "system_current",
Tony Mak8fbc8852020-11-02 14:39:03 +000023 min_sdk_version: "30",
Tony Mak608b1ae2019-08-13 20:02:00 +010024 certificate: "platform",
25 optimize: {
26 proguard_flags_files: ["proguard.flags"],
27 },
28 use_embedded_native_libs: true,
29}
30
31// A library that contains all java classes with the AndroidManifest.
32android_library {
33 name: "TextClassifierServiceLib",
34 static_libs: ["TextClassifierServiceLibNoManifest"],
35 sdk_version: "system_current",
Tony Mak8fbc8852020-11-02 14:39:03 +000036 min_sdk_version: "30",
Tony Mak608b1ae2019-08-13 20:02:00 +010037 manifest: "AndroidManifest.xml",
Tony Mak9e2e6a92021-01-07 18:46:59 +000038 aaptflags: [
39 "-0 .model",
40 ],
Tony Mak608b1ae2019-08-13 20:02:00 +010041}
42
43// Similar to TextClassifierServiceLib, but without the AndroidManifest.
44android_library {
45 name: "TextClassifierServiceLibNoManifest",
46 srcs: ["src/**/*.java"],
Tony Mak86f494d2019-11-18 16:34:08 +000047 manifest: "LibNoManifest_AndroidManifest.xml",
Tony Mak608b1ae2019-08-13 20:02:00 +010048 static_libs: [
49 "androidx.core_core",
50 "libtextclassifier-java",
51 "androidx.annotation_annotation",
52 "guava",
Tony Mak8cd7ba62019-10-15 15:29:22 +010053 "textclassifier-statsd",
54 "error_prone_annotations",
Tony Mak608b1ae2019-08-13 20:02:00 +010055 ],
56 sdk_version: "system_current",
Tony Mak8fbc8852020-11-02 14:39:03 +000057 min_sdk_version: "30",
Tony Mak9e2e6a92021-01-07 18:46:59 +000058 aaptflags: [
59 "-0 .model",
60 ],
61
Tony Mak608b1ae2019-08-13 20:02:00 +010062}
63
64java_library {
65 name: "textclassifier-statsd",
66 sdk_version: "system_current",
Tony Mak8fbc8852020-11-02 14:39:03 +000067 min_sdk_version: "30",
Tony Mak608b1ae2019-08-13 20:02:00 +010068 srcs: [
69 ":statslog-textclassifier-java-gen",
70 ],
71}
72
73genrule {
74 name: "statslog-textclassifier-java-gen",
75 tools: ["stats-log-api-gen"],
Muhammad Qureshi1a97ea02021-01-09 14:08:32 -080076 cmd: "$(location stats-log-api-gen) --java $(out) --module textclassifier" +
77 " --javaPackage com.android.textclassifier.common.statsd" +
78 " --javaClass TextClassifierStatsLog --minApiLevel 30",
Tony Makc96c0782020-08-24 22:45:06 +010079 out: ["com/android/textclassifier/common/statsd/TextClassifierStatsLog.java"],
Tony Mak608b1ae2019-08-13 20:02:00 +010080}