xref: /aosp_15_r20/prebuilts/r8/Android.bp (revision f1fd37cb3c4ec94650f99d456d82ac1dac2c58ba)
1//
2// Copyright (C) 2021 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//      http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16package {
17    default_applicable_licenses: ["prebuilts_r8_license"],
18}
19
20// Added automatically by a large-scale-change that took the approach of
21// 'apply every license found to every target'. While this makes sure we respect
22// every license restriction, it may not be entirely correct.
23//
24// e.g. GPL in an MIT project might only apply to the contrib/ directory.
25//
26// Please consider splitting the single license below into multiple licenses,
27// taking care not to lose any license_kind information, and overriding the
28// default license using the 'licenses: [...]' property on targets as needed.
29//
30// For unused files, consider creating a 'fileGroup' with "//visibility:private"
31// to attach the license to, and including a comment whether the files may be
32// used in the current project.
33//
34// large-scale-change included anything that looked like it might be a license
35// text as a license_text. e.g. LICENSE, NOTICE, COPYING etc.
36//
37// Please consider removing redundant or irrelevant files from 'license_text:'.
38// See: http://go/android-license-faq
39license {
40    name: "prebuilts_r8_license",
41    visibility: [":__subpackages__"],
42    license_kinds: [
43        "SPDX-license-identifier-Apache-2.0",
44        "SPDX-license-identifier-BSD",
45        "SPDX-license-identifier-GPL",
46        "SPDX-license-identifier-MIT",
47    ],
48    license_text: [
49        "LICENSE",
50        "NOTICE",
51    ],
52}
53
54java_binary_host {
55    name: "d8",
56    wrapper: "d8",
57    static_libs: ["r8lib"],
58    target: {
59        windows: {
60            enabled: true,
61            wrapper: "d8.bat",
62        },
63    },
64}
65
66java_binary_host {
67    name: "r8-compat-proguard",
68    main_class: "com.android.tools.r8.compatproguard.CompatProguard",
69    static_libs: ["r8lib"],
70}
71
72java_binary_host {
73    name: "r8",
74    main_class: "com.android.tools.r8wrappers.R8Wrapper",
75    static_libs: ["r8lib"]
76}
77
78java_binary_host {
79    name: "retrace",
80    main_class: "com.android.tools.r8wrappers.retrace.RetraceWrapper",
81    static_libs: ["r8lib"],
82}
83
84java_binary_host {
85    name: "extractmarker",
86    main_class: "com.android.tools.r8.ExtractMarker",
87    static_libs: ["r8lib"],
88    wrapper: "extractmarker.sh",
89}
90
91java_library_host {
92    name: "r8lib",
93    srcs: ["src/**/*.java"],
94    static_libs: ["r8lib-prebuilt"],
95    target: {
96        windows: {
97            enabled: true,
98        },
99    },
100}
101
102filegroup {
103    name: "r8.jar.map",
104    srcs: ["r8.jar.map"],
105}
106
107java_import_host {
108    name: "r8lib-prebuilt",
109    jars: ["r8.jar"],
110    target: {
111        windows: {
112            enabled: true,
113        },
114    },
115}
116
117// Library of "keep" annotations for instructing the R8 code shrinker.
118// The R8 keep annotations are part of an experimental alternative to
119// the use of "keep rules". More information can be found in b/248408342.
120java_import {
121    name: "keepanno-annotations",
122    jars: ["keepanno-annotations.jar"],
123}
124