rust-mobile / android-activity

Glue for building Rust applications on Android with NativeActivity or GameActivity
238 stars 46 forks source link

Add `package.include` to `Cargo.toml` #165

Open daxpedda opened 1 month ago

daxpedda commented 1 month ago

See the Cargo documentation on package.include.

When using cargo publish every file is included and uploaded, even the shell files used to generate bindings not necessary during build time. Using package.include we can make sure that this doesn't happen and only what the user needs to compile the package or generate local documentation is included.

ardocrat commented 1 month ago

Good catch, but I guess you can setup this at your application, not at lib level?

daxpedda commented 1 month ago

Good catch, but I guess you can setup this at your application, not at lib level?

Not sure what you mean, this is about crates.io releases. Or do people use cargo publish for something else?

daxpedda commented 1 month ago

One more question: how is README.md from the root of this repo getting into the android-activity subfolder? I don't see a symlink of sorts but it's in the packaged crate: https://docs.rs/crate/android-activity/latest/source/README.md

Its getting it from the package.readme field, which correctly points to the README file. But its missing in the documentation that the README is included by default, so that's interesting.

MarijnS95 commented 1 month ago

Its getting it from the package.readme field, which correctly points to the README file.

Ah, I didn't see that there's a ../ in there which, typically, it's not allowed to go outside of the crate root. Guess cargo makes an exception for singular files with an explicit location.

But its missing in the documentation that the README is included by default, so that's interesting.

Yeah, that's correct.