aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2024-05-02 15:16:45 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2024-05-02 15:23:55 +0200
commitacbb197355bc1ce3d2be747e3af62a01ca6821e5 (patch)
treed90b6be67723c00db1e85251eb91410bb10c8e62 /tools
parentc8844571b3a483e3cc5f77d18b4e972ad5fe2c5e (diff)
parent98f329e93791a49068adc0bc2f5c81234fe2d943 (diff)
downloadjgit-acbb197355bc1ce3d2be747e3af62a01ca6821e5.tar.gz
jgit-acbb197355bc1ce3d2be747e3af62a01ca6821e5.zip
Merge branch 'master' into next
* master: Bazel: Add support for JDK 21 Bazel: Replace deprecated --experimental_strict_action_env option Fix warning about using raw type [errorprone] Fix pattern ModifiedButNotUsed [errorprone] Fix pattern CatchAndPrintStackTrace [errorprone] Fix pattern FutureReturnValueIgnored [errorprone] Fix pattern BadImport [errorprone] Fix pattern UseCorrectAssertInTests [errorprone] Fix pattern ProtectedMembersInFinalClass [errorprone] Fix pattern CatchFail [errorprone] Fix pattern see UnusedVariable [errorprone] Fix pattern LongLiteralLowerCaseSuffix [errorprone] Fix error pattern JdkObsolete [errorprone] Fix UnnecessaryParentheses errors Bazel: Update RBE docker image to Ubuntu 22.04 and JDK 17 Bump Bazel version to 7.1.1 PackIndex: Make #getOffset protected to allow out-of-package subclasses Change-Id: I4ecde5e6a3cb9f122990893fa97f6d2a9978bcc4
Diffstat (limited to 'tools')
-rw-r--r--tools/BUILD36
-rw-r--r--tools/remote-bazelrc11
2 files changed, 29 insertions, 18 deletions
diff --git a/tools/BUILD b/tools/BUILD
index c2b2366c49..c7ec638645 100644
--- a/tools/BUILD
+++ b/tools/BUILD
@@ -17,7 +17,7 @@ default_java_toolchain(
default_java_toolchain(
name = "error_prone_warnings_toolchain_java17",
configuration = dict(),
- java_runtime = "@bazel_tools//tools/jdk:remotejdk_17",
+ java_runtime = "@rules_java//toolchains:remotejdk_17",
package_configuration = [
":error_prone",
],
@@ -26,6 +26,18 @@ default_java_toolchain(
visibility = ["//visibility:public"],
)
+default_java_toolchain(
+ name = "error_prone_warnings_toolchain_java21",
+ configuration = dict(),
+ java_runtime = "@rules_java//toolchains:remotejdk_21",
+ package_configuration = [
+ ":error_prone",
+ ],
+ source_version = "21",
+ target_version = "21",
+ visibility = ["//visibility:public"],
+)
+
# Error Prone errors enabled by default; see ../.bazelrc for how this is
# enabled. This warnings list is originally based on:
# https://github.com/bazelbuild/BUILD_file_generator/blob/master/tools/bazel_defs/java.bzl
@@ -62,7 +74,7 @@ java_package_configuration(
"-Xep:AutoValueSubclassLeaked:WARN",
"-Xep:BadAnnotationImplementation:ERROR",
"-Xep:BadComparable:ERROR",
- "-Xep:BadImport:WARN",
+ "-Xep:BadImport:ERROR",
"-Xep:BadInstanceof:ERROR",
"-Xep:BadShiftAmount:ERROR",
"-Xep:BanSerializableRead:ERROR",
@@ -75,8 +87,8 @@ java_package_configuration(
"-Xep:CacheLoaderNull:ERROR",
"-Xep:CannotMockFinalClass:ERROR",
"-Xep:CanonicalDuration:ERROR",
- "-Xep:CatchAndPrintStackTrace:WARN",
- "-Xep:CatchFail:WARN",
+ "-Xep:CatchAndPrintStackTrace:ERROR",
+ "-Xep:CatchFail:ERROR",
"-Xep:ChainedAssertionLosesContext:ERROR",
"-Xep:ChainingConstructorIgnoresParameter:ERROR",
"-Xep:CharacterGetNumericValue:ERROR",
@@ -158,7 +170,7 @@ java_package_configuration(
"-Xep:FromTemporalAccessor:ERROR",
"-Xep:FunctionalInterfaceClash:ERROR",
"-Xep:FunctionalInterfaceMethodChanged:ERROR",
- "-Xep:FutureReturnValueIgnored:WARN",
+ "-Xep:FutureReturnValueIgnored:ERROR",
"-Xep:FuturesGetCheckedIllegalExceptionType:ERROR",
"-Xep:GetClassOnAnnotation:ERROR",
"-Xep:GetClassOnClass:ERROR",
@@ -222,7 +234,7 @@ java_package_configuration(
"-Xep:JavaPeriodGetDays:ERROR",
"-Xep:JavaTimeDefaultTimeZone:ERROR",
"-Xep:JavaUtilDate:WARN",
- "-Xep:JdkObsolete:WARN",
+ "-Xep:JdkObsolete:ERROR",
"-Xep:JodaConstructors:ERROR",
"-Xep:JodaDateTimeConstants:ERROR",
"-Xep:JodaDurationWithMillis:ERROR",
@@ -251,7 +263,7 @@ java_package_configuration(
"-Xep:LockOnBoxedPrimitive:ERROR",
"-Xep:LogicalAssignment:ERROR",
"-Xep:LongFloatConversion:ERROR",
- "-Xep:LongLiteralLowerCaseSuffix:WARN",
+ "-Xep:LongLiteralLowerCaseSuffix:ERROR",
"-Xep:LoopConditionChecker:ERROR",
"-Xep:LoopOverCharArray:ERROR",
"-Xep:LossyPrimitiveCompare:ERROR",
@@ -270,7 +282,7 @@ java_package_configuration(
"-Xep:MixedDescriptors:ERROR",
"-Xep:MixedMutabilityReturnType:WARN",
"-Xep:MockitoUsage:ERROR",
- "-Xep:ModifiedButNotUsed:WARN",
+ "-Xep:ModifiedButNotUsed:ERROR",
"-Xep:ModifyCollectionInEnhancedForLoop:ERROR",
"-Xep:ModifyingCollectionWithItself:ERROR",
"-Xep:ModifySourceCollectionInStream:ERROR",
@@ -323,7 +335,7 @@ java_package_configuration(
"-Xep:PreferredInterfaceType:OFF",
"-Xep:PrimitiveAtomicReference:ERROR",
"-Xep:PrivateSecurityContractProtoAccess:ERROR",
- "-Xep:ProtectedMembersInFinalClass:WARN",
+ "-Xep:ProtectedMembersInFinalClass:ERROR",
"-Xep:ProtoBuilderReturnValueIgnored:ERROR",
"-Xep:ProtocolBufferOrdinal:ERROR",
"-Xep:ProtoDurationGetSecondsGetNano:ERROR",
@@ -396,7 +408,7 @@ java_package_configuration(
"-Xep:UnnecessaryLambda:ERROR",
"-Xep:UnnecessaryMethodInvocationMatcher:ERROR",
"-Xep:UnnecessaryMethodReference:ERROR",
- "-Xep:UnnecessaryParentheses:WARN",
+ "-Xep:UnnecessaryParentheses:ERROR",
"-Xep:UnnecessaryTypeArgument:ERROR",
"-Xep:UnrecognisedJavadocTag:ERROR",
"-Xep:UnsafeFinalization:ERROR",
@@ -407,10 +419,10 @@ java_package_configuration(
"-Xep:UnusedException:ERROR",
"-Xep:UnusedMethod:WARN",
"-Xep:UnusedNestedClass:ERROR",
- "-Xep:UnusedVariable:WARN",
+ "-Xep:UnusedVariable:ERROR",
"-Xep:URLEqualsHashCode:ERROR",
"-Xep:UseBinds:ERROR",
- "-Xep:UseCorrectAssertInTests:WARN",
+ "-Xep:UseCorrectAssertInTests:ERROR",
"-Xep:VariableNameSameAsType:ERROR",
"-Xep:VarTypeName:ERROR",
"-Xep:WaitNotInLoop:ERROR",
diff --git a/tools/remote-bazelrc b/tools/remote-bazelrc
index 0c558f8136..f8aabd28ae 100644
--- a/tools/remote-bazelrc
+++ b/tools/remote-bazelrc
@@ -30,12 +30,11 @@ build:remote --disk_cache=
# Set several flags related to specifying the platform, toolchain and java
# properties.
-build:remote --crosstool_top=@rbe_jdk11//cc:toolchain
-build:remote --extra_toolchains=@rbe_jdk11//config:cc-toolchain
-build:remote --extra_execution_platforms=@rbe_jdk11//config:platform
-build:remote --host_platform=@rbe_jdk11//config:platform
-build:remote --platforms=@rbe_jdk11//config:platform
-build:remote --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
+build:remote --crosstool_top=@ubuntu2204_jdk17//cc:toolchain
+build:remote --extra_toolchains=@ubuntu2204_jdk17//config:cc-toolchain
+build:remote --extra_execution_platforms=@ubuntu2204_jdk17//config:platform
+build:remote --host_platform=@ubuntu2204_jdk17//config:platform
+build:remote --platforms=@ubuntu2204_jdk17//config:platform
# Set various strategies so that all actions execute remotely. Mixing remote
# and local execution will lead to errors unless the toolchain and remote