Accept multiple --crate-type and fix for new cargo.

* Change crate_type string to crate_types list.
  In dump_android_module, iterate over crate_types and
  call dump_one_android_module for each crate type.
* In decide_one_module_type, add mapping of Rust crate types:
        lib => rlib         (no change)
        rlib => rlib        (new)
        dylib => dylib      (new)
        cdylib => shared    (changed)
        staticlib => static (new)
  Maybe we should change and map 'lib' to 'lib',
  but before that, crate_types should not contain
  both 'lib' and 'rlib'.
* Accept new cargo output format, which can
  call rustc with the main source file name after
  other flags, not always after the "--crate-name" flag.
* Work around duplicated test module name problem;
  call self.runner.claim_module_name for every named test module.

Bug: 153118477
Test: fetch quiche-0.3.0, bindgen-0.53.2 and other Rust crates
Test: cargo2android.py --run --vv --device --tests
Change-Id: Id65c3929b5c593df73f26f1510ad7e89194b209e
1 file changed