Bob Badour | 7d3caa2 | 2021-02-12 14:51:32 -0800 | [diff] [blame] | 1 | package { |
| 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 |
| 19 | license { |
| 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 Cross | 1b7d724 | 2020-06-25 13:32:37 -0700 | [diff] [blame] | 33 | java_import_host { |
| 34 | name: "lint_api", |
| 35 | jars: [ |
Colin Cross | 54f85f2 | 2021-09-08 18:37:19 -0700 | [diff] [blame] | 36 | "tools/lib/lint/tools.lint-api.jar", |
| 37 | "tools/lib/lint/tools.lint-checks.jar", |
Bernardo Rufino | 89b027a | 2022-02-15 18:16:29 +0000 | [diff] [blame] | 38 | "tools/lib/common/tools.common.jar", |
Colin Cross | 1b7d724 | 2020-06-25 13:32:37 -0700 | [diff] [blame] | 39 | |
| 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 Cross | d7db3f7 | 2021-06-24 10:28:22 -0700 | [diff] [blame] | 43 | "tools/lib/external/com/google/guava/guava/30.1-jre/guava-30.1-jre.jar", |
Colin Cross | 54f85f2 | 2021-09-08 18:37:19 -0700 | [diff] [blame] | 44 | "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 Cross | 1b7d724 | 2020-06-25 13:32:37 -0700 | [diff] [blame] | 47 | ], |
| 48 | } |
Colin Cross | bda50ab | 2021-03-04 17:41:16 -0800 | [diff] [blame] | 49 | |
| 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. |
| 55 | java_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 | |
| 74 | java_binary_host { |
| 75 | name: "lint", |
| 76 | static_libs: ["lint-classpath"], |
| 77 | wrapper: "tools/bin/lint", |
| 78 | } |
Azhara Assanova | 34a182b | 2021-07-23 14:21:38 +0000 | [diff] [blame] | 79 | |
| 80 | java_import_host { |
| 81 | name: "lint_tests", |
| 82 | jars: [ |
Colin Cross | 54f85f2 | 2021-09-08 18:37:19 -0700 | [diff] [blame] | 83 | "lint-tests.jar", |
| 84 | "tools/lib/common/tools.common.jar", |
Azhara Assanova | 34a182b | 2021-07-23 14:21:38 +0000 | [diff] [blame] | 85 | "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 Cross | 54f85f2 | 2021-09-08 18:37:19 -0700 | [diff] [blame] | 88 | "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 Assanova | 34a182b | 2021-07-23 14:21:38 +0000 | [diff] [blame] | 91 | ] |
| 92 | } |