uber / motif

A simple DI API for Android / Java
Apache License 2.0
532 stars 43 forks source link

Does this work w/ kapt? #39

Closed kenyee closed 5 years ago

kenyee commented 5 years ago

Added this to my build.gradle

    kapt "com.uber.motif:motif-compiler:${motifVersion}"
    api "com.uber.motif:motif:${motifVersion}"

and tried to follow the sample, but RootFactoryImpl doesn't get generated.

Leland-Takamine commented 5 years ago

Thanks for raising this - I'll put up an example of Kotlin usage. Tracking here #40.

Leland-Takamine commented 5 years ago

Added an example of how to use with kapt here: #41.

Perhaps you forgot to add this line in your build.gradle?

apply plugin: 'kotlin-kapt'
kenyee commented 5 years ago

we added Kotlin into the project last year, so definitely not missing that apply plugin. We actually have all three in all modules:

apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

Back to trying to figure out how to debug this. Tried doing:

gradle assembleKayakFreeDebug --debug | grep -i motif

but didn't see any helpful debug logging. Took out the RootFactory and even the RootScopeImpl doesn't seem to be generated. Will post back if I figure out why...going to try getting Dagger2 working in the same branch since Motif should interop and maybe that will give me a clue...

Leland-Takamine commented 5 years ago

If you're able to send over a stripped down repro case I can try to debug on my end too.

Leland-Takamine commented 5 years ago

@kenyee Were you able to figure this out?

kenyee commented 5 years ago

Sorry, haven't circled back yet...been trying to get Koin integrated better into our app and remove the old home grown service locator which is everywhere including unit tests :-( I'll close this for now and re-open if I set up a good small repro sample.

Ericliu001 commented 3 years ago

Hi @kenyee, have you ran into problem using ScopeFactory when using kapt?

220