Matt Banda | 276df84 | 2020-06-30 14:57:35 -0700 | [diff] [blame] | 1 | // Copyright (C) 2020 The Android Open Source Project |
Kun Niu | 7fa228a | 2019-06-27 11:07:31 -0700 | [diff] [blame] | 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
Bob Badour | 161d90c | 2021-02-03 23:26:39 -0800 | [diff] [blame] | 15 | package { |
| 16 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 17 | } |
| 18 | |
Kun Niu | 7fa228a | 2019-06-27 11:07:31 -0700 | [diff] [blame] | 19 | java_plugin { |
| 20 | name: "java_api_finder", |
| 21 | |
| 22 | static_libs: [ |
| 23 | "java_api_used_by_mainline_module", |
| 24 | ], |
| 25 | } |
| 26 | |
| 27 | java_library_host { |
| 28 | name: "java_api_used_by_mainline_module", |
| 29 | |
| 30 | srcs: ["src/main/**/*.java"], |
| 31 | |
| 32 | static_libs: [ |
| 33 | "//external/error_prone:error_prone_core", |
Colin Cross | 84052f2 | 2020-06-25 20:36:30 -0700 | [diff] [blame] | 34 | ], |
| 35 | |
| 36 | libs: [ |
| 37 | "//external/auto:auto_service_annotations", |
Kun Niu | 7fa228a | 2019-06-27 11:07:31 -0700 | [diff] [blame] | 38 | ], |
| 39 | |
| 40 | plugins: [ |
Colin Cross | 84052f2 | 2020-06-25 20:36:30 -0700 | [diff] [blame] | 41 | "//external/auto:auto_service_plugin", |
Kun Niu | 7fa228a | 2019-06-27 11:07:31 -0700 | [diff] [blame] | 42 | ], |
| 43 | |
| 44 | javacflags: ["-verbose"], |
| 45 | } |
| 46 | |
| 47 | java_test_host { |
| 48 | name: "JavaApiUsedByMainlineModuleTest", |
| 49 | srcs: ["src/test/**/JavaApiUsedByMainlineModuleTest.java"], |
| 50 | java_resource_dirs: ["src/test/res"], |
| 51 | java_resources: [":java_api_used_by_mainline_module_testdata"], |
| 52 | static_libs: [ |
| 53 | "java_api_used_by_mainline_module", |
| 54 | "error_prone_test_helpers", |
| 55 | "hamcrest-library", |
| 56 | "hamcrest", |
| 57 | "platform-test-annotations", |
| 58 | "junit", |
Julien Desprez | f32479b | 2021-02-23 04:22:12 +0000 | [diff] [blame] | 59 | "truth-prebuilt", |
Kun Niu | 7fa228a | 2019-06-27 11:07:31 -0700 | [diff] [blame] | 60 | ], |
Julien Desprez | f32479b | 2021-02-23 04:22:12 +0000 | [diff] [blame] | 61 | test_options: { |
| 62 | unit_test: true, |
| 63 | }, |
Kun Niu | 7fa228a | 2019-06-27 11:07:31 -0700 | [diff] [blame] | 64 | } |
| 65 | |
| 66 | filegroup { |
| 67 | name: "java_api_used_by_mainline_module_testdata", |
| 68 | path: "src/test/res", |
| 69 | srcs: ["src/test/res/**/*.java"], |
| 70 | } |
Matt Banda | 276df84 | 2020-06-30 14:57:35 -0700 | [diff] [blame] | 71 | |
| 72 | // ------------------------- AndroidLint Checkers ---------------------------------- |
| 73 | |
| 74 | java_library_host { |
| 75 | name: "JavaKotlinApiFinder", |
| 76 | srcs: ["checks/src/main/java/**/*.kt"], |
| 77 | plugins: ["auto_service_plugin"], |
| 78 | libs: [ |
| 79 | "auto_service_annotations", |
| 80 | "lint_api", |
| 81 | ], |
| 82 | } |
| 83 | |
| 84 | // TODO: (b/162368644) Implement these (working in gradle) Kotlin Tests to run on Soong |
| 85 | //java_test_host { |
| 86 | // name: "JavaKotlinApiFinderTest", |
| 87 | // srcs: [ |
| 88 | // "checks/src/test/java/**/*.kt", |
| 89 | // "checks/src/main/java/**/*.kt", |
| 90 | // ], |
| 91 | // plugins: ["auto_service_plugin"], |
| 92 | // static_libs: [ |
| 93 | // "auto_service_annotations", |
| 94 | // "lint_api", |
| 95 | // ], |
| 96 | //} |