c2a: add option to use Cargo.toml.orig
`Cargo --publish` strips dev-dependencies from Cargo.toml, an issue
that won't be fixed until [1] is resolved, which doesn't seem
likely as it has been open for ~5 years now.
cargo2android needs dev-dependencies listed in Cargo.toml in order
to generate the rust_test in Android.bp, add an option that tells
cargo2android to use the cargo.toml.orig instead of the cargo.toml.
With this change there are now two options that temporarily
update Cargo.toml, so I've pulled these out into a separate class
to clean up the code a bit.
[1] https://github.com/rust-lang/cargo/issues/4242
Test: run against projects with --add_workspace and
--orig-cargo-toml
Change-Id: I3b8633a807c9734981ebde0bef9b73868acf6774
1 file changed