Colin Cross | 88e0590 | 2018-06-05 14:06:39 -0700 | [diff] [blame] | 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 | |
Bob Badour | 0d71f66 | 2021-02-12 15:51:13 -0800 | [diff] [blame] | 15 | package { |
| 16 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 17 | } |
| 18 | |
Makoto Onuki | f2833f8 | 2020-06-02 14:00:38 -0700 | [diff] [blame] | 19 | java_binary_host { |
Colin Cross | 88e0590 | 2018-06-05 14:06:39 -0700 | [diff] [blame] | 20 | name: "metalava", |
| 21 | srcs: [ |
| 22 | "src/main/java/**/*.java", |
| 23 | "src/main/java/**/*.kt", |
| 24 | ], |
Jeff Gaston | fcc3deb | 2019-01-22 15:51:32 -0500 | [diff] [blame] | 25 | java_resource_dirs: ["src/main/resources/"], |
Colin Cross | 88e0590 | 2018-06-05 14:06:39 -0700 | [diff] [blame] | 26 | static_libs: [ |
Aurimas Liutikas | 3279502 | 2022-02-04 16:01:32 -0800 | [diff] [blame] | 27 | "jsr305", |
| 28 | "jsr330", |
Colin Cross | 706dfa1 | 2018-06-05 17:25:31 -0700 | [diff] [blame] | 29 | "kotlin-reflect", |
Colin Cross | 88e0590 | 2018-06-05 14:06:39 -0700 | [diff] [blame] | 30 | "metalava-tools-common-m2-deps", |
| 31 | "metalava-gradle-plugin-deps", |
| 32 | ], |
| 33 | manifest: "manifest.txt", |
Paul Duffin | 56343d6 | 2019-05-15 11:26:56 +0100 | [diff] [blame] | 34 | target: { |
| 35 | host: { |
| 36 | dist: { |
| 37 | targets: ["sdk"], |
| 38 | }, |
| 39 | }, |
Jaewoong Jung | 07790ac | 2019-01-09 10:21:57 -0800 | [diff] [blame] | 40 | }, |
Makoto Onuki | f2833f8 | 2020-06-02 14:00:38 -0700 | [diff] [blame] | 41 | visibility: [ |
| 42 | // Metalava is linked by //vendor/xts/gts-tests/hostsidetests/api, but because it's a |
| 43 | // make project, soong's visibility won't apply. Soong also won't let you specify a |
| 44 | // subpackage of //vendor/ here. So let's just make it private. |
| 45 | // When //vendor/xts/gts-tests/hostsidetests/api migrates to Android.bp, we need to |
| 46 | // open metalava to //vendor:__subpackages__. |
| 47 | "//visibility:private", |
| 48 | ], |
Colin Cross | 88e0590 | 2018-06-05 14:06:39 -0700 | [diff] [blame] | 49 | } |
Nan Zhang | c6a4265 | 2018-06-06 16:51:05 -0700 | [diff] [blame] | 50 | |
Nan Zhang | 15b3659 | 2018-06-15 11:52:33 -0700 | [diff] [blame] | 51 | java_library { |
Nan Zhang | c6a4265 | 2018-06-06 16:51:05 -0700 | [diff] [blame] | 52 | name: "stub-annotations", |
Nan Zhang | 15b3659 | 2018-06-15 11:52:33 -0700 | [diff] [blame] | 53 | host_supported: true, |
Nan Zhang | c6a4265 | 2018-06-06 16:51:05 -0700 | [diff] [blame] | 54 | srcs: [ |
| 55 | "stub-annotations/src/main/java/**/*.java", |
| 56 | ], |
Paul Duffin | b461b1e | 2019-10-17 11:03:07 +0100 | [diff] [blame] | 57 | // Allow core_current to use stub-annotations. |
| 58 | sdk_version: "28", |
Jaewoong Jung | 07790ac | 2019-01-09 10:21:57 -0800 | [diff] [blame] | 59 | target: { |
| 60 | host: { |
| 61 | dist: { |
| 62 | targets: ["sdk"], |
| 63 | }, |
| 64 | }, |
| 65 | }, |
Nan Zhang | c6a4265 | 2018-06-06 16:51:05 -0700 | [diff] [blame] | 66 | } |
Nan Zhang | 0006ae2 | 2018-07-13 16:33:51 -0700 | [diff] [blame] | 67 | |
| 68 | genrule { |
| 69 | name: "private-stub-annotations", |
| 70 | tools: [ |
| 71 | "soong_zip", |
| 72 | "metalava", |
| 73 | ], |
| 74 | srcs: [ |
| 75 | "stub-annotations/src/main/java/**/*.java", |
| 76 | ], |
| 77 | cmd: "($(location metalava) --no-banner --copy-annotations tools/metalava/stub-annotations " + |
Jaewoong Jung | 07790ac | 2019-01-09 10:21:57 -0800 | [diff] [blame] | 78 | "$(genDir)/private-stub-annotations) && ($(location soong_zip) -o $(out) -C $(genDir) -D $(genDir))", |
Nan Zhang | 0006ae2 | 2018-07-13 16:33:51 -0700 | [diff] [blame] | 79 | out: [ |
| 80 | "private-stub-annotations.srcjar", |
| 81 | ], |
| 82 | } |
| 83 | |
| 84 | java_library { |
| 85 | name: "private-stub-annotations-jar", |
| 86 | host_supported: true, |
| 87 | srcs: [ |
| 88 | ":private-stub-annotations", |
| 89 | ], |
Neil Fuller | f46a78e | 2018-09-26 17:11:13 +0100 | [diff] [blame] | 90 | sdk_version: "core_current", |
Colin Cross | 6add4d4 | 2020-07-30 14:50:44 -0700 | [diff] [blame] | 91 | // private-stub-annotations-jar ends up in android.jar in the SDK and should |
| 92 | // use -target 8. |
| 93 | java_version: "1.8", |
Nan Zhang | 0006ae2 | 2018-07-13 16:33:51 -0700 | [diff] [blame] | 94 | } |
Nan Zhang | 300968c | 2018-08-01 15:06:55 -0700 | [diff] [blame] | 95 | |
| 96 | droiddoc_exported_dir { |
| 97 | name: "metalava-manual", |
| 98 | path: "manual", |
| 99 | } |