Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(init): don't add two dev_dependencies sections #1296

Merged
merged 1 commit into from
Apr 30, 2024

Commits on Apr 30, 2024

  1. fix(init): don't add two dev_dependencies

    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.
    chadoh committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    1fe20e6 View commit details
    Browse the repository at this point in the history