blob: 439f8bbd2b881cc16d840312d0cebeec3186b0a5 [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
Paul Duffin56343d62019-05-15 11:26:56 +010015java_binary {
Colin Cross88e05902018-06-05 14:06:39 -070016 name: "metalava",
Paul Duffin56343d62019-05-15 11:26:56 +010017 host_supported: true,
Colin Cross88e05902018-06-05 14:06:39 -070018 srcs: [
19 "src/main/java/**/*.java",
20 "src/main/java/**/*.kt",
21 ],
Jeff Gastonfcc3deb2019-01-22 15:51:32 -050022 java_resource_dirs: ["src/main/resources/"],
Colin Cross88e05902018-06-05 14:06:39 -070023 static_libs: [
Colin Cross706dfa12018-06-05 17:25:31 -070024 "kotlin-reflect",
Colin Cross88e05902018-06-05 14:06:39 -070025 "metalava-tools-common-m2-deps",
26 "metalava-gradle-plugin-deps",
27 ],
28 manifest: "manifest.txt",
Paul Duffin56343d62019-05-15 11:26:56 +010029 target: {
30 host: {
31 dist: {
32 targets: ["sdk"],
33 },
34 },
Jaewoong Jung07790ac2019-01-09 10:21:57 -080035 },
Colin Cross88e05902018-06-05 14:06:39 -070036}
Nan Zhangc6a42652018-06-06 16:51:05 -070037
Nan Zhang15b36592018-06-15 11:52:33 -070038java_library {
Nan Zhangc6a42652018-06-06 16:51:05 -070039 name: "stub-annotations",
Nan Zhang15b36592018-06-15 11:52:33 -070040 host_supported: true,
Nan Zhangc6a42652018-06-06 16:51:05 -070041 srcs: [
42 "stub-annotations/src/main/java/**/*.java",
43 ],
Paul Duffinb461b1e2019-10-17 11:03:07 +010044 // Allow core_current to use stub-annotations.
45 sdk_version: "28",
Jaewoong Jung07790ac2019-01-09 10:21:57 -080046 target: {
47 host: {
48 dist: {
49 targets: ["sdk"],
50 },
51 },
52 },
Nan Zhangc6a42652018-06-06 16:51:05 -070053}
Nan Zhang0006ae22018-07-13 16:33:51 -070054
55genrule {
56 name: "private-stub-annotations",
57 tools: [
58 "soong_zip",
59 "metalava",
60 ],
61 srcs: [
62 "stub-annotations/src/main/java/**/*.java",
63 ],
64 cmd: "($(location metalava) --no-banner --copy-annotations tools/metalava/stub-annotations " +
Jaewoong Jung07790ac2019-01-09 10:21:57 -080065 "$(genDir)/private-stub-annotations) && ($(location soong_zip) -o $(out) -C $(genDir) -D $(genDir))",
Nan Zhang0006ae22018-07-13 16:33:51 -070066 out: [
67 "private-stub-annotations.srcjar",
68 ],
69}
70
71java_library {
72 name: "private-stub-annotations-jar",
73 host_supported: true,
74 srcs: [
75 ":private-stub-annotations",
76 ],
Neil Fullerf46a78e2018-09-26 17:11:13 +010077 sdk_version: "core_current",
Colin Cross76141612020-07-30 14:50:44 -070078 // private-stub-annotations-jar ends up in android.jar in the SDK and should
79 // use -target 8.
80 java_version: "1.8",
Nan Zhang0006ae22018-07-13 16:33:51 -070081}
Nan Zhang300968c2018-08-01 15:06:55 -070082
83droiddoc_exported_dir {
84 name: "metalava-manual",
85 path: "manual",
86}