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