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

Move rustfmt binariy crates to workspace #4002

Merged
merged 1 commit into from
Jan 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,29 @@ description = "Tool to find and fix Rust formatting issues"
repository = "https://github.com/rust-lang/rustfmt"
readme = "README.md"
license = "Apache-2.0/MIT"
build = "build.rs"
build = "rustfmt-core/rustfmt-bin/build.rs"
categories = ["development-tools"]
edition = "2018"

[[bin]]
name = "rustfmt"
path = "src/bin/main.rs"
path = "rustfmt-core/rustfmt-bin/src/bin/main.rs"
test = false
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disabled all the tests in the root package as they will be tested in rustfmt-core.


[[bin]]
name = "cargo-fmt"
path = "src/cargo-fmt/main.rs"
path = "rustfmt-core/rustfmt-bin/src/cargo-fmt/main.rs"
test = false

[[bin]]
name = "rustfmt-format-diff"
path = "src/format-diff/main.rs"
path = "rustfmt-core/rustfmt-bin/src/format-diff/main.rs"
test = false

[[bin]]
name = "git-rustfmt"
path = "src/git-rustfmt/main.rs"
path = "rustfmt-core/rustfmt-bin/src/git-rustfmt/main.rs"
test = false

[features]
default = ["cargo-fmt", "rustfmt-format-diff"]
Expand Down
1 change: 1 addition & 0 deletions rustfmt-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[workspace]
members = [
"rustfmt-bin",
"rustfmt-config",
"rustfmt-emitter",
"rustfmt-lib",
Expand Down
47 changes: 47 additions & 0 deletions rustfmt-core/rustfmt-bin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[package]

# The metadata of this crate is intentionally removed to avoid publishing this crate by accident.
name = "rustfmt-bin"
version = "2.0.0-rc.1"
edition = "2018"

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

[[bin]]
name = "cargo-fmt"
path = "src/cargo-fmt/main.rs"

[[bin]]
name = "rustfmt-format-diff"
path = "src/format-diff/main.rs"

[[bin]]
name = "git-rustfmt"
path = "src/git-rustfmt/main.rs"

[features]
default = ["cargo-fmt", "rustfmt-format-diff"]
cargo-fmt = []
rustfmt-format-diff = []
generic-simd = ["rustfmt_lib/generic-simd"]

[dependencies]
ansi_term = "0.12"
anyhow = "1.0"
cargo_metadata = "0.9"
env_logger = "0.7"
getopts = "0.2"
log = "0.4"
regex = "1.0"
serde = "1.0"
serde_json = "1.0"
structopt = "0.3"
term = "0.6"
thiserror = "1.0"

rustfmt_lib = { path = "../rustfmt-lib", version = "1.0" }

[dev-dependencies]
lazy_static = "1.0"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ version = "0.1.0"
authors = ["rustfmt devs <[email protected]>"]

[dependencies]

[workspace]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that these files are under the workspace, we need to exclude them from the workspace.

cc rust-lang/cargo#6745

Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ version = "0.1.0"
authors = ["rustfmt devs <[email protected]>"]

[dependencies]

[workspace]
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ version = "0.1.0"
authors = ["rustfmt devs <[email protected]>"]

[dependencies]

[workspace]
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ authors = ["rustfmt devs <[email protected]>"]
edition = "2018"

[dependencies]

[workspace]
File renamed without changes.