xref: /aosp_15_r20/external/google-java-format/Android.bp (revision 10816b529e1d7005ca788e7b4c5efd1c72957e26)
1package {
2    default_applicable_licenses: ["external_google-java-format_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: "external_google-java-format_license",
21    visibility: [":__subpackages__"],
22    license_kinds: [
23        "SPDX-license-identifier-Apache-2.0",
24        "SPDX-license-identifier-BSD",
25        "SPDX-license-identifier-MIT",
26        "SPDX-license-identifier-NCSA",
27    ],
28    license_text: [
29        "LICENSE",
30    ],
31}
32
33java_library_host {
34    name: "google_java_format_android_annotation_stubs",
35    srcs: ["android-annotation-stubs/src/**/*.java"],
36}
37
38filegroup {
39    name: "google_java_format_main_srcs",
40    srcs: [
41        "core/src/main/java/com/google/googlejavaformat/java/Main.java",
42        "core/src/main/java/com/google/googlejavaformat/java/GoogleJavaFormatTool.java",
43        "core/src/main/java/com/google/googlejavaformat/java/UsageException.java",
44    ],
45}
46
47java_library_host {
48    name: "google_java_format",
49    srcs: ["core/src/main/java/**/*.java"],
50    exclude_srcs: [
51        ":google_java_format_main_srcs",
52        "core/src/main/java/com/google/googlejavaformat/java/GoogleJavaFormatToolProvider.java",
53    ],
54    libs: [
55        "error_prone_annotations",
56        "google_java_format_android_annotation_stubs",
57        "guava",
58        "auto_service_annotations",
59        "auto_value_annotations",
60    ],
61    plugins: [
62        "auto_oneof_plugin",
63        "auto_service_plugin",
64        "auto_value_plugin",
65    ],
66    javacflags: [
67        "--add-modules=jdk.compiler",
68        "--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
69        "--add-exports jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED",
70        "--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED",
71        "--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED",
72        "--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED",
73        "--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED",
74        "--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED",
75    ],
76}
77