blob: 7ef50b095a7591364ed1f533bd603ea8b7830f10 [file] [log] [blame]
Bob Badour979b4da2021-02-12 14:51:15 -08001package {
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
Colin Cross7aef6bc2020-06-17 20:25:12 -070033java_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/UsageException.java",
43 ],
44}
45
46java_library_host {
47 name: "google_java_format",
48 srcs: ["core/src/main/java/**/*.java"],
49 exclude_srcs: [
50 ":google_java_format_main_srcs",
51 "core/src/main/java/com/google/googlejavaformat/java/java14/Java14InputAstVisitor.java",
52 ],
53 libs: [
54 "error_prone_annotations",
55 "google_java_format_android_annotation_stubs",
56 "guava",
57 ],
58 javacflags: [
59 "--add-modules=jdk.compiler",
60 "--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
61 "--add-exports jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED",
62 "--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED",
63 "--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED",
64 "--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED",
65 "--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED",
66 "--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED",
67 ],
68}
69
70java_library_host {
71 name: "google_java_format_filer",
72 srcs: ["core/src/main/java/filer/*.java"],
73 libs: [
74 "error_prone_annotations",
75 "google_java_format_android_annotation_stubs",
76 "guava",
77 ],
78 javacflags: [
79 "--add-modules=jdk.compiler",
80 "--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
81 "--add-exports jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED",
82 "--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED",
83 "--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED",
84 "--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED",
85 "--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED",
86 "--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED",
87 ],
88}