Enable a limited set of Error Prone errors/warnings by default
Change-Id: Idd588ee289e3576753a5b06a55ca4c36b5293012
This commit is contained in:

committed by
David Pursehouse

parent
8ba036b893
commit
cac46307dd
1
.bazelrc
1
.bazelrc
@@ -3,6 +3,7 @@ build --repository_cache=~/.gerritcodereview/bazel-cache/repository
|
|||||||
build --experimental_strict_action_env
|
build --experimental_strict_action_env
|
||||||
build --action_env=PATH
|
build --action_env=PATH
|
||||||
build --disk_cache=~/.gerritcodereview/bazel-cache/cas
|
build --disk_cache=~/.gerritcodereview/bazel-cache/cas
|
||||||
|
build --java_toolchain //tools:error_prone_warnings_toolchain
|
||||||
|
|
||||||
test --build_tests_only
|
test --build_tests_only
|
||||||
test --test_output=errors
|
test --test_output=errors
|
||||||
|
@@ -219,10 +219,11 @@ The output JAR file will be be placed in:
|
|||||||
Note that when building an individual plugin, the `core.zip` package
|
Note that when building an individual plugin, the `core.zip` package
|
||||||
is not regenerated.
|
is not regenerated.
|
||||||
|
|
||||||
|
By default, a limited set of Error Prone errors and warnings are enabled.
|
||||||
To build with all Error Prone warnings activated, run:
|
To build with all Error Prone warnings activated, run:
|
||||||
|
|
||||||
----
|
----
|
||||||
bazel build --java_toolchain //tools:error_prone_warnings_toolchain //...
|
bazel build --java_toolchain //tools:full_error_prone_warnings_toolchain //...
|
||||||
----
|
----
|
||||||
|
|
||||||
|
|
||||||
|
23
tools/BUILD
23
tools/BUILD
@@ -23,10 +23,31 @@ default_java_toolchain(
|
|||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
default_java_toolchain(
|
||||||
|
name = "full_error_prone_warnings_toolchain",
|
||||||
|
bootclasspath = ["@bazel_tools//tools/jdk:platformclasspath.jar"],
|
||||||
|
jvm_opts = JDK9_JVM_OPTS,
|
||||||
|
package_configuration = [
|
||||||
|
":full_error_prone",
|
||||||
|
],
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
)
|
||||||
|
|
||||||
|
# Error Prone errors and warnings enabled by default; see ../.bazelrc for how
|
||||||
|
# this is enabled.
|
||||||
|
java_package_configuration(
|
||||||
|
name = "error_prone",
|
||||||
|
javacopts = [
|
||||||
|
"-XepDisableWarningsInGeneratedCode",
|
||||||
|
"-Xep:WildcardImport:ERROR",
|
||||||
|
],
|
||||||
|
packages = ["error_prone_packages"],
|
||||||
|
)
|
||||||
|
|
||||||
# This EP warnings list is based on:
|
# This EP warnings list is based on:
|
||||||
# https://github.com/bazelbuild/BUILD_file_generator/blob/master/tools/bazel_defs/java.bzl
|
# https://github.com/bazelbuild/BUILD_file_generator/blob/master/tools/bazel_defs/java.bzl
|
||||||
java_package_configuration(
|
java_package_configuration(
|
||||||
name = "error_prone",
|
name = "full_error_prone",
|
||||||
javacopts = [
|
javacopts = [
|
||||||
"-XepDisableWarningsInGeneratedCode",
|
"-XepDisableWarningsInGeneratedCode",
|
||||||
"-Xep:MissingCasesInEnumSwitch:ERROR",
|
"-Xep:MissingCasesInEnumSwitch:ERROR",
|
||||||
|
Reference in New Issue
Block a user