How bazelbuild/rules_android works
This repository provides Android support for Bazel, with the README describing Android build rules and the supplied source tree exposing their supporting tools. The sampled runtime shows independent build-action utilities rather than a single end-to-end implementation: AAR inputs can be unpacked into resources, embedded JARs, native libraries, and ProGuard rules; other tools handle manifests, resources, jars, and deployment. The central Starlark rule implementation is not present in the supplied tree, so its orchestration and links to these tools are not asserted. Several Go tools are shown as standalone components because their callers were not evidenced.
Main entry points: json_worker_wrapper.py JSON worker · junction.py Windows junctions · aar_embedded_proguard_extractor.py AAR ProGuard · aar_resources_extractor.py AAR resources
Components 34
AAR processing
- AAR resources
tools/android/aar_resources_extractor.py - AAR JARs
tools/android/aar_embedded_jars_extractor.py - AAR native libs
tools/android/aar_native_libs_zip_creator.py - AAR ProGuard
tools/android/aar_embedded_proguard_extractor.py - ProGuard extraction
tools/android/proguard_extractor_lib.py - AAR extraction
src/tools/ak/extractaar/extractaar.go
Android artifacts
- Android rules
- Feature manifest merge
rules/android_application/merge_feature_manifests.py - Manifest validation
src/validations/validate_manifest/validate_manifest.py - Android tool dispatcher
src/tools/ak/ak.go - Resource bucketizing
src/tools/ak/bucketize/bucketize.go - Android compilation
src/tools/ak/compile/compile.go - Resource extraction
src/tools/ak/extractresources/extractresources.go - Final resource JAR
src/tools/ak/finalrjar/finalrjar.go - Manifest generation
src/tools/ak/generatemanifest/generatemanifest.go - Resource linking
src/tools/ak/link/link.go - Resource parsing
src/tools/ak/liteparse/liteparse.go - Manifest processing
src/tools/ak/manifest/manifest.go - Minimum SDK floor
src/tools/ak/minsdkfloor/minsdkfloor.go - Native library handling
src/tools/ak/nativelib/nativelib.go - Artifact patching
src/tools/ak/patch/patch.go - Artifact repacking
src/tools/ak/repack/repack.go - Resource JAR
src/tools/ak/rjar/rjar.go - Bundle module builder
src/tools/bundletool_module_builder/bundletool_module_builder.go - Desugar flags
src/tools/extract_desugar_pgcfg_flags/extract_desugar_pgcfg_flags.go - JAR module info
src/tools/jar_to_module_info/jar_to_module_info.go
Deployment
- Deploy metadata
src/tools/deploy_info/deploy_info.go - ADB broker
src/tools/mi/broker/adb.go - Device broker
src/tools/mi/broker/device.go - App deployment
src/tools/mi/deployment/deploy.go - Deploy command
src/tools/mi/deployment/deploy_binary.go
Shared utilities
- JSON worker
tools/android/json_worker_wrapper.py - Windows junctions
tools/android/junction.py
Other components
- Bazel rule user
Connections 10
- Bazel rule user → Android rules: uses rules
- AAR resources → JSON worker: runs through
tools/android/aar_resources_extractor.py - AAR resources → Windows junctions: uses paths
tools/android/aar_resources_extractor.py - AAR JARs → JSON worker: runs through
tools/android/aar_embedded_jars_extractor.py - AAR JARs → Windows junctions: uses paths
tools/android/aar_embedded_jars_extractor.py - AAR native libs → JSON worker: runs through
tools/android/aar_native_libs_zip_creator.py - AAR native libs → Windows junctions: uses paths
tools/android/aar_native_libs_zip_creator.py - AAR ProGuard → JSON worker: runs through
tools/android/aar_embedded_proguard_extractor.py - AAR ProGuard → Windows junctions: uses paths
tools/android/aar_embedded_proguard_extractor.py - AAR ProGuard → ProGuard extraction: delegates extraction
tools/android/aar_embedded_proguard_extractor.py