Unify pwasm-utils and pwasm-utils-cli packet

This commit is contained in:
Alexander Theißen
2020-10-21 20:24:49 +02:00
parent af761da031
commit f05f43b883
17 changed files with 72 additions and 93 deletions
-51
View File
@@ -1,51 +0,0 @@
[package]
name = "pwasm-utils-cli"
version = "0.15.0"
authors = ["Nikolay Volf <nikvolf@gmail.com>", "Sergey Pepyakin <s.pepyakin@gmail.com>"]
license = "MIT/Apache-2.0"
readme = "README.md"
description = "Collection of command-line utilities and corresponding Rust api for producing pwasm-compatible executables"
keywords = ["wasm", "webassembly", "pwasm"]
repository = "https://github.com/paritytech/wasm-utils"
[lib]
[[bin]]
name = "wasm-prune"
path = "prune/main.rs"
[[bin]]
name = "wasm-ext"
path = "ext/main.rs"
[[bin]]
name = "wasm-gas"
path = "gas/main.rs"
[[bin]]
name = "wasm-build"
path = "build/main.rs"
[[bin]]
name = "wasm-stack-height"
path = "stack_height/main.rs"
[[bin]]
name = "wasm-pack"
path = "pack/main.rs"
[[bin]]
name = "wasm-check"
path = "check/main.rs"
[dependencies]
parity-wasm = "0.41.0"
pwasm-utils = { path = "..", version = "0.15" }
glob = "0.2"
clap = "2.24"
log = "0.4"
env_logger = "0.5"
lazy_static = "1.0"
[dev-dependencies]
tempdir = "0.3"
-11
View File
@@ -1,11 +0,0 @@
# pwasm-utils-cli
Collection of WASM utilities used in Parity and WASM contract devepment
## Install
Easiest way to use is to install via `cargo install`:
```
cargo install pwasm-utils-cli
```
+2 -2
View File
@@ -5,7 +5,7 @@ extern crate clap;
extern crate glob;
extern crate pwasm_utils as utils;
extern crate parity_wasm;
extern crate pwasm_utils_cli as logger;
use pwasm_utils::logger;
mod source;
@@ -67,7 +67,7 @@ pub fn process_output(input: &source::SourceInput) -> Result<(), Error> {
}
fn do_main() -> Result<(), Error> {
logger::init_log();
logger::init();
let matches = App::new("wasm-build")
.version(crate_version!())
+2 -2
View File
@@ -1,6 +1,6 @@
extern crate parity_wasm;
extern crate pwasm_utils as utils;
extern crate pwasm_utils_cli as logger;
use pwasm_utils::logger;
extern crate clap;
use clap::{App, Arg};
@@ -40,7 +40,7 @@ const ALLOWED_IMPORTS: &[&str] = &[
];
fn main() {
logger::init_log();
logger::init();
let matches = App::new("wasm-check")
.arg(Arg::with_name("input")
+2 -2
View File
@@ -1,12 +1,12 @@
extern crate parity_wasm;
extern crate pwasm_utils as utils;
extern crate pwasm_utils_cli as logger;
use pwasm_utils::logger;
use std::env;
fn main() {
logger::init_log();
logger::init();
let args = env::args().collect::<Vec<_>>();
if args.len() != 3 {
+2 -2
View File
@@ -1,11 +1,11 @@
extern crate parity_wasm;
extern crate pwasm_utils as utils;
extern crate pwasm_utils_cli as logger;
use pwasm_utils::logger;
use std::env;
fn main() {
logger::init_log();
logger::init();
let args = env::args().collect::<Vec<_>>();
if args.len() != 3 {
+2 -2
View File
@@ -1,12 +1,12 @@
extern crate parity_wasm;
extern crate pwasm_utils as utils;
extern crate pwasm_utils_cli as logger;
use pwasm_utils::logger;
extern crate clap;
use clap::{App, Arg};
fn main() {
logger::init_log();
logger::init();
let target_runtime = utils::TargetRuntime::pwasm();
+2 -2
View File
@@ -1,12 +1,12 @@
extern crate parity_wasm;
extern crate pwasm_utils as utils;
extern crate pwasm_utils_cli as logger;
use pwasm_utils::logger;
extern crate clap;
use clap::{App, Arg};
fn main() {
logger::init_log();
logger::init();
let target_runtime = utils::TargetRuntime::pwasm();
-27
View File
@@ -1,27 +0,0 @@
#[macro_use] extern crate log;
#[macro_use] extern crate lazy_static;
extern crate env_logger;
use std::env;
use log::LevelFilter;
use env_logger::Builder;
lazy_static! {
static ref LOG_DUMMY: bool = {
let mut builder = Builder::new();
builder.filter(None, LevelFilter::Info);
if let Ok(log) = env::var("RUST_LOG") {
builder.parse(&log);
}
builder.init();
trace!("logger initialized");
true
};
}
/// Intialize log with default settings
pub fn init_log() {
let _ = *LOG_DUMMY;
}
+2 -2
View File
@@ -1,12 +1,12 @@
extern crate pwasm_utils as utils;
extern crate parity_wasm;
extern crate pwasm_utils_cli as logger;
use pwasm_utils::logger;
use std::env;
use utils::stack_height;
fn main() {
logger::init_log();
logger::init();
let args = env::args().collect::<Vec<_>>();
if args.len() != 3 {