The term srcjar_deps is a bit confusing IMO, and we should be able to explain it in a better way.
We should explain a variety of things:
1. 'srcjar's are jars containing .java files (as opposed to .class files).
2. 'srcjar_deps' (as you can define in e.g. an android_library target) is a set of dependencies (targets) building srcjars - the current target will compile the .java files in those srcjars and add them to the library target (as opposed to just linking against a jar of class-files).
3. 'srcjars' (as you can define in e.g. an android_library target) is a set of 'srcjar's (i.e. these are explicitly named srcjar files rather than targets defining srcjar files).
4. Adding the same srcjar to the srcjar_deps declarations of several different android_library targets means compiling the same .java files into several different libraries (thus resulting in an error because the same file shouldn't be declared in several different libraries).
This is a pretty long explanation so I'm not sure where we could put it without bloating the original documentation (when I looked for an explanation to srcjar_deps I took a look at the definition of the android_library template, so somewhere around there might be good).
Comment 1 by luo12912...@gmail.com
, Feb 16 2017