Skip to content

Commit

Permalink
Fix makefile (#4203)
Browse files Browse the repository at this point in the history
  • Loading branch information
topecongiro committed May 25, 2020
1 parent 15e7cab commit 6e40348
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
13 changes: 13 additions & 0 deletions .cargo/Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,22 @@
CFG_RELEASE = { value = "${CARGO_MAKE_RUST_VERSION}", condition = { env_not_set = ["CFG_RELEASE"] } }
CFG_RELEASE_CHANNEL = { value = "${CARGO_MAKE_RUST_CHANNEL}", condition = { env_not_set = ["CFG_RELEASE_CHANNEL"] } }

[tasks.build-bin]
workspace = false
command = "cargo"
args = [
"build",
"--bin",
"rustfmt",
"--all-features",
]

[tasks.b]
alias = "build"

[tasks.bb]
alias = "build-bin"

[tasks.c]
alias = "check"

Expand Down
10 changes: 0 additions & 10 deletions Makefile.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
extend = ".cargo/Makefile.toml"

[tasks.build]
clear = true
command = "cargo"
args = [
"build",
"--manifest-path",
"rustfmt-core/Cargo.toml",
"--workspace",
]

[tasks.install]
command = "cargo"
args = [
Expand Down
3 changes: 1 addition & 2 deletions rustfmt-core/rustfmt-lib/config_proc_macro/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rustfmt-config_proc_macro"
version = "0.5.0"
version = "0.5.1"
authors = ["topecongiro <seuchida@gmail.com>"]
edition = "2018"
description = "A collection of procedural macros for rustfmt"
Expand All @@ -21,4 +21,3 @@ serde = { version = "1.0", features = ["derive"] }

[features]
default = []
debug-with-rustfmt = []
3 changes: 1 addition & 2 deletions rustfmt-core/rustfmt-lib/config_proc_macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ pub fn config_type(_args: TokenStream, input: TokenStream) -> TokenStream {
let input = parse_macro_input!(input as syn::Item);
let output = config_type::define_config_type(&input);

#[cfg(feature = "debug-with-rustfmt")]
{
if std::env::var("RUSTFMT_DEV_DEBUG_PROC_MACRO").is_ok() {
utils::debug_with_rustfmt(&output);
}

Expand Down
3 changes: 1 addition & 2 deletions rustfmt-core/rustfmt-lib/config_proc_macro/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ pub fn is_unit(v: &syn::Variant) -> bool {
}
}

#[cfg(feature = "debug-with-rustfmt")]
/// Pretty-print the output of proc macro using rustfmt.
pub fn debug_with_rustfmt(input: &TokenStream) {
pub(crate) fn debug_with_rustfmt(input: &TokenStream) {
use std::io::Write;
use std::process::{Command, Stdio};

Expand Down

0 comments on commit 6e40348

Please sign in to comment.