Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't figure out how to use okbuck with autovalue on a Java project #883

Open
msridhar opened this issue Oct 11, 2019 · 6 comments
Open

Comments

@msridhar
Copy link
Contributor

Example:

https://github.com/msridhar/okbuck-ep-test/tree/autovalue

Clone the repo and check out the autovalue branch. If you run ./gradlew :module:compileJava, things run fine. But if you try to run ./gradlew :module:okbuck -Dokbuck.wrapper=true you get an error:

Execution failed for task ':module:okbuck'.
> autoValueConfigurations should be present if adding autoValue dependencies. missing: [DefaultExternalModuleDependency{group='com.google.auto.value', name='auto-value', version='1.6.6', configuration='default'}]

I tried copying over the config from the v0.48.2 release notes (see the top-level build.gradle) but that didn't seem to remove the error. Any suggestions on how I can get this working? @kageiit

@msridhar
Copy link
Contributor Author

@kageiit @raviagarwal7 gentle ping

@raviagarwal7
Copy link
Collaborator

you would need to add auto value configuration as well since auto value is being used alone in the project.

okbuck {
    externalDependencies {
        autoValueConfigurations = [
            "autoValue",
            "autoValueAnnotations"
        ]
    }
}

def autoValueDeps = ['com.google.auto.value:auto-value:1.6.6']
def autoValueAnnotationsDeps = autoValueDeps + ['com.google.auto.value:auto-value-annotations:1.6.6']

afterEvaluate {
    dependencies {
         autoValue autoValueDeps
         autoValueAnnotations autoValueAnnotationsDeps
    }
}

@msridhar
Copy link
Contributor Author

@raviagarwal7 that’s pretty much what I have in my top level build.gradle:

https://github.com/msridhar/okbuck-ep-test/blob/autovalue/build.gradle

Is there something wrong there?

@msridhar
Copy link
Contributor Author

Update: when I copy exactly the the config from @raviagarwal7's comment then it works! It would be cool if this were documented somewhere on the wiki, though. Also I'm still not sure why my version didn't work.

@msridhar
Copy link
Contributor Author

My issue is solved, but I'm leaving this issue open for better docs

@kageiit
Copy link
Contributor

kageiit commented Jul 17, 2020

@raviagarwal7 can you please copy over text from #844 to the wiki as you see fit and close this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants