okbuck icon indicating copy to clipboard operation
okbuck copied to clipboard

[Question] How to debug missing autoValueConfigurations?

Open dbworku opened this issue 4 years ago • 0 comments

Is there some sort of debugging flag that I can add to better understand why my okbuck tasks are failing with autoValueConfigurations should be present if adding autoValue dependencies?

I believe that I've predefined the autovalue extensions in okbuck to match the reported failure. Obviously, I'm missing something subtle that the failure message doesn't highlight.

Gradle file setup

Here's what I've added to the root build.gradle

if ((providers.systemProperty('okbuck.wrapper').forUseAtConfigurationTime().orNull ?: 'false').toBoolean()) {
    apply plugin: 'com.uber.okbuck'

    okbuck {
        externalDependencies {
            autoValueConfigurations = [
                "autoValue",
                "autoValueGson",
                "autoValueParcel",
            ]
        }
    }

    def autoValueDeps = ["com.google.auto.value:auto-value:1.6.5"]
    def autoValueGsonDeps = autoValueDeps + ["com.ryanharter.auto.value:auto-value-gson:0.6.0"]
    def autoValueParcelDeps = autoValueDeps + ["com.ryanharter.auto.value:auto-value-parcel:0.2.6"]

    afterEvaluate {
        dependencies {
            autoValue autoValueDeps
            autoValueGson autoValueGsonDeps
            autoValueParcel autoValueParcelDeps
        }
    }
}

Also, if you're curious here's an excerpt the dependencies of one of the gradle files for a submodule that produces the failure.

    implementation Dependencies.autoValueAnnotations
    kapt Dependencies.autoValue
    kapt Dependencies.autoValueGson
    kapt Dependencies.autoValueParcel
    implementation Dependencies.autoValueGsonAnnotations

Buck failure

./gradlew :RootModule:okbuck -Dokbuck.wrapper=true
...
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':RootModule:some-submodule:okbuck'.>
> autoValueConfigurations should be present if adding autoValue dependencies. missing: [DefaultExternalModuleDependency{group='com.google.auto.value', name='auto-value', version='1.6.5', configuration='default'}, DefaultExternalModuleDependency{group='com.ryanharter.auto.value', name='auto-value-gson', version='0.6.0', configuration='default'}, DefaultExternalModuleDependency{group='com.ryanharter.auto.value', name='auto-value-parcel', version='0.2.6', configuration='default'}]

What I tried

My presume that my situation is similar to #883 #896. However, the suggestions in those cases didn't help. Specifically, I tired to:

  1. Use auto-value-annotations instead of auto-value. (This is what was listed in the okbuck V0.48.2 release notes)
 okbuck {
        externalDependencies {
            autoValueConfigurations = [
                "autoValueAnnotations",
                "autoValueGson",
                "autoValueParcel",
            ]
        }
    }
    def autoValueDeps = ["com.google.auto.value:auto-value:1.6.5", "com.google.auto.value:auto-value-annotations:1.6.5"]
    def autoValueGsonDeps = autoValueDeps + ["com.ryanharter.auto.value:auto-value-gson:0.6.0"]
    def autoValueParcelDeps = autoValueDeps + ["com.ryanharter.auto.value:auto-value-parcel:0.2.6"]

    afterEvaluate {
        dependencies {
            autoValueAnnotations autoValueDeps
            autoValueGson autoValueGsonDeps
            autoValueParcel autoValueParcelDeps
        }
    }
  1. Add auto-value-annotations and auto-value to the autoValueConfigurations
 okbuck {
        externalDependencies {
            autoValueConfigurations = [
                "autoValue",
                "autoValueAnnotations",
                "autoValueGson",
                "autoValueParcel",
            ]
        }
    }
    def autoValueDeps = ['com.google.auto.value:auto-value:1.6.5']
    def autoValueAnnotationsDeps = autoValueDeps + ['com.google.auto.value:auto-value-annotations:1.6.5']
    def autoValueGsonDeps = autoValueDeps + ["com.ryanharter.auto.value:auto-value-gson:0.6.0"]
    def autoValueParcelDeps = autoValueDeps + ["com.ryanharter.auto.value:auto-value-parcel:0.2.6"]

    afterEvaluate {
        dependencies {
            autoValue autoValueDeps
            autoValueAnnotations autoValueAnnotationsDeps
            autoValueGson autoValueGsonDeps
            autoValueParcel autoValueParcelDeps
        }
    }

dbworku avatar Apr 23 '21 21:04 dbworku