airbnb / DeepLinkDispatch

A simple, annotation-based library for making deep link handling better on Android
http://nerds.airbnb.com/deeplinkdispatch/
4.39k stars 406 forks source link

latest release v3.0.0-rc1 - broken annotation processor #138

Closed OleksandrKucherenko closed 7 years ago

OleksandrKucherenko commented 7 years ago

I try to run latest release on project in development.

Status: v3.0.0-rc1 - broken v2.0.1 - passed

P.S. latest release force one extra line in gradle:

 buildscript {
     repositories {
         jcenter()
         mavenLocal()
         mavenCentral()
     }
     dependencies {
         /* Force usage of the latest findbugs annotations. */
         classpath "com.google.code.findbugs:jsr305:+"
     }
 }

some kind of the clash with findbug tool and deepLink lib.

felipecsl commented 7 years ago

@OleksandrKucherenko can you post the stacktrace? Also did you follow the updated steps on the README? 3.0.0-rc1 has breaking changes and your code won't work "as-is"

OleksandrKucherenko commented 7 years ago

Ok, so instructions for updates from prev version are:

step 1: declare AppDeepLinkModule class with annotation @DeepLinkModule step 2: modify deep link handler activity: a) change annotation declaration to @DeepLinkHandler({AppDeepLinkModule.class}) b) change implementation inside the activity:

        final DeepLinkDelegate delegate = new DeepLinkDelegate(new AppDeepLinkModuleLoader());
        delegate.dispatchFrom(this);

c) change import of DeepLinkDelegate class. Its now in the same package as a deeplink handler.

Concerns: 1) during compilation gradle do not show any error message, that will at least give any idea to developer what is wrong inside the code 2) generated class has a fancy names, but that also force to re-configure the static analysis exclude list. Best will be to use one of the Dagger/AutoValue approaches - when a generated class name has a specific pattern in name. Than codecoverage report and static analysis tools will be configured only once for a long time.

Thanks for updates! Great lib!

felipecsl commented 7 years ago

Thanks for the feedback, that's valuable, especially 1. about not failing the build when parts are missing. We'll add more checks around that

  1. The generated class name is always the same name of the annotated class + Loader. Dagger uses the Dagger prefix and AutoValue is AutoValue_. I believe what we're doing is similar and you're always able to know what the generated class name would be. Maybe Loader is a too generic of a word and we need something more specific?
OleksandrKucherenko commented 7 years ago

my first assumption was "DeepLink_*"