Introduce DexJavaLibraryIfItContainsClassFiles Buildable.

`DexJavaLibraryIfItContainsClassFiles` is a `Buildable` that takes the output of a `JavaLibraryRule` and
and dexes it, assuming the output of the `JavaLibraryRule` contains `.class` files.
It relies on an `AccumulateClassNames` to determine whether there are `.class` files to dex.

Once `DexJavaLibraryIfItContainsClassFiles` has the path to the classes file,
it uses a `FileExistsAndIsNotEmptyStep` combined with a `ConditionalStep` to
make sure that the list of `.class` files is non-empty before running the `DxStep`
because `dx` will fail if it is run on input that does not contain any `.class` files.

Test Plan: Sandcastle builds.
6 files changed
tree: e133a88e4c8c16d95bcac5df4df48bd1e8973a47
  1. .buckconfig
  2. .classpath
  3. .gitignore
  4. .idea/
  5. .project
  6. .travis.yml
  7. DEFS
  10. bin/
  11. buck.iml
  12. build.xml
  13. config/
  14. docs/
  15. lib/
  16. plugin/
  17. pmd/
  18. scripts/
  19. src/
  20. test/
  21. testdata/
  22. third-party/


Buck is an Android build tool. To see what Buck can do for you, check out the documentation at

Build Status


To build Buck, run the following:

git clone
cd buck
./bin/buck --help


Apache License 2.0