Skip to content

Commit

Permalink
default skip analysis (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
bxq2011hust authored Jan 6, 2023
1 parent 5caaea2 commit 0a2b55e
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 21 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
**/*.rs.bk

# Generated by VS Code
.vscode/
.vscode/
.DS_Store
8 changes: 4 additions & 4 deletions Cargo.lock

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

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2018"

[dependencies]
anyhow = "1.0.32"
structopt = "0.3.16"
structopt = "0.3.26"
heck = "0.3.1"
colored = "2.0.0"
zip = "0.5.6"
Expand Down Expand Up @@ -43,6 +43,6 @@ walkdir = "2.3.1"
name = "cargo-liquid"
path = "src/main/main.rs"

#[[bin]]
#name = "liquid-analy"
#path = "src/analyzer/main.rs"
# [[bin]]
# name = "liquid-analy"
# path = "src/analyzer/main.rs"
3 changes: 3 additions & 0 deletions src/main/cmd/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ fn run_xargo_build(
memcpy: false,
panic_immediate_abort: true,
};
if let VerbosityBehavior::Verbose = verbosity_behavior {
println!("manifest_path: {:#?}", manifest_path);
}
let exit_status = xargo_lib::build(args, "build", Some(config))
.map_err(|e| anyhow::anyhow!("{}", e))
.context("Building with xargo")?;
Expand Down
2 changes: 1 addition & 1 deletion src/main/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ enum VerbosityBehavior {
#[derive(StructOpt)]
struct AnalysisFlags {
/// If this flag is set, the analysis process will be skipped unconditionally.
#[structopt(long)]
#[structopt(long, parse(try_from_str), default_value = "true")]
skip_analysis: bool,
}

Expand Down
8 changes: 4 additions & 4 deletions src/main/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ use rustc_version::Channel;

pub fn get_cargo_metadata(manifest_path: &ManifestPath) -> Result<(CargoMetadata, PackageId)> {
let mut cmd = MetadataCommand::new();
let metadata = cmd
.manifest_path(manifest_path)
.exec()
.context("Error invoking `cargo metadata`")?;
let metadata = cmd.manifest_path(manifest_path).exec().context(format!(
"Error invoking `cargo metadata` on {:#?}",
manifest_path
))?;
let root_packaged_id = metadata
.resolve
.as_ref()
Expand Down
2 changes: 1 addition & 1 deletion template/contract/.liquid/abi_gen/_Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ features = ["liquid-abi-gen"]

[dependencies.liquid_lang]
git = "https://github.com/WeBankBlockchain/liquid"
tag = "v1.0.0-rc2"
rev = "c678d9586b4335fc302a4c02a564d8ee6964be1d"
package = "liquid_lang"
default-features = false
features = ["contract-abi-gen"]
Expand Down
10 changes: 5 additions & 5 deletions template/contract/_Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ edition = "2018"
[dependencies]
scale = { package = "parity-scale-codec", version = "1.3.1", default-features = false, features = ["derive", "full"] }

liquid_lang = { version = "1.0.0-rc2", git = "https://github.com/WeBankBlockchain/liquid", tag = "v1.0.0-rc2", package = "liquid_lang", default-features = false, features = ["contract"] }
liquid_primitives = { version = "1.0.0-rc2", git = "https://github.com/WeBankBlockchain/liquid", tag = "v1.0.0-rc2", package = "liquid_primitives", default-features = false }
liquid_prelude = { version = "1.0.0-rc2", git = "https://github.com/WeBankBlockchain/liquid", tag = "v1.0.0-rc2", package = "liquid_prelude", default-features = false }
liquid_macro = { version = "1.0.0-rc2", git = "https://github.com/WeBankBlockchain/liquid", tag = "v1.0.0-rc2", package = "liquid_macro", default-features = false }
liquid_abi_gen = { version = "1.0.0-rc2", git = "https://github.com/WeBankBlockchain/liquid", tag = "v1.0.0-rc2", package = "liquid_abi_gen", default-features = false, optional = true }
liquid_lang = { git = "https://github.com/WeBankBlockchain/liquid", rev = "c678d9586b4335fc302a4c02a564d8ee6964be1d", package = "liquid_lang", default-features = false, features = ["contract"] }
liquid_primitives = { git = "https://github.com/WeBankBlockchain/liquid", rev = "c678d9586b4335fc302a4c02a564d8ee6964be1d", package = "liquid_primitives", default-features = false }
liquid_prelude = { git = "https://github.com/WeBankBlockchain/liquid", rev = "c678d9586b4335fc302a4c02a564d8ee6964be1d", package = "liquid_prelude", default-features = false }
liquid_macro = { git = "https://github.com/WeBankBlockchain/liquid", rev = "c678d9586b4335fc302a4c02a564d8ee6964be1d", package = "liquid_macro", default-features = false }
liquid_abi_gen = { git = "https://github.com/WeBankBlockchain/liquid", rev = "c678d9586b4335fc302a4c02a564d8ee6964be1d", package = "liquid_abi_gen", default-features = false, optional = true }

[dev-dependencies]
predicates = "1.0.5"
Expand Down
2 changes: 1 addition & 1 deletion template/contract/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "nightly-2021-06-23"
channel = "nightly-2023-01-03"

0 comments on commit 0a2b55e

Please sign in to comment.