Skip to content

Commit

Permalink
Update Truth, ErrorProne, and NullAway (#266)
Browse files Browse the repository at this point in the history
* Update Truth to 0.42

0.42
Made various dependency fixes and upgrades, including fixing #473 and #467. Note that some annotations-only dependencies are now no longer <provided>. See google/guava#2721 for details, but in short, feel free to exclude them if that works for your setup.
Fixed NPE in MapSubject.containsExactly (#468).

0.41
Changed most of Truth's failure messages to a multi-line, key-value format. Provided an API for testing messages of this format. (4a51035)
Introduced the new API for building failure messages in a "key: value" format. See Subject.failWithActual and failWithoutActual, which use the new Fact class. (e06ca85)
Changed the old API's failure messages to automatically add a "name: ..." field if the user called named(). In some cases, this adds a name where it was missing before; in others, it duplicates a name that is already present. The long-term fix for this will be to migrate to the new failure API, which always includes the name once, and possibly also to delete named() in favor of withMessage(). (911c939)
Deprecated failWithRawMessageAndCause. Truth automatically attaches the cause if it's part of the assertion chain. If not, see the deprecation docs for the workaround. (3622e9c)
Deprecated failComparing. Use check("foo").that(actual().foo()).isEqualTo(expectedFoo). (2db2a4f)
Deprecated the remaining legacy fail* methods. (1f9b2d6)
Hid protected method IterableSubject.failWithBadResultsAndSuffix() (5becbfe).
Started throwing ComparisonFailure from MapSubject.containsEntry. (4330ec6)
Started throwing ComparisonFailure from assertThat(singleElementIterable).containsExactly(otherSingleElementIterable). (e44edd1)
Added code to remove Runner and Statement frames from the stack trace. (d2bb074)
Added StringSubject.ignoringCase() (13e8054)
Added ignoringExtraRepeatedFieldElements() to ProtoTruth. (f070204)
Added comparingExpectedFieldsOnly() to ProtoTruth. (08908c1)
Removed deprecated MultimapSubject.containsExactly(Multimap). Use containsExactlyEntriesIn(Multimap). (containsExactly(Object k0, Object v0, Object... rest) continues to exist.) (9c80ad5)
Removed deprecated isPartiallyOrdered() methods. Use isOrdered() (5becbfe).
Started throwing UOE from IterableSubject.isNoneOf() and isNotIn(). (46c8d3d)
Switched to Checker Framework @NullableDecl instead of jsr305 @nullable. Tools that read these annotations may need to be updated to recognize the new annotation. (10ee459)

* Update NulLAway to 0.6.0

* Update ErrorProne to 2.3.2

Highlights:
Opt-in check AndroidJdkLibsChecker enforces which JDK libraries can be used in Android applications, and, with the -XepOpt:Android:Java8Libs flag, can allow select Java 8 library support via https://developer.android.com/studio/write/java8-support. Look out for this in bazel.build after the next release.
Immutable{Annotation,Enum}Checker now requires the Error Prone @immutable annotation, not the JSR-305 @immutable annotation
New Checks:
Javadoc Checkers: InvalidParam, InvalidTag, InvalidThrows, ReturnFromVoid
API Checkers: AndroidJdkLibsChecker, Java7ApiChecker, ApiDiffChecker
AnnotateFormatMethod
AnnotationPosition
ArrayAsKeyOfSetOrMap
AutoValueFinalMethods
BadInstanceof
BigDecimalEquals
ClassNamedLikeTypeParameter
CloseableProvides
ComparingThisWithNull
DeprecatedThreadMethods
EqualsBrokenForNull
EqualsGetClass
EqualsUnsafeCast
EqualsUsingHashCode
EqualsWrongThing
ExpectedExceptionRefactoring
ExtendingJUnitAssert
FloatingPointAssertionWithinEpsilon
ImmutableRefactoring
InconsistentHashCode
InjectOnMemberAndConstructor
LockNotBeforeTry
MathAbsoluteRandom
MathRoundIntLong
MissingTestCall
ModifiedButNotUsed
NoFunctionalReturnType
NullableDereference
ObjectsHashCodePrimitive
ProtoRedundantSet
ProtosAsKeyOfSetOrMap
SubstringOfZero
SwigMemoryLeak
SystemExitOutsideMain
TestExceptionRefactoring
ThreadPriorityCheck
ToStringReturnsNull
TruthAssertExpected
TypeNameShadowing
UndefinedEquals
UnnecessaryParentheses
UnsafeReflectiveConstructionCast
UnusedException
VariableNameSameAsType

* AGP 3.2.1

* Fix misconfigured errorProne javac
  • Loading branch information
ZacSweers authored Oct 15, 2018
1 parent 327da40 commit 9d14e9c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def versions = [
androidTest: '1.1.0-beta01',
archLifecycle: '2.0.0',
dokka: '0.9.17',
errorProne: '2.3.1',
errorProne: '2.3.2',
errorPronePlugin: '0.0.13',
kotlin: '1.2.71'
]
Expand All @@ -36,12 +36,13 @@ def build = [
javaVersion: JavaVersion.VERSION_1_8,

errorProne: "com.google.errorprone:error_prone_core:${versions.errorProne}",
errorProneJavac: "com.google.errorprone:javac:9+181-r4173-1",
errorProneCheckApi: "com.google.errorprone:error_prone_check_api:${versions.errorProne}",
errorProneTestHelpers: "com.google.errorprone:error_prone_test_helpers:${versions.errorProne}",
nullAway: 'com.uber.nullaway:nullaway:0.4.7',
nullAway: 'com.uber.nullaway:nullaway:0.6.0',

gradlePlugins: [
android: 'com.android.tools.build:gradle:3.2.0',
android: 'com.android.tools.build:gradle:3.2.1',
dokka: "org.jetbrains.dokka:dokka-gradle-plugin:${versions.dokka}",
dokkaAndroid: "org.jetbrains.dokka:dokka-android-gradle-plugin:${versions.dokka}",
kotlin: "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
Expand Down Expand Up @@ -78,7 +79,7 @@ def test = [
androidRules: "androidx.test:rules:${versions.androidTest}",
androidOrchestrator: "androidx.test:orchestrator:${versions.androidTest}",
junit: 'junit:junit:4.12',
truth: 'com.google.truth:truth:0.40'
truth: 'com.google.truth:truth:0.42'
]

ext.deps = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ dependencies {
testImplementation project(':autodispose')
testImplementation project(':lifecycle:autodispose-lifecycle')

epJavac deps.build.errorProneCheckApi
epJavac deps.build.errorProneJavac
}

tasks.withType(JavaCompile) {
Expand Down

0 comments on commit 9d14e9c

Please sign in to comment.