Skip to content

Commit

Permalink
feat: use virtual workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkgos committed Dec 13, 2023
1 parent de838ce commit 774ae55
Show file tree
Hide file tree
Showing 19 changed files with 117 additions and 109 deletions.
44 changes: 22 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 17 additions & 34 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
[package]
name = "goup-rs"
[workspace]
resolver = "2"
members = [
"goup",
"goup-consts",
"goup-version",
"goup-downloader"
]
default-members = ["goup"]

[workspace.package]
version = "0.2.5"
authors = ["thinkgo <[email protected]>"]
edition = "2021"
rust-version = "1.70.0"
build = "build.rs"
description = "goup is an elegant Go version manager"
keywords = [
"goup",
Expand All @@ -17,42 +25,17 @@ license = "Apache-2.0"
readme = "README.md"
homepage = "https://github.com/thinkgos/goup-rs"
repository = "https://github.com/thinkgos/goup-rs"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[[bin]]
name = "goup"
path = "src/main.rs"

[build-dependencies]
version_check = "0.9"
shadow-rs = "0.25"

[dependencies]
goup-consts = {path = "./goup-consts", version = "0.2.5"}
goup-version = {path = "./goup-version", version = "0.2.5"}
goup-downloader = {path = "./goup-downloader", version = "0.2.5"}

clap = {version = "4.4", features = ["derive", "env"]}
clap_complete = "4.4"
anyhow = "1.0"
which = "5.0"
prettytable-rs = "0.10"
dialoguer = "0.11"
self_update = {version = "0.39", default-features = false, features = ["rustls", "compression-flate2", "compression-zip-deflate"]}
shadow-rs = "0.25"
[workspace.lints.rust]
unsafe_code = "forbid"
# unused = "allow" # for experimental dev

[profile.dev.package."*"]
opt-level = 3
opt-level = "z"

[profile.release]
lto = true
opt-level = "z"
strip = true
lto = true
codegen-units = 1

[workspace]
resolver = "2"
members = [
"goup-consts",
"goup-version",
"goup-downloader"
]
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ There are a bunch of solutions to install Go or manage Go versions outside of a
cargo install goup --git https://github.com/thinkgos/goup-rs
```

or

```shell
cargo install goup-rs
```

### Manual

If you want to install manually, there are the steps:
Expand Down
26 changes: 10 additions & 16 deletions goup-consts/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
[package]
name = "goup-consts"
version = "0.2.5"
authors = ["thinkgo <[email protected]>"]
edition = "2021"
rust-version = "1.70.0"
description = "goup-consts goup consts"
keywords = [
"goup",
"goup",
"golang",
"version-manager",
"tool",
]
license = "Apache-2.0"
readme = "../README.md"
homepage = "https://github.com/thinkgos/goup-rs"
repository = "https://github.com/thinkgos/goup-rs"
version.workspace =true
authors.workspace =true
edition.workspace =true
rust-version.workspace =true
description.workspace =true
keywords.workspace =true
license.workspace =true
readme.workspace =true
homepage.workspace =true
repository.workspace =true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
30 changes: 12 additions & 18 deletions goup-downloader/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
[package]
name = "goup-downloader"
version = "0.2.5"
authors = ["thinkgo <[email protected]>"]
edition = "2021"
rust-version = "1.70.0"
description = "goup-downloader goup downloader"
keywords = [
"goup",
"goup",
"golang",
"version-manager",
"tool",
]
license = "Apache-2.0"
readme = "../README.md"
homepage = "https://github.com/thinkgos/goup-rs"
repository = "https://github.com/thinkgos/goup-rs"
version.workspace =true
authors.workspace =true
edition.workspace =true
rust-version.workspace =true
description.workspace =true
keywords.workspace =true
license.workspace =true
readme.workspace =true
homepage.workspace =true
repository.workspace =true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
goup-consts = {path = "../goup-consts", version = "0.2.5"}
goup-version = {path = "../goup-version", version = "0.2.5"}
goup-consts = {path = "../goup-consts"}
goup-version = {path = "../goup-version"}
anyhow = "1.0"
dirs = "5.0"
regex = "1.10"
Expand Down
28 changes: 11 additions & 17 deletions goup-version/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
[package]
name = "goup-version"
version = "0.2.5"
authors = ["thinkgo <[email protected]>"]
edition = "2021"
rust-version = "1.70.0"
description = "goup-version goup version"
keywords = [
"goup",
"goup",
"golang",
"version-manager",
"tool",
]
license = "Apache-2.0"
readme = "../README.md"
homepage = "https://github.com/thinkgos/goup-rs"
repository = "https://github.com/thinkgos/goup-rs"
version.workspace =true
authors.workspace =true
edition.workspace =true
rust-version.workspace =true
description.workspace =true
keywords.workspace =true
license.workspace =true
readme.workspace =true
homepage.workspace =true
repository.workspace =true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
goup-consts = {path = "../goup-consts", version = "0.2.5"}
goup-consts = {path = "../goup-consts"}
anyhow = "1.0"
dirs = "5.0"
regex = "1.10"
Expand Down
37 changes: 37 additions & 0 deletions goup/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[package]
name = "goup-rs"
version.workspace =true
authors.workspace =true
edition.workspace =true
rust-version.workspace =true
description.workspace =true
keywords.workspace =true
license.workspace =true
readme.workspace =true
homepage.workspace =true
repository.workspace =true

build = "build.rs"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[[bin]]
name = "goup"
path = "src/main.rs"

[build-dependencies]
version_check = "0.9"
shadow-rs = "0.25"

[dependencies]
goup-consts = {path = "../goup-consts"}
goup-version = {path = "../goup-version"}
goup-downloader = {path = "../goup-downloader"}

clap = {version = "4.4", features = ["derive", "env"]}
clap_complete = "4.4"
anyhow = "1.0"
which = "5.0"
prettytable-rs = "0.10"
dialoguer = "0.11"
self_update = {version = "0.39", default-features = false, features = ["rustls", "compression-flate2", "compression-zip-deflate"]}
shadow-rs = "0.25"
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/command/init.rs → goup/src/command/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use goup_version::Version;

use super::Run;

const SETUP_ENV_UNIX: &str = include_str!("../../setup_env_unix");
const SETUP_ENV_UNIX: &str = include_str!("../../../setup_env_unix");

#[derive(Args, Debug, PartialEq)]
pub struct Init;
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/command/mod.rs → goup/src/command/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use self::upgrade::Upgrade;
shadow!(build);
const VERSION: &str = shadow_rs::formatcp!(
r#"{}
author: {}
author: {}
git_commit: {}
git_full_commit: {}
build_time: {}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 774ae55

Please sign in to comment.