• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// 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
15java_binary {
16    name: "metalava",
17    host_supported: true,
18    srcs: [
19        "src/main/java/**/*.java",
20        "src/main/java/**/*.kt",
21    ],
22    java_resource_dirs: ["src/main/resources/"],
23    static_libs: [
24        "kotlin-reflect",
25        "metalava-tools-common-m2-deps",
26        "metalava-gradle-plugin-deps",
27    ],
28    manifest: "manifest.txt",
29    target: {
30        host: {
31            dist: {
32                targets: ["sdk"],
33            },
34        },
35    },
36}
37
38java_library {
39    name: "stub-annotations",
40    host_supported: true,
41    srcs: [
42        "stub-annotations/src/main/java/**/*.java",
43    ],
44    // Allow core_current to use stub-annotations.
45    sdk_version: "28",
46    target: {
47        host: {
48            dist: {
49                targets: ["sdk"],
50            },
51        },
52    },
53}
54
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 " +
65        "$(genDir)/private-stub-annotations) && ($(location soong_zip) -o $(out) -C $(genDir) -D $(genDir))",
66    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    ],
77    sdk_version: "core_current",
78    // private-stub-annotations-jar ends up in android.jar in the SDK and should
79    // use -target 8.
80    java_version: "1.8",
81}
82
83droiddoc_exported_dir {
84    name: "metalava-manual",
85    path: "manual",
86}
87