rust-mobile / cargo-subcommand

Library for implementing cargo subcommands
6 stars 6 forks source link

Library name can be different from the package name #27

Closed quomat closed 1 year ago

quomat commented 1 year ago

Hello, first of all, thanks everyone for bringing the Rust ecosystem to mobile. I loved that the cargo-apk could make an apk file faster than Visual Studio or even Android Studio, makes cargo into an awesome open-source IDE.

I ran into a simple issue with cargo-apk, but traced it down here. If I name my library differently than the package name, build fails, because it looks for the wrong filename - lib{library name}.so but it looks for lib{package name}.so.

The line where the package name gets confused with the library name is at here.

Should the library name be parsed from the Cargo.toml file directly? The Manifest type doesn't feel like it belongs in this crate, but instead it should depend on cargo_metadata crate. It's confusing for me why that isn't the case.

quomat commented 1 year ago

I only now noticed there is #17 for this, sorry. But my question about using cargo_metadata for parsing Cargo.toml still holds, as it was not mentioned in the pull request thread.