-
Notifications
You must be signed in to change notification settings - Fork 74
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
Improve cargo workspace #330
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just two small things.
Cargo.toml
Outdated
@@ -1,14 +1,30 @@ | |||
[workspace] | |||
members = [".", "daemon", "utils"] | |||
default-members = [".", "daemon"] | |||
resolver = "2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unnecessary, since the 2021 edition already uses resolver 2.
version.sh
Outdated
# Cargo.toml: | ||
sed \ | ||
-e "s/^version = .*/version = \"$1\"/" \ | ||
-e "s/^utils.*/utils = { version = \"$1\", path = \"utils\" }/" \ | ||
-e "s/^common.*/common = { version = \"$1\", path = \"common\" }/" \ | ||
Cargo.toml > TMP | ||
mv -v TMP Cargo.toml | ||
|
||
sed "s/^version = .*/version = \"$1\"/" utils/Cargo.toml > TMP | ||
mv -v TMP utils/Cargo.toml | ||
sed "s/^version = .*/version = \"$1\"/" common/Cargo.toml > TMP | ||
mv -v TMP common/Cargo.toml | ||
|
||
sed \ | ||
-e "s/^version = .*/version = \"$1\"/" \ | ||
-e "s/^utils.*/utils = { version = \"$1\", path = \"..\/utils\" }/" \ | ||
-e "s/^common.*/common = { version = \"$1\", path = \"..\/common\" }/" \ | ||
daemon/Cargo.toml > TMP | ||
mv -v TMP daemon/Cargo.toml | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These were updating the versions in every crate. Since now there is only one global one, you just need
sed -e "s/^version = .*/version = \"$1\"/" Cargo.toml > TMP
mv -v TMP Cargo.toml
Be right back |
Very nice. |
I moved swww client to separate directory and renamed utils to more intuitive common