blob: a97d687666866574cc19ffdbbcb78e446c18341f [file] [edit]
// Copyright (C) 2017 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package {
default_applicable_licenses: ["external_error_prone_license"],
default_visibility: ["//visibility:private"],
}
license {
name: "external_error_prone_license",
package_name: "Google Error Prone",
visibility: [":__subpackages__"],
license_kinds: [
"SPDX-license-identifier-Apache-2.0",
"SPDX-license-identifier-MIT",
],
license_text: ["LICENSE"],
}
// Lets ErrorProne access compiler internals
java_defaults {
name: "error_prone_javac_defaults",
javacflags: [
"--add-modules=jdk.compiler",
"--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
"--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED",
"--add-exports=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED",
"--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED",
"--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED",
"--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED",
"--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED",
"--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED",
"--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED",
"--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED",
],
}
java_library {
name: "error_prone_annotations",
defaults: ["error_prone_dependency_defaults"],
host_supported: true,
visibility: ["//visibility:public"],
srcs: ["annotations/src/main/java/**/*.java"],
exclude_srcs: ["annotations/src/main/java/module-info.java"],
sdk_version: "core_current",
apex_available: [
"//apex_available:anyapex",
"//apex_available:platform",
],
// b/267831518: Pin tradefed and dependencies to Java 11.
java_version: "11",
target: {
windows: {
enabled: true,
},
},
}
java_library_host {
name: "error_prone_annotation",
defaults: ["error_prone_dependency_defaults"],
srcs: ["annotation/src/main/java/**/*.java"],
libs: [
"guava",
],
}
filegroup {
name: "error_prone_error_properties",
srcs: ["check_api/src/main/java/com/google/errorprone/errors.properties"],
path: "check_api/src/main/java",
}
java_library_host {
name: "error_prone_check_api",
defaults: [
"error_prone_javac_defaults",
"error_prone_dependency_defaults",
],
srcs: [
"check_api/src/main/java/**/*.java",
] + select(release_flag("RELEASE_BUILD_WITH_JDK_25"), {
true: [
"check_api/src/main/java24/**/*.java",
],
default: [],
}),
exclude_srcs: [] + select(release_flag("RELEASE_BUILD_WITH_JDK_25"), {
true: [
"check_api/src/main/java/com/google/errorprone/util/ErrorProneSignatureGenerator.java",
],
default: [],
}),
java_resources: [":error_prone_error_properties"],
static_libs: [
"auto_common",
"auto_value_annotations",
"caffeine-prebuilt",
"checkerframework_dataflow_errorprone_prebuilt_jar",
"error_prone_annotation",
"error_prone_annotations",
"guava",
"java_diff_utils",
"jsr330",
],
libs: [
"auto_value_memoized_extension_annotations",
"jspecify",
],
plugins: [
"auto_value_memoized_extension_plugin",
"auto_value_plugin",
],
}
java_library_host {
name: "error_prone_core",
visibility: ["//visibility:public"],
defaults: [
"error_prone_javac_defaults",
"error_prone_dependency_defaults",
],
srcs: [
"core/src/main/java/**/*.java",
"core/src/main/proto/api_diff.proto",
"refaster/src/main/java/**/*.java",
],
java_resources: [
"core/src/main/java/com/google/errorprone/bugpatterns/apidiff/8to11diff.binarypb",
"core/src/main/java/com/google/errorprone/bugpatterns/apidiff/android_java8.binarypb",
],
static_libs: [
"error_prone_check_api",
"google_java_format",
"libprotobuf-java-full",
"pcollections",
],
libs: [
"auto_service_annotations",
"jspecify",
],
plugins: [
"auto_oneof_plugin",
"auto_service_plugin",
"auto_value_builder_plugin",
"auto_value_plugin",
],
proto: {
type: "full",
},
}
java_plugin {
name: "error_prone_plugin",
defaults: ["error_prone_dependency_defaults"],
visibility: ["//visibility:public"],
static_libs: ["error_prone_core"],
}
java_library_host {
name: "error_prone_test_helpers",
visibility: ["//visibility:public"],
defaults: ["error_prone_javac_defaults"],
srcs: [
"test_helpers/src/main/java/**/*.java",
],
static_libs: [
"error_prone_check_api",
"jimfs",
],
libs: [
"compile-testing-prebuilt",
"error_prone_annotations",
"google_java_format",
"hamcrest",
"hamcrest-library",
"jspecify",
"junit",
"truth",
],
}