-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(init): don't add two
dev_dependencies
(#1296)
When initializing a new project with `soroban contract init`, we need to clean up the `Cargo.toml` of example projects a little. We need to make sure `soroban-sdk` is always inherited from the workspace, and we need to make sure there's no `profile` section. We had a couple issues with the old logic. 1. It was adding a `dev_dependencies` section, with an underscore, which is deprecated. If the Cargo.toml already had a `dev-dependencies` section, it would add a second `dev_dependencies`, which cargo would complain about. 2. The new setting would only set `{ workspace = true }`, even if the old one included other details like `features = ['testutils']`. This adds a new crate, `cargo_toml`, which allows us to parse and manipulate Cargo.toml files in a more sophisticated way, which allows us to make sure we get the `dev-dependencies` section even if it's called `dev_dependencies`. It also makes it straightforward to add the correct inherited dependency.
- Loading branch information
Showing
3 changed files
with
105 additions
and
33 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters