blob: 5948a17b715c806ff4c832b51620ff6b2a0ec96a [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.
Bob Badour8c96c742021-02-25 15:03:23 -080018package {
19 // See: http://go/android-license-faq
20 // A large-scale-change added 'default_applicable_licenses' to import
21 // all of the 'license_kinds' from "external_libtextclassifier_license"
22 // to get the below license kinds:
23 // SPDX-license-identifier-Apache-2.0
24 default_applicable_licenses: ["external_libtextclassifier_license"],
25}
26
Tony Mak608b1ae2019-08-13 20:02:00 +010027android_app {
28 name: "TextClassifierService",
29 static_libs: ["TextClassifierServiceLib"],
30 jni_libs: ["libtextclassifier"],
31 sdk_version: "system_current",
Tony Mak8fbc8852020-11-02 14:39:03 +000032 min_sdk_version: "30",
Tony Mak608b1ae2019-08-13 20:02:00 +010033 certificate: "platform",
34 optimize: {
35 proguard_flags_files: ["proguard.flags"],
36 },
37 use_embedded_native_libs: true,
38}
39
40// A library that contains all java classes with the AndroidManifest.
41android_library {
42 name: "TextClassifierServiceLib",
43 static_libs: ["TextClassifierServiceLibNoManifest"],
44 sdk_version: "system_current",
Tony Mak8fbc8852020-11-02 14:39:03 +000045 min_sdk_version: "30",
Tony Mak608b1ae2019-08-13 20:02:00 +010046 manifest: "AndroidManifest.xml",
Tony Mak9e2e6a92021-01-07 18:46:59 +000047 aaptflags: [
48 "-0 .model",
49 ],
Tony Mak608b1ae2019-08-13 20:02:00 +010050}
51
52// Similar to TextClassifierServiceLib, but without the AndroidManifest.
53android_library {
54 name: "TextClassifierServiceLibNoManifest",
Chang Li9175f302021-02-22 17:43:40 +000055 srcs: [
56 "src/**/*.java",
57 "src/**/*.aidl",
58 ],
Tony Mak86f494d2019-11-18 16:34:08 +000059 manifest: "LibNoManifest_AndroidManifest.xml",
Chang Lieae55cf2021-05-27 10:42:53 +000060 plugins: [
61 "auto_value_plugin",
62 "androidx.room_room-compiler-plugin",
63 ],
Tony Mak608b1ae2019-08-13 20:02:00 +010064 static_libs: [
65 "androidx.core_core",
66 "libtextclassifier-java",
67 "androidx.annotation_annotation",
68 "guava",
Tony Mak8cd7ba62019-10-15 15:29:22 +010069 "textclassifier-statsd",
70 "error_prone_annotations",
Chang Li9175f302021-02-22 17:43:40 +000071 "androidx.work_work-runtime",
72 "android_downloader_lib",
73 "textclassifier-statsd",
74 "textclassifier-java-proto-lite",
75 "androidx.concurrent_concurrent-futures",
Chang Lieae55cf2021-05-27 10:42:53 +000076 "auto_value_annotations",
77 "androidx.room_room-runtime",
Tony Mak608b1ae2019-08-13 20:02:00 +010078 ],
79 sdk_version: "system_current",
Tony Mak8fbc8852020-11-02 14:39:03 +000080 min_sdk_version: "30",
Tony Mak9e2e6a92021-01-07 18:46:59 +000081 aaptflags: [
82 "-0 .model",
83 ],
84
Tony Mak608b1ae2019-08-13 20:02:00 +010085}
86
87java_library {
88 name: "textclassifier-statsd",
89 sdk_version: "system_current",
Tony Mak8fbc8852020-11-02 14:39:03 +000090 min_sdk_version: "30",
Tony Mak608b1ae2019-08-13 20:02:00 +010091 srcs: [
92 ":statslog-textclassifier-java-gen",
93 ],
94}
95
96genrule {
97 name: "statslog-textclassifier-java-gen",
98 tools: ["stats-log-api-gen"],
Muhammad Qureshi1a97ea02021-01-09 14:08:32 -080099 cmd: "$(location stats-log-api-gen) --java $(out) --module textclassifier" +
100 " --javaPackage com.android.textclassifier.common.statsd" +
101 " --javaClass TextClassifierStatsLog --minApiLevel 30",
Tony Makc96c0782020-08-24 22:45:06 +0100102 out: ["com/android/textclassifier/common/statsd/TextClassifierStatsLog.java"],
Tony Mak608b1ae2019-08-13 20:02:00 +0100103}