arunkumar9t2 / scabbard

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

Scabbard applies itself even when dagger is not present/used #49

Open ZacSweers opened 4 years ago

ZacSweers commented 4 years ago

This leads to warnings in kapt when it doesn't run

warning: The following options were not recognized by any processor: '[scabbard.failOnError, scabbard.outputFormat, kapt.kotlin.generated, dagger.fullBindingGraphValidation]'
> Task :calendar-api-model:kaptReleaseKotlin
warning: The following options were not recognized by any processor: '[scabbard.failOnError, scabbard.outputFormat, kapt.kotlin.generated, dagger.fullBindingGraphValidation]'
arunkumar9t2 commented 4 years ago

Thanks, noted. Will target a fix for 0.3.1.

arunkumar9t2 commented 4 years ago

I took at shot at this in #53 but it is not fully fixed yet.

New behaviors

  1. Scabbard will lazily apply its dependencies only when the configuration is resolved and dagger is present in the project.
  2. For Java projects, compiler arguments will be added lazily and only if dagger is there.
  3. Kapt is a different story
    • Kapt eagerly evaluates and applies the kapt arguments during plugin application. This means I have to pass arguments very early but at that time dependencies might not be available. Technically I can do configuration.dependencies.all {} or whenObjectAdded but that cause eager evaluation and I want to avoid it for now. Created https://youtrack.jetbrains.com/issue/KT-39521
    • I thought The following options were not recognized by any processor warning was spit out based on supported options alone but it seems to check for supportedTypes as well. Checking for dagger presence alone might not be sufficient to avoid this error. Failing functional test.

I will keep this open and look for any workaround.

arunkumar9t2 commented 3 years ago

Update: I saw this https://github.com/JetBrains/kotlin/commit/19708cfa8708bc36da17601f13fe9921d7a380ef and also now Kapt options are using provider instead of evaluating eagerly. I will investigate if this can be fixed soon,

ruieduardosoares commented 3 years ago

@arunkumar9t2 i also have this issue an nothing is being generated in kapt3/classes/ folder. image