Only include files when packaging bevy
, rather than excluding
#18571
+11
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Objective
Reduce the size of
.crate
files generated bycargo package
orcargo publish
for thebevy
package.Solution
Change what files are included in a
.crate
file, by only including necessary folders and files, rather than excluding a few specific folders and keeping the rest.As a result of this change, several files and folders are no longer included in the generated
.crate
files:.cargo/
- Only containsconfig_fast_builds.toml
, which does nothing unless renamed toconfig.toml
docs-template/
- Only used for generating documentationworking-migration-guides/
,working-release-notes/
- These are only relevant for building up documentation that will be released alongside0.16
proper..gitattributes
,.gitignore
- Only used for the repo, and have no effect on how Cargo handles the packageclippy.toml
,deny.toml
,rustfmt.toml
,typos.toml
- Only relevant when developing BevyCODE_OF_CONDUCT.md
,CONTRIBUTING.md
,CREDITS.md
- Only relevant in their latest form as contained on the repo (so there's not much point to packaging these up, since they can quickly become outdated)Testing
This change was tested following these steps:
cargo package
at the root of the repo.crate
file so it isn't overwritten later/Cargo.toml
cargo package
at the root of the repo.crate
file sizesI performed my testing on Windows 10 22H2, with Rust 1.85.1, using commit 0d90da8. Only one change was made from this commit that was unrelated to testing: The removal of an instance of
"bevy_internal/bevy_anti_aliasing"
from/Cargo.toml
. This was done because Cargo would complain about the use of a non-existent feature otherwise - I do not believe it affects the results in any major way.