Add basic dist rule implementation.

This rule copies files from its data dependencies into a user-specified
--dist_dir flag to the dist python tool.

Usage example:

```
$ bazel run //build/bazel/rules/dist:dist_bionic_example
--package_path=`pwd`/out/soong/workspace  -- --dist_dir=/tmp/dist
...
[dist] Disting file:
/tmp/dist/bionic/libc/liblibc_bp2build_cc_library_static.a
[dist] Disting file:
/tmp/dist/bionic/libc/liblibc_bp2build_cc_library_shared.so
[dist] Disting file:
/tmp/dist/bionic/libdl/liblibdl_bp2build_cc_library_shared_unstripped.so
[dist] Disting file:
/tmp/dist/bionic/libdl/liblibdl_bp2build_cc_library_shared_toc.so.toc
[dist] Done.
```

The files to dist in dist_bionic_example will then be copied by the tool
to /tmp/dist, maintaining the layout:

```
$ tree /tmp/dist
/tmp/dist
└── bionic
├── libc
│   ├── liblibc_bp2build_cc_library_shared.so
│   └── liblibc_bp2build_cc_library_static.a
└── libdl
    ├── liblibdl_bp2build_cc_library_shared_toc.so.toc
    └── liblibdl_bp2build_cc_library_shared_unstripped.so
```

This initial design is meant for an unbundled Bazel build, not mixed
builds.

It works differently from Soong in that the dist rule determines files
to dist (on the edge), instead of specifying the `dist` property on a
Soong module (on the node), which Soong/Make will analyze over the
entire tree to generate dist-for-goals Make rules. Since unbundled Bazel
builds will not interop with Make and Soong, this rule's sole purpose is
to copy files into a DIST_DIR specified on the command line, so that
unbundled bazel builds are able to store files on Android buildbot's
distdirs.

Test: bazel run //build/bazel/rules/dist:dist_bionic_example --package_path=`pwd`/out/soong/workspace  -- --dist_dir=/tmp/dist
Change-Id: Ifbcce9a1b44b73954ef823613b0f781afb7c7c3d
4 files changed
tree: bf4837d6f568d9461829cae9227ce00dd4a2fd1a
  1. bazel_skylib/
  2. ci/
  3. docs/
  4. examples/
  5. json_module_graph/
  6. platforms/
  7. product_variables/
  8. rules/
  9. rules_cc/
  10. scripts/
  11. tests/
  12. bazel.BUILD
  13. bazel.sh
  14. bazel.WORKSPACE
  15. common.bazelrc
  16. darwin.bazelrc
  17. linux.bazelrc
  18. OWNERS
  19. README.md
README.md

Bazel

The code in this directory is experimental. Bazel support for Android Platform is undergoing active development and workflow stability is currently not guaranteed.