scabbard icon indicating copy to clipboard operation
scabbard copied to clipboard

Scabbard applies itself even when dagger is not present/used

Open ZacSweers opened this issue 5 years ago • 4 comments

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]'

ZacSweers avatar May 21 '20 03:05 ZacSweers

Thanks, noted. Will target a fix for 0.3.1.

arunkumar9t2 avatar May 21 '20 03:05 arunkumar9t2

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 avatar Jun 10 '20 18:06 arunkumar9t2

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,

arunkumar9t2 avatar Apr 19 '21 16:04 arunkumar9t2

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

ruieduardosoares avatar May 01 '21 11:05 ruieduardosoares