• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2020 The Android Open Source Project
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
15package {
16    default_applicable_licenses: ["Android-Apache-2.0"],
17}
18
19java_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",
34    ],
35
36    libs: [
37        "//external/auto:auto_service_annotations",
38    ],
39
40    plugins: [
41        "//external/auto:auto_service_plugin",
42    ],
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",
59        "truth-prebuilt",
60    ],
61    test_options: {
62        unit_test: true,
63    },
64}
65
66filegroup {
67    name: "java_api_used_by_mainline_module_testdata",
68    path: "src/test/res",
69    srcs: ["src/test/res/**/*.java"],
70}
71
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//}
97