arunkumar9t2 / scabbard

🗡 A tool to visualize Dagger 2 dependency graphs
https://arunkumar9t2.github.io/scabbard
Apache License 2.0
859 stars 35 forks source link

Standalone Android Studio Sample #82

Closed namgk closed 3 years ago

namgk commented 3 years ago

Hi there,

Could you please provide a standalone sample for Android/Hilt integration?

I cannot seem to add/enable scabbard in my project and the provided samples in this repositories have some dependencies to this own project like gradle apply to other gradle files that I have no idea what it is:

apply from: "../../gradle/scabbard-local-processor.gradle"

For my problem, it seems the gradle plugin is not even triggered/executed. There's nothing related to scabbard in the build log.

When I add failOnError, it even said:

warning: The following options were not recognized by any processor: '[scabbard.failOnError, kapt.kotlin.generated]'

My gradle plugins are (if it helps any):

apply plugin: 'com.android.application'
apply plugin: 'com.google.protobuf'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'scabbard.gradle'
apply plugin: 'dagger.hilt.android.plugin'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'com.google.firebase.crashlytics'
namgk commented 3 years ago

Seems like I found something helpful, it works when I added the followings:

implementation "com.google.dagger:dagger:2.35"
kapt "com.google.dagger:dagger-compiler:2.35"

My current project already has these, which I thought was enough:

implementation "com.google.dagger:hilt-android:$hilt_version"
kapt "com.google.dagger:hilt-compiler:$hilt_version"

I think it needs better integration with Hilt-based project.

arunkumar9t2 commented 3 years ago

I will work on adding a sample in a separate repo. Thanks for letting me know.

Yes the workaround seems correct, I will fix detection for next release.

arunkumar9t2 commented 3 years ago

Fixed by https://github.com/arunkumar9t2/scabbard/pull/70

Sample issue is tracked in #41