Skip to content

Commit

Permalink
Move rustfmt binariy crates to workspace (#4002)
Browse files Browse the repository at this point in the history
  • Loading branch information
topecongiro authored Jan 7, 2020
1 parent b76fff3 commit e8da49a
Show file tree
Hide file tree
Showing 29 changed files with 65 additions and 5 deletions.
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

[[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.
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 <awesome@gmail.com>"]

[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 <awesome@gmail.com>"]

[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 <awesome@gmail.com>"]

[dependencies]

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

[dependencies]

[workspace]
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit e8da49a

Please sign in to comment.