piot / cargo-set-version

MIT License
0 stars 0 forks source link

Support for workspace versions #1

Open leighmcculloch opened 1 week ago

leighmcculloch commented 1 week ago

Versions can be defined in a virtual workspace, by specifying version.workspace = true, and those shouldn't be overriden.

Currently the tool is overwriting the version.workspace = true and replacing it with version = <new version>.

For an example, check out this repo and run the command:

$ git clone https://github.com/stellar/rs-soroban-sdk
$ cd rs-soroban-sdk
$ cargo set-version 22.0.0-rc.3
$ git diff
--- a/soroban-ledger-snapshot/Cargo.toml
+++ b/soroban-ledger-snapshot/Cargo.toml
@@ -6,7 +6,7 @@ repository = "https://github.com/stellar/rs-soroban-sdk"
 authors = ["Stellar Development Foundation <info@stellar.org>"]
 readme = "../README.md"
 license = "Apache-2.0"
-version.workspace = true
+version = "22.0.0-rc.3"
 edition = "2021"
 rust-version.workspace = true
leighmcculloch commented 1 week ago

It also appears to not update the version in a workspace.version or workspace.dependencies|dev-dependencies|build-dependencies either. That would be needed to support workspaces.

piot commented 1 week ago

Thanks for catching these issues! I will see if I can figure out a way to fix them!