Include sub-projects with `cargo package`

I have a crate that is used to generate project templates. It contains a few project directories that are included in the binary using include_dir!() and that contain Cargo.toml files. When I try to package the crate (for pushing to a private registry) the project directories aren't included. According to the Cargo manifest documentation this is expected, and it appears to be a hard-coded behavior, and doesn't seem to be overridable using include.

Have I understood that properly? There's no way to package subdirectories containing Cargo.toml files?

I could obviously rename them in the repo and have the template writer rename the files. However, currently I can just go to the project template directories and work on them, which is very convenient.

This seems to be the case. The logic for skipping subdirectories is in this module and I don’t see any way to configure or disable it.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.