blob: c16cc518fbeecdb3ea205b9ef1aebbe2d13c4dbe [file] [log] [blame]
Bob Badour7d3caa22021-02-12 14:51:32 -08001package {
2 default_applicable_licenses: ["prebuilts_cmdline-tools_license"],
3}
4
5// Added automatically by a large-scale-change that took the approach of
6// 'apply every license found to every target'. While this makes sure we respect
7// every license restriction, it may not be entirely correct.
8//
9// e.g. GPL in an MIT project might only apply to the contrib/ directory.
10//
11// Please consider splitting the single license below into multiple licenses,
12// taking care not to lose any license_kind information, and overriding the
13// default license using the 'licenses: [...]' property on targets as needed.
14//
15// For unused files, consider creating a 'fileGroup' with "//visibility:private"
16// to attach the license to, and including a comment whether the files may be
17// used in the current project.
18// See: http://go/android-license-faq
19license {
20 name: "prebuilts_cmdline-tools_license",
21 visibility: [":__subpackages__"],
22 license_kinds: [
23 "SPDX-license-identifier-BSD",
24 "SPDX-license-identifier-CDDL-1.0",
25 "SPDX-license-identifier-GPL-2.0",
26 "SPDX-license-identifier-MIT",
27 ],
28 license_text: [
29 "tools/NOTICE.txt",
30 ],
31}
32
Colin Cross1b7d7242020-06-25 13:32:37 -070033java_import_host {
34 name: "lint_api",
35 jars: [
Colin Cross54f85f22021-09-08 18:37:19 -070036 "tools/lib/lint/tools.lint-api.jar",
37 "tools/lib/lint/tools.lint-checks.jar",
Bernardo Rufino89b027a2022-02-15 18:16:29 +000038 "tools/lib/common/tools.common.jar",
Colin Cross1b7d7242020-06-25 13:32:37 -070039
40 // A subset of the jars listed in MANIFEST.MF in
41 // tools/lib/lint-classpath.jar needed to provide dependencies
42 // of lint-api.jar and lint-checks.jar.
Colin Crossd7db3f72021-06-24 10:28:22 -070043 "tools/lib/external/com/google/guava/guava/30.1-jre/guava-30.1-jre.jar",
Colin Cross54f85f22021-09-08 18:37:19 -070044 "tools/lib/external/lint-psi/intellij-core/intellij-core-mvn.jar",
45 "tools/lib/external/lint-psi/kotlin-compiler/kotlin-compiler-mvn.jar",
46 "tools/lib/external/lint-psi/uast/uast.jar",
Colin Cross1b7d7242020-06-25 13:32:37 -070047 ],
48}
Colin Crossbda50ab2021-03-04 17:41:16 -080049
50// The lint shell script in tools/bin/lint uses tools/lib/lint-classpath.jar as its classpath.
51// That jar contains a list of other jars that java adds to the classpath. This makes it impossible
52// for the build system to track dependencies.
53// This genrule reads the jars from tools/lib/lint-classpath.jar and then merges them all together into
54// a single jar. The result is then embedded into a self-contained java_binary.
55java_genrule_host {
56 name: "lint-classpath",
57 srcs: [
58 "tools/lib/lint-classpath.jar",
59 "tools/lib/**/*.jar",
60 ],
61 out: [
62 "lint-classpath.jar",
63 ],
64 tools: [
65 "merge_zips",
66 ],
67 cmd: "unzip -pq $(location tools/lib/lint-classpath.jar) META-INF/MANIFEST.MF > $(genDir)/list && " +
68 "for jar in $$(grep '\\.jar' $(genDir)/list); do " +
69 " echo $$(dirname $(location tools/lib/lint-classpath.jar))/$${jar}; " +
70 "done > $(genDir)/jars && " +
71 "$(location merge_zips) -j -ignore-duplicates -stripFile 'META-INF/*.SF' -stripFile 'META-INF/*.DSA' $(out) $$(cat $(genDir)/jars)",
72}
73
74java_binary_host {
75 name: "lint",
76 static_libs: ["lint-classpath"],
77 wrapper: "tools/bin/lint",
78}
Azhara Assanova34a182b2021-07-23 14:21:38 +000079
80java_import_host {
81 name: "lint_tests",
82 jars: [
Colin Cross54f85f22021-09-08 18:37:19 -070083 "lint-tests.jar",
84 "tools/lib/common/tools.common.jar",
Azhara Assanova34a182b2021-07-23 14:21:38 +000085 "tools/lib/external/org/ow2/asm/asm/9.1/asm-9.1.jar",
86 "tools/lib/external/org/ow2/asm/asm-analysis/9.1/asm-analysis-9.1.jar",
87 "tools/lib/external/org/ow2/asm/asm-tree/9.1/asm-tree-9.1.jar",
Colin Cross54f85f22021-09-08 18:37:19 -070088 "tools/lib/layoutlib-api/tools.layoutlib-api.jar",
89 "tools/lib/lint/cli/cli.jar",
90 "tools/lib/sdk-common/tools.sdk-common.jar",
Azhara Assanova34a182b2021-07-23 14:21:38 +000091 ]
92}