Bob Badour | 979b4da | 2021-02-12 14:51:15 -0800 | [diff] [blame] | 1 | package { |
| 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 |
| 19 | license { |
| 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 Cross | 7aef6bc | 2020-06-17 20:25:12 -0700 | [diff] [blame] | 33 | java_library_host { |
| 34 | name: "google_java_format_android_annotation_stubs", |
| 35 | srcs: ["android-annotation-stubs/src/**/*.java"], |
| 36 | } |
| 37 | |
| 38 | filegroup { |
| 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 | |
| 46 | java_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", |
Colin Cross | ef76c3a | 2022-03-04 22:43:28 -0800 | [diff] [blame] | 52 | "core/src/main/java/com/google/googlejavaformat/java/GoogleJavaFormatToolProvider.java", |
Colin Cross | 7aef6bc | 2020-06-17 20:25:12 -0700 | [diff] [blame] | 53 | ], |
| 54 | libs: [ |
| 55 | "error_prone_annotations", |
| 56 | "google_java_format_android_annotation_stubs", |
| 57 | "guava", |
Colin Cross | ef76c3a | 2022-03-04 22:43:28 -0800 | [diff] [blame] | 58 | "auto_service_annotations", |
| 59 | "auto_value_annotations", |
Colin Cross | 7aef6bc | 2020-06-17 20:25:12 -0700 | [diff] [blame] | 60 | ], |
Colin Cross | ef76c3a | 2022-03-04 22:43:28 -0800 | [diff] [blame] | 61 | plugins: [ |
| 62 | "auto_oneof_plugin", |
| 63 | "auto_service_plugin", |
| 64 | "auto_value_plugin", |
Colin Cross | 7aef6bc | 2020-06-17 20:25:12 -0700 | [diff] [blame] | 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 | } |