In the typical android build in Gradle, every module generates and compiles
- A merged R.java file which contains the resource identifiers of all resources from the module and every other module/aar it depends on.
- A copy of all the individual merged R.java of every module/aar it depends on. This is useful as a convenience when referring to resources in code. But this also comes with a significant cost as detailed below.
In buck, the same mechanism of resource merging is supported. Goal is to eliminate the expensive computation (copying, compilation) of all the individual merged R.java of every module/aar it depends on. Here’s why Consider below dependency tree for Android Libraries L1 - L7:
L4