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

Improve cargo workspace #330

Merged
merged 5 commits into from
Jun 18, 2024
Merged

Improve cargo workspace #330

merged 5 commits into from
Jun 18, 2024

Conversation

rkuklik
Copy link
Contributor

@rkuklik rkuklik commented Jun 18, 2024

I moved swww client to separate directory and renamed utils to more intuitive common

Copy link
Owner

@LGFae LGFae left a 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"
Copy link
Owner

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
Comment on lines 21 to 36
# 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

Copy link
Owner

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

@rkuklik
Copy link
Contributor Author

rkuklik commented Jun 18, 2024

Be right back

@LGFae
Copy link
Owner

LGFae commented Jun 18, 2024

Very nice.

@LGFae LGFae merged commit 1bb137b into LGFae:main Jun 18, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants