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

Test annotationProcessor dependencies aren't added properly in 17.1 #385

Closed
seanabraham opened this issue Feb 9, 2017 · 2 comments
Closed
Labels

Comments

@seanabraham
Copy link
Contributor

When upgrading from okbuck 15.7 to 17.1, I noticed that tests were failing because of missing Dagger components. The Dagger components were missing because the annotation processor didn't run and diffing the BUCK files shows that the annotation_processor block is totally missing with 17.1.

The dependencies were added like:

module_a/build.gradle:

...
dependencies {
    ...
    testCompile project(':dagger_test_base')
    ...
}

dagger_test_base/build.gradle:

dependencies {
    ...
    compile deps.support.appCompat
    compile deps.mockito
    compile deps.dagger
    compile deps.okhttp3.mockwebserver
    compile deps.guava
    annotationProcessor deps.daggerCompiler
    ...
}

Adding the dependency directly to module_a like the following remedies the problem but it is not an ideal solution:

...
dependencies {
    ...
    testCompile project(':dagger_test_base')
    testAnnotationProcessor deps.daggerCompiler
    ...
}

cc @kageiit @felipecsl

@kageiit
Copy link
Contributor

kageiit commented Feb 9, 2017

The current behavior is actually the correct behavior. annotationProcessor dependencies are never exported up the dependency chain.

The earlier okbuck versions basically applied all annotation processors from the main annotationProcessor configuration to all rules of that module. This is incorrect behavior as reported in #360 . The latest version of okbuck fixes this so that if you need an annotation processor to run on your test code, you would need to specify testAnnotationProcessor explictly

@kageiit kageiit added the wontfix label Feb 9, 2017
@seanabraham
Copy link
Contributor Author

Thanks for the update.

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

No branches or pull requests

2 participants