blob: 921deaf012ab50e4e73b89b6e9ad19ce2243cd27 [file] [log] [blame]
Colin Cross88e05902018-06-05 14:06:39 -07001// Copyright (C) 2018 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
Bob Badour0d71f662021-02-12 15:51:13 -080015package {
16 default_applicable_licenses: ["Android-Apache-2.0"],
17}
18
Makoto Onukif2833f82020-06-02 14:00:38 -070019java_binary_host {
Colin Cross88e05902018-06-05 14:06:39 -070020 name: "metalava",
21 srcs: [
22 "src/main/java/**/*.java",
23 "src/main/java/**/*.kt",
24 ],
Jeff Gastonfcc3deb2019-01-22 15:51:32 -050025 java_resource_dirs: ["src/main/resources/"],
Colin Cross88e05902018-06-05 14:06:39 -070026 static_libs: [
Colin Cross706dfa12018-06-05 17:25:31 -070027 "kotlin-reflect",
Colin Cross88e05902018-06-05 14:06:39 -070028 "metalava-tools-common-m2-deps",
29 "metalava-gradle-plugin-deps",
30 ],
31 manifest: "manifest.txt",
Paul Duffin56343d62019-05-15 11:26:56 +010032 target: {
33 host: {
34 dist: {
35 targets: ["sdk"],
36 },
37 },
Jaewoong Jung07790ac2019-01-09 10:21:57 -080038 },
Makoto Onukif2833f82020-06-02 14:00:38 -070039 visibility: [
40 // Metalava is linked by //vendor/xts/gts-tests/hostsidetests/api, but because it's a
41 // make project, soong's visibility won't apply. Soong also won't let you specify a
42 // subpackage of //vendor/ here. So let's just make it private.
43 // When //vendor/xts/gts-tests/hostsidetests/api migrates to Android.bp, we need to
44 // open metalava to //vendor:__subpackages__.
45 "//visibility:private",
46 ],
Colin Cross88e05902018-06-05 14:06:39 -070047}
Nan Zhangc6a42652018-06-06 16:51:05 -070048
Nan Zhang15b36592018-06-15 11:52:33 -070049java_library {
Nan Zhangc6a42652018-06-06 16:51:05 -070050 name: "stub-annotations",
Nan Zhang15b36592018-06-15 11:52:33 -070051 host_supported: true,
Nan Zhangc6a42652018-06-06 16:51:05 -070052 srcs: [
53 "stub-annotations/src/main/java/**/*.java",
54 ],
Paul Duffinb461b1e2019-10-17 11:03:07 +010055 // Allow core_current to use stub-annotations.
56 sdk_version: "28",
Jaewoong Jung07790ac2019-01-09 10:21:57 -080057 target: {
58 host: {
59 dist: {
60 targets: ["sdk"],
61 },
62 },
63 },
Nan Zhangc6a42652018-06-06 16:51:05 -070064}
Nan Zhang0006ae22018-07-13 16:33:51 -070065
66genrule {
67 name: "private-stub-annotations",
68 tools: [
69 "soong_zip",
70 "metalava",
71 ],
72 srcs: [
73 "stub-annotations/src/main/java/**/*.java",
74 ],
75 cmd: "($(location metalava) --no-banner --copy-annotations tools/metalava/stub-annotations " +
Jaewoong Jung07790ac2019-01-09 10:21:57 -080076 "$(genDir)/private-stub-annotations) && ($(location soong_zip) -o $(out) -C $(genDir) -D $(genDir))",
Nan Zhang0006ae22018-07-13 16:33:51 -070077 out: [
78 "private-stub-annotations.srcjar",
79 ],
80}
81
82java_library {
83 name: "private-stub-annotations-jar",
84 host_supported: true,
85 srcs: [
86 ":private-stub-annotations",
87 ],
Neil Fullerf46a78e2018-09-26 17:11:13 +010088 sdk_version: "core_current",
Colin Cross6add4d42020-07-30 14:50:44 -070089 // private-stub-annotations-jar ends up in android.jar in the SDK and should
90 // use -target 8.
91 java_version: "1.8",
Nan Zhang0006ae22018-07-13 16:33:51 -070092}
Nan Zhang300968c2018-08-01 15:06:55 -070093
94droiddoc_exported_dir {
95 name: "metalava-manual",
96 path: "manual",
97}