diff options
author | Colin Cross <ccross@android.com> | 2017-09-05 13:19:32 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2017-09-05 13:19:32 -0700 |
commit | e6e85f9b4fdf38d548bcf240f45a652c4ec7412e (patch) | |
tree | 8b001ef07604fd442fc23631720cbec51a1b99d6 /soong/error_prone.go | |
parent | 0fc37229d73c096278e0b8d29c849e36e1ffea6f (diff) | |
download | error_prone-e6e85f9b4fdf38d548bcf240f45a652c4ec7412e.tar.gz |
Move error_prone config to external/error_prone
The error_prone config will likely need to be updated at the same
time as the error_prone prebuilts, so move the config into the same
project. This requires jumping through some hoops because
external/error_prone may not be present in all manifests.
Bug: 64489631
Test: m -j RUN_ERROR_PRONE=true
Change-Id: I0d39da30e88bfbd849002956066021f380e48f7b
Diffstat (limited to 'soong/error_prone.go')
-rw-r--r-- | soong/error_prone.go | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/soong/error_prone.go b/soong/error_prone.go new file mode 100644 index 0000000..cb857c7 --- /dev/null +++ b/soong/error_prone.go @@ -0,0 +1,98 @@ +// Copyright 2017 Google Inc. All rights reserved. +// +// 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 error_prone + +import ( + "strings" + + "android/soong/java/config" +) + +func init() { + // These values are set into build/soong/java/config/config.go so that soong doesn't have any + // references to external/error_prone, which may not always exist. + config.ErrorProneJavacJar = "external/error_prone/javac/javac-9-dev-r3297-4.jar" + config.ErrorProneJar = "external/error_prone/error_prone/error_prone_core-2.0.19-with-dependencies.jar" + config.ErrorProneClasspath = strings.Join([]string{ + "external/error_prone/error_prone/error_prone_annotations-2.0.19.jar", + "external/error_prone/checkerframework/dataflow-1.8.10.jar", + "external/error_prone/checkerframework/javacutil-1.8.10.jar", + "external/error_prone/jFormatString/jFormatString-3.0.0.jar", + }, ":") + + // The checks that are fatal to the build. + config.ErrorProneChecksError = strings.Join([]string{ + "-Xep:AsyncCallableReturnsNull:ERROR", + "-Xep:AsyncFunctionReturnsNull:ERROR", + "-Xep:BundleDeserializationCast:ERROR", + "-Xep:CompatibleWithAnnotationMisuse:ERROR", + "-Xep:CompileTimeConstant:ERROR", + "-Xep:DaggerProvidesNull:ERROR", + "-Xep:DoNotCall:ERROR", + "-Xep:ForOverride:ERROR", + "-Xep:FunctionalInterfaceMethodChanged:ERROR", + "-Xep:FuturesGetCheckedIllegalExceptionType:ERROR", + "-Xep:GuiceAssistedInjectScoping:ERROR", + "-Xep:GuiceAssistedParameters:ERROR", + "-Xep:GuiceInjectOnFinalField:ERROR", + "-Xep:Immutable:ERROR", + "-Xep:ImmutableModification:ERROR", + "-Xep:IncompatibleArgumentType:ERROR", + "-Xep:IndexOfChar:ERROR", + "-Xep:InjectMoreThanOneScopeAnnotationOnClass:ERROR", + "-Xep:JavaxInjectOnAbstractMethod:ERROR", + "-Xep:JUnit4SetUpNotRun:ERROR", + "-Xep:JUnit4TearDownNotRun:ERROR", + "-Xep:JUnit4TestNotRun:ERROR", + "-Xep:JUnitAssertSameCheck:ERROR", + "-Xep:LiteByteStringUtf8:ERROR", + "-Xep:LoopConditionChecker:ERROR", + "-Xep:MockitoCast:ERROR", + "-Xep:MockitoUsage:ERROR", + "-Xep:MoreThanOneInjectableConstructor:ERROR", + "-Xep:MustBeClosedChecker:ERROR", + "-Xep:NonCanonicalStaticImport:ERROR", + "-Xep:NonFinalCompileTimeConstant:ERROR", + "-Xep:OptionalEquality:ERROR", + "-Xep:OverlappingQualifierAndScopeAnnotation:ERROR", + "-Xep:PackageInfo:ERROR", + "-Xep:PreconditionsCheckNotNull:ERROR", + "-Xep:PreconditionsCheckNotNullPrimitive:ERROR", + "-Xep:ProtoFieldNullComparison:ERROR", + "-Xep:ProvidesMethodOutsideOfModule:ERROR", + "-Xep:RestrictedApiChecker:ERROR", + "-Xep:SelfAssignment:ERROR", + "-Xep:StreamToString:ERROR", + "-Xep:SuppressWarningsDeprecated:ERROR", + "-Xep:ThrowIfUncheckedKnownChecked:ERROR", + "-Xep:ThrowNull:ERROR", + "-Xep:TypeParameterQualifier:ERROR", + "-Xep:UnnecessaryTypeArgument:ERROR", + "-Xep:UnusedAnonymousClass:ERROR", + }, " ") + + config.ErrorProneFlags = strings.Join([]string{ + "com.google.errorprone.ErrorProneCompiler", + "-Xdiags:verbose", + "-XDcompilePolicy=simple", + "-XDallowBetterNullChecks=false", + "-XDusePolyAttribution=true", + "-XDuseStrictMethodClashCheck=true", + "-XDuseStructuralMostSpecificResolution=true", + "-XDuseGraphInference=true", + "-XDandroidCompatible=true", + "-XepAllErrorsAsWarnings", + }, " ") +} |