A script to run cargo and generate Android.bp.

* Usage note and help for command flags in the script.
  * Run cargo -v multiple times and collect output in cargo.out.
  * Use target.tmp as temporary working directory.
  * Generate multiple Android.bp files into subdirectories.
  * Simplified package names, without version number.
* Merged Android.bp modules.
  * Use --device flag to generate both host and device build targets
    in a combined module.
  * Use --tests flag to generate rust_test modules, with auto_gen_config,
    and multiple unit tests merged in one module.
* Generate cc_library_static modules for rust packages that call
  'cc' and 'ar' to build static C/C++ libraries.
  * Use the --vv flag to call cargo with -vv.
* Limitations:
  * Cargo.toml and its build scripts might need fix for Android first.
  * Depending on user given cargo parameters.
* TODOs:
  * Handle multiple crate types in one rustc command line.
  * Smart merge of host and device rust_test modules,
    to handle device tests that depend on dynamic libraries.
  * Handle special Rust packages that use only build scripts
    and C/C++ compilers to generate included files.

Bug: 142209566
Test: In rust project directories: cargo2android.py --run
Change-Id: Id54652b1e0a6e5fc16619cd05f5b057eee79d610
1 file changed