Generated Dagger components not found when referenced from a different Bazel rule
See original GitHub issueI’m having trouble using Bazel and with dagger.
git clone git@github.com:jschaf/bazel-dagger-example.git
cd bazel-dagger-example
bazel build //java/coffee
$ blaze build java/coffee
INFO: Analysed target //java/coffee:coffee (0 packages loaded).
INFO: Found 1 target...
ERROR: /home/jschaf/bazels/bazel-dagger-example/java/coffee/BUILD:11:1: Building java/coffee/libcoffee_lib.jar (2 source files) and running annotation processors (ComponentProcessor) failed (Exit 1)
bazel-out/k8-fastbuild/bin/java/coffee/_javac/coffee_lib/libcoffee_lib_sourcegenfiles/coffee/DaggerCoffeeApp_Coffee.java:4: error: cannot find symbol
import coffee.dripcoffee.DripCoffeeModule_ProvideHeaterFactory;
^
symbol: class DripCoffeeModule_ProvideHeaterFactory
location: package coffee.dripcoffee
bazel-out/k8-fastbuild/bin/java/coffee/_javac/coffee_lib/libcoffee_lib_sourcegenfiles/coffee/DaggerCoffeeApp_Coffee.java:6: error: cannot find symbol
import coffee.dripcoffee.PumpModule_ProvidePumpFactory;
^
symbol: class PumpModule_ProvidePumpFactory
location: package coffee.dripcoffee
If I move everything under 1 Bazel rule, everything works.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
Dagger 2 component not generated - Stack Overflow
classModule(new ModuleClass()).build();. it can not find DaggerCompClassComponent. I have on module build.gradle apply plugin: 'com.neenbedankt.
Read more >bazel and dagger: problem finding generated sources
I've been able to use other code generating plugins (Google auto value and protocol buffers) with bazel but I'm having trouble with dagger....
Read more >Dependency injection with Dagger and Bazel - ncona.com
The code generated by Dagger and the stack traces shown when something is not working are a lot easier to follow. Dagger and...
Read more >Recently working on a project and followed modularization wi
not api, and this module has Dagger components. Problem starts when dagger kicks in, whe dagger builds the graph it generated all the...
Read more >Automated migration of your projects to Bazel build system ...
Generating code for custom rules and macros. If you want to use the DSL for rules or macros that are not present in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
See #871, with a fix forthcoming.
That’s pretty much the MO of bazel, but do as you choose.