blob: ca34a663ca67e5432e2973164d3504e68816f376 [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",
55 srcs: ["src/**/*.java"],
Tony Mak86f494d2019-11-18 16:34:08 +000056 manifest: "LibNoManifest_AndroidManifest.xml",
Tony Mak608b1ae2019-08-13 20:02:00 +010057 static_libs: [
58 "androidx.core_core",
59 "libtextclassifier-java",
60 "androidx.annotation_annotation",
61 "guava",
Tony Mak8cd7ba62019-10-15 15:29:22 +010062 "textclassifier-statsd",
63 "error_prone_annotations",
Tony Mak608b1ae2019-08-13 20:02:00 +010064 ],
65 sdk_version: "system_current",
Tony Mak8fbc8852020-11-02 14:39:03 +000066 min_sdk_version: "30",
Tony Mak9e2e6a92021-01-07 18:46:59 +000067 aaptflags: [
68 "-0 .model",
69 ],
70
Tony Mak608b1ae2019-08-13 20:02:00 +010071}
72
73java_library {
74 name: "textclassifier-statsd",
75 sdk_version: "system_current",
Tony Mak8fbc8852020-11-02 14:39:03 +000076 min_sdk_version: "30",
Tony Mak608b1ae2019-08-13 20:02:00 +010077 srcs: [
78 ":statslog-textclassifier-java-gen",
79 ],
80}
81
82genrule {
83 name: "statslog-textclassifier-java-gen",
84 tools: ["stats-log-api-gen"],
Muhammad Qureshi1a97ea02021-01-09 14:08:32 -080085 cmd: "$(location stats-log-api-gen) --java $(out) --module textclassifier" +
86 " --javaPackage com.android.textclassifier.common.statsd" +
87 " --javaClass TextClassifierStatsLog --minApiLevel 30",
Tony Makc96c0782020-08-24 22:45:06 +010088 out: ["com/android/textclassifier/common/statsd/TextClassifierStatsLog.java"],
Tony Mak608b1ae2019-08-13 20:02:00 +010089}