Tony Mak | 608b1ae | 2019-08-13 20:02:00 +0100 | [diff] [blame] | 1 | // |
| 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. |
| 18 | android_app { |
| 19 | name: "TextClassifierService", |
| 20 | static_libs: ["TextClassifierServiceLib"], |
| 21 | jni_libs: ["libtextclassifier"], |
| 22 | sdk_version: "system_current", |
| 23 | min_sdk_version: "28", |
| 24 | 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. |
| 32 | android_library { |
| 33 | name: "TextClassifierServiceLib", |
| 34 | static_libs: ["TextClassifierServiceLibNoManifest"], |
| 35 | sdk_version: "system_current", |
| 36 | min_sdk_version: "28", |
| 37 | manifest: "AndroidManifest.xml", |
| 38 | } |
| 39 | |
| 40 | // Similar to TextClassifierServiceLib, but without the AndroidManifest. |
| 41 | android_library { |
| 42 | name: "TextClassifierServiceLibNoManifest", |
| 43 | srcs: ["src/**/*.java"], |
Tony Mak | 86f494d | 2019-11-18 16:34:08 +0000 | [diff] [blame] | 44 | manifest: "LibNoManifest_AndroidManifest.xml", |
Tony Mak | 608b1ae | 2019-08-13 20:02:00 +0100 | [diff] [blame] | 45 | static_libs: [ |
| 46 | "androidx.core_core", |
| 47 | "libtextclassifier-java", |
| 48 | "androidx.annotation_annotation", |
| 49 | "guava", |
Tony Mak | 8cd7ba6 | 2019-10-15 15:29:22 +0100 | [diff] [blame] | 50 | "textclassifier-statsd", |
| 51 | "error_prone_annotations", |
Tony Mak | 608b1ae | 2019-08-13 20:02:00 +0100 | [diff] [blame] | 52 | ], |
| 53 | sdk_version: "system_current", |
| 54 | min_sdk_version: "28", |
Tony Mak | 608b1ae | 2019-08-13 20:02:00 +0100 | [diff] [blame] | 55 | } |
| 56 | |
| 57 | java_library { |
| 58 | name: "textclassifier-statsd", |
| 59 | sdk_version: "system_current", |
| 60 | srcs: [ |
| 61 | ":statslog-textclassifier-java-gen", |
| 62 | ], |
| 63 | } |
| 64 | |
| 65 | genrule { |
| 66 | name: "statslog-textclassifier-java-gen", |
| 67 | tools: ["stats-log-api-gen"], |
Tony Mak | c96c078 | 2020-08-24 22:45:06 +0100 | [diff] [blame] | 68 | cmd: "$(location stats-log-api-gen) --java $(out) --module textclassifier --javaPackage com.android.textclassifier.common.statsd --javaClass TextClassifierStatsLog", |
| 69 | out: ["com/android/textclassifier/common/statsd/TextClassifierStatsLog.java"], |
Tony Mak | 608b1ae | 2019-08-13 20:02:00 +0100 | [diff] [blame] | 70 | } |