dagger-reflect icon indicating copy to clipboard operation
dagger-reflect copied to clipboard

Clean up build warnings

Open TWiStErRob opened this issue 6 years ago • 6 comments
trafficstars

... and prevent future ones.

Didn't want to go straight for adding -Werror, because it may clobber local hacking; but I think on CI the commands should include -Pstrict.compilation=true.

TWiStErRob avatar Feb 08 '19 22:02 TWiStErRob

I've merged e62ad1ba6ef3c6dc52350c95dab10cba84a367f8 and 4f75adaf65d222dabe3c010ee7566dca7f3994be. I'm still thinking about the others. I think bf2 might be obsoleted by a change I'm about to make to bindings and I need to think about 0c4 more. I'm all for more of the error-prone warnings but I'm a bit skeptical of the java ones. Maybe we can turn it on until they annoy me.

JakeWharton avatar Feb 09 '19 05:02 JakeWharton

0c4e911 is unlikely to produce anything other than unchecked, rawtypes and deprecation, which all would be visible in IDEA anyway as warnings, so quick to notice and usually very easy to fix. If "unlikely" is not good enough, it's always an option to flip it around from -Xlint:all -Xlint:-processing -Xlint:-classfile to -Xlint:unchecked -Xlint:rawtypes -Xlint:deprecation.

TWiStErRob avatar Feb 09 '19 05:02 TWiStErRob

Rebased and fixed all of the current warnings. gradlew clean check runs without warnings, except:

This unfixable warning from AGP:

> Task :integration-tests:android:processCodegenDebugResources
Changing the value for a property with a final value has been deprecated. This will fail with an error in Gradle 6.0.

and this Errorprone warning which is fixed in #156

> Task :reflect:compileJava
P:\projects\contrib\github-dagger2-reflect\reflect\src\main\java\dagger\reflect\Scope.java:82: warning: [ObjectToString] Linker is final and does not override Object.toString, so converting it to a string will print its identity (e.g. `Linker@ 4488aabb`) instead of useful information
.
                + linker); // TODO nice error message with scope chain
                  ^
    (see https://errorprone.info/bugpattern/ObjectToString)
1 warning

TWiStErRob avatar Aug 03 '19 11:08 TWiStErRob

Double-force-pushed to resolve the conflict (deleted file in another PR) and see the code review changes: https://github.com/JakeWharton/dagger-reflect/compare/a524045a02c38ec895911264f989ef7d7ea9e3fa..1efaa5293e48123358781e6067cebf83574c3e91

TWiStErRob avatar Aug 05 '19 22:08 TWiStErRob

I've merged and cherry-picked about 7 or 8 of the commits in this PR.

JakeWharton avatar Aug 06 '19 02:08 JakeWharton

I've merged and cherry-picked about 7 or 8 of the commits in this PR.

ok, thanks; will rebase and continue to discuss the rest

TWiStErRob avatar Aug 07 '19 09:08 TWiStErRob

Only two relevant commits remain:

  • https://github.com/JakeWharton/dagger-reflect/pull/35/commits/472480b037e07d3c31f552d96d9ff5dee2c25ef0 which would be probably solved by a Gradle/AGP upgrade
  • https://github.com/JakeWharton/dagger-reflect/pull/35/commits/1efaa5293e48123358781e6067cebf83574c3e91 which needs reword based on https://github.com/JakeWharton/dagger-reflect/pull/35#discussion_r310857269

Closing this until the project becomes active again.

TWiStErRob avatar Feb 04 '23 21:02 TWiStErRob