You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BUILD 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. load("@rules_java//java:defs.bzl", "java_package_configuration")
  2. load(
  3. "@bazel_tools//tools/jdk:default_java_toolchain.bzl",
  4. "JDK9_JVM_OPTS",
  5. "default_java_toolchain",
  6. )
  7. default_java_toolchain(
  8. name = "error_prone_warnings_toolchain",
  9. bootclasspath = ["@bazel_tools//tools/jdk:platformclasspath.jar"],
  10. jvm_opts = JDK9_JVM_OPTS,
  11. package_configuration = [
  12. ":error_prone",
  13. ],
  14. visibility = ["//visibility:public"],
  15. )
  16. # This EP warnings list borrowed from here:
  17. # https://github.com/bazelbuild/BUILD_file_generator/blob/master/tools/bazel_defs/java.bzl
  18. java_package_configuration(
  19. name = "error_prone",
  20. javacopts = [
  21. "-XepDisableWarningsInGeneratedCode",
  22. "-Xep:MissingCasesInEnumSwitch:ERROR",
  23. "-Xep:ReferenceEquality:WARN",
  24. "-Xep:StringEquality:WARN",
  25. "-Xep:WildcardImport:WARN",
  26. "-Xep:AmbiguousMethodReference:WARN",
  27. "-Xep:BadAnnotationImplementation:WARN",
  28. "-Xep:BadComparable:WARN",
  29. "-Xep:BoxedPrimitiveConstructor:ERROR",
  30. "-Xep:CannotMockFinalClass:WARN",
  31. "-Xep:ClassCanBeStatic:ERROR",
  32. "-Xep:ClassNewInstance:WARN",
  33. "-Xep:DefaultCharset:ERROR",
  34. "-Xep:DoubleCheckedLocking:WARN",
  35. "-Xep:ElementsCountedInLoop:WARN",
  36. "-Xep:EqualsHashCode:WARN",
  37. "-Xep:EqualsIncompatibleType:WARN",
  38. "-Xep:ExpectedExceptionChecker:ERROR",
  39. "-Xep:Finally:WARN",
  40. "-Xep:FloatingPointLiteralPrecision:WARN",
  41. "-Xep:FragmentInjection:WARN",
  42. "-Xep:FragmentNotInstantiable:WARN",
  43. "-Xep:FunctionalInterfaceClash:WARN",
  44. "-Xep:FutureReturnValueIgnored:WARN",
  45. "-Xep:GetClassOnEnum:WARN",
  46. "-Xep:ImmutableAnnotationChecker:WARN",
  47. "-Xep:ImmutableEnumChecker:WARN",
  48. "-Xep:IncompatibleModifiers:WARN",
  49. "-Xep:InjectOnConstructorOfAbstractClass:WARN",
  50. "-Xep:InputStreamSlowMultibyteRead:WARN",
  51. "-Xep:IterableAndIterator:WARN",
  52. "-Xep:JUnit3FloatingPointComparisonWithoutDelta:WARN",
  53. "-Xep:JUnitAmbiguousTestClass:WARN",
  54. "-Xep:LiteralClassName:WARN",
  55. "-Xep:MissingFail:ERROR",
  56. "-Xep:MissingOverride:WARN",
  57. "-Xep:MutableConstantField:WARN",
  58. "-Xep:NarrowingCompoundAssignment:WARN",
  59. "-Xep:NonAtomicVolatileUpdate:WARN",
  60. "-Xep:NonOverridingEquals:WARN",
  61. "-Xep:NullableConstructor:WARN",
  62. "-Xep:NullablePrimitive:WARN",
  63. "-Xep:NullableVoid:WARN",
  64. "-Xep:OperatorPrecedence:WARN",
  65. "-Xep:OverridesGuiceInjectableMethod:WARN",
  66. "-Xep:PreconditionsInvalidPlaceholder:WARN",
  67. "-Xep:ProtoFieldPreconditionsCheckNotNull:WARN",
  68. "-Xep:ProtocolBufferOrdinal:WARN",
  69. "-Xep:RequiredModifiers:WARN",
  70. "-Xep:ShortCircuitBoolean:WARN",
  71. "-Xep:SimpleDateFormatConstant:WARN",
  72. "-Xep:StaticGuardedByInstance:WARN",
  73. "-Xep:SynchronizeOnNonFinalField:WARN",
  74. "-Xep:TruthConstantAsserts:WARN",
  75. "-Xep:TypeParameterShadowing:WARN",
  76. "-Xep:TypeParameterUnusedInFormals:WARN",
  77. "-Xep:URLEqualsHashCode:WARN",
  78. "-Xep:UnsynchronizedOverridesSynchronized:WARN",
  79. "-Xep:WaitNotInLoop:WARN",
  80. ],
  81. packages = ["error_prone_packages"],
  82. )
  83. package_group(
  84. name = "error_prone_packages",
  85. packages = [
  86. "//org.eclipse.jgit.ant.test/...",
  87. "//org.eclipse.jgit.ant/...",
  88. "//org.eclipse.jgit.archive/...",
  89. "//org.eclipse.jgit.http.apache/...",
  90. "//org.eclipse.jgit.http.server/...",
  91. "//org.eclipse.jgit.http.test/...",
  92. "//org.eclipse.jgit.junit.http/...",
  93. "//org.eclipse.jgit.junit/...",
  94. "//org.eclipse.jgit.lfs.server.test/...",
  95. "//org.eclipse.jgit.lfs.server/...",
  96. "//org.eclipse.jgit.lfs.test/...",
  97. "//org.eclipse.jgit.lfs/...",
  98. "//org.eclipse.jgit.packaging/...",
  99. "//org.eclipse.jgit.pgm.test/...",
  100. "//org.eclipse.jgit.pgm/...",
  101. "//org.eclipse.jgit.test/...",
  102. "//org.eclipse.jgit.ui/...",
  103. "//org.eclipse.jgit/...",
  104. ],
  105. )