blob: c5897b9e055229877abbcc82e4c95ee3130894c9 [file] [log] [blame]
Matt Banda276df842020-06-30 14:57:35 -07001// Copyright (C) 2020 The Android Open Source Project
Kun Niu7fa228a2019-06-27 11:07:31 -07002//
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 Badour161d90c2021-02-03 23:26:39 -080015package {
16 default_applicable_licenses: ["Android-Apache-2.0"],
17}
18
Kun Niu7fa228a2019-06-27 11:07:31 -070019java_plugin {
20 name: "java_api_finder",
21
22 static_libs: [
23 "java_api_used_by_mainline_module",
24 ],
25}
26
27java_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 Cross84052f22020-06-25 20:36:30 -070034 ],
35
36 libs: [
37 "//external/auto:auto_service_annotations",
Kun Niu7fa228a2019-06-27 11:07:31 -070038 ],
39
40 plugins: [
Colin Cross84052f22020-06-25 20:36:30 -070041 "//external/auto:auto_service_plugin",
Kun Niu7fa228a2019-06-27 11:07:31 -070042 ],
43
44 javacflags: ["-verbose"],
45}
46
47java_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 Desprezf32479b2021-02-23 04:22:12 +000059 "truth-prebuilt",
Kun Niu7fa228a2019-06-27 11:07:31 -070060 ],
Julien Desprezf32479b2021-02-23 04:22:12 +000061 test_options: {
62 unit_test: true,
63 },
Kun Niu7fa228a2019-06-27 11:07:31 -070064}
65
66filegroup {
67 name: "java_api_used_by_mainline_module_testdata",
68 path: "src/test/res",
69 srcs: ["src/test/res/**/*.java"],
70}
Matt Banda276df842020-06-30 14:57:35 -070071
72// ------------------------- AndroidLint Checkers ----------------------------------
73
74java_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//}