Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
5d26731
Fix URIs
cmichi Nov 2, 2020
806929f
Make `generate-metadata` output consistent with `build`
cmichi Nov 2, 2020
7161a6d
Add `cargo contract pack`
cmichi Nov 2, 2020
5e3f520
Return error instead of panicking
cmichi Nov 3, 2020
e7fbaba
Use blake2_hash()
cmichi Nov 3, 2020
61f7261
Replace match with if
cmichi Nov 3, 2020
6cc0a67
Pass reference instead of ownership
cmichi Nov 3, 2020
d9eb49e
Generate metadata.json and <contract>.pack
cmichi Nov 3, 2020
4d1edfa
Output .wasm, .json, .pack
cmichi Nov 3, 2020
0eb1949
Return result object instead of tuple
cmichi Nov 3, 2020
3b3206e
Get it to run with '--features test-ci-only'
cmichi Nov 3, 2020
f5450d6
Rename .pack to .contract
cmichi Nov 4, 2020
c71639f
Apply suggestions from code review
Nov 4, 2020
2aa7c96
Introduce '--skip-packing' and '--skip-metadata'
cmichi Nov 4, 2020
9fc63a0
Merge branch 'master' into cmichi-implement-cargo-pack
cmichi Nov 5, 2020
b40a82e
Apply suggestions from code review
Nov 5, 2020
bd6477f
Short help message
cmichi Nov 5, 2020
294d206
Output deprecated error for 'generate-metadata'
cmichi Nov 5, 2020
bb6f5e5
Rename pack ➜ bundle
cmichi Nov 5, 2020
8b7f712
Add 'cargo contract check' command
cmichi Nov 5, 2020
e89b6df
Optimize resulting Wasm file, except on 'check'
cmichi Nov 5, 2020
0850779
Do not make unoptimized file easily mistake for optimized one
cmichi Nov 5, 2020
4dc41b7
Get it to run with
cmichi Nov 5, 2020
85efad8
Update readme
cmichi Nov 5, 2020
44d3a85
Make unoptimized wasm not show up in target folder
cmichi Nov 5, 2020
63a7131
Update comments
cmichi Nov 5, 2020
54a7105
Remove 'generate-metadata' variants
cmichi Nov 5, 2020
73d8e94
Move dispatch logic into metadata
cmichi Nov 6, 2020
134c07a
Update src/main.rs
Nov 6, 2020
1e7dabb
Move logic into build.rs
cmichi Nov 6, 2020
c7e2ffe
Improve progress output
cmichi Nov 6, 2020
8229246
Make clippy happy
cmichi Nov 6, 2020
3500946
Fix progress output
cmichi Nov 6, 2020
d2290c4
Make it work with `--features test-ci-only`
cmichi Nov 6, 2020
f8246d3
Apply cargo fmt
cmichi Nov 6, 2020
939a19b
Always use optimized Wasm for metadata hash
cmichi Nov 6, 2020
007bb65
Always use optimized Wasm for metadata hash
cmichi Nov 6, 2020
c99bd37
Make it work with `--features test-ci-only`
cmichi Nov 6, 2020
c74e3aa
Switch naming
cmichi Nov 6, 2020
bc965c7
Fix metadata/bundle output
cmichi Nov 6, 2020
da0c4ef
Use enum `BuildArtifacts` instead of boolean flags
cmichi Nov 6, 2020
c521d61
Improve misleading fn name
cmichi Nov 6, 2020
8b2b3d2
Make it work with `--features test-ci-only`
cmichi Nov 6, 2020
d08a6f1
Make output more concise
cmichi Nov 9, 2020
9ed109b
Print optimization result at the end
cmichi Nov 9, 2020
693f987
Improve output
cmichi Nov 9, 2020
160b992
Replace 5-tuple return value with struct
cmichi Nov 9, 2020
c699312
Include hash only for bundle in metadata
cmichi Nov 9, 2020
923cded
Make it work with `--features test-ci-only`
cmichi Nov 9, 2020
fcb66c6
Fix doc test
cmichi Nov 9, 2020
c5296ad
Remove comments
cmichi Nov 9, 2020
4cdc220
Introduce wrapper type CodeHash
cmichi Nov 9, 2020
930a309
Make it work with `--features test-ci-only`
cmichi Nov 9, 2020
4403bd7
Display important results bold
cmichi Nov 9, 2020
0c596f0
Include size diff for `code-only` as well
cmichi Nov 9, 2020
d9a0f10
Remove comment
cmichi Nov 9, 2020
8737b9b
Shorten code
cmichi Nov 9, 2020
234b45f
Clone metadata for correct UI output
cmichi Nov 9, 2020
8474209
Remove unnecessary return
cmichi Nov 9, 2020
b6b9cad
Fix return type
cmichi Nov 9, 2020
1c067d9
Print metadata generation in correct step
cmichi Nov 10, 2020
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
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
  • Loading branch information
Michael Müller and athei authored Nov 5, 2020
commit b40a82e787f6716bcc5ad4e1a3d3021ae98b1758
22 changes: 11 additions & 11 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,17 +162,17 @@ enum Command {
#[structopt(short, long, parse(from_os_str))]
target_dir: Option<PathBuf>,
},
/// Compiles the contract, generates metadata, packs both together in one <package-name>.contract file
/// Compiles the contract, generates metadata, bundles both together in one <package-name>.contract file
#[structopt(name = "build")]
Build {
/// Path to the Cargo.toml of the contract to build
#[structopt(long, parse(from_os_str))]
manifest_path: Option<PathBuf>,
/// Only the Wasm and the metadata are generated, no packed .contract file is created
#[structopt(long = "skip-packing", conflicts_with = "skip-metadata")]
skip_packing: bool,
/// Only the Wasm and the metadata are generated, no bundled .contract file is created
#[structopt(long = "skip-bundle", conflicts_with = "skip-metadata")]
skip_bundle: bool,
/// Only the Wasm is created, generation of metadata and a packed .contract file is skipped
#[structopt(long = "skip-metadata", conflicts_with = "skip-packing")]
#[structopt(long = "skip-metadata", conflicts_with = "skip-bundle")]
skip_metadata: bool,
#[structopt(flatten)]
verbosity: VerbosityFlags,
Expand Down Expand Up @@ -244,7 +244,7 @@ fn exec(cmd: Command) -> Result<String> {
Command::Build {
manifest_path,
verbosity,
skip_packing,
skip_bundle,
skip_metadata,
unstable_options,
} => {
Expand All @@ -256,7 +256,7 @@ fn exec(cmd: Command) -> Result<String> {
unstable_options.try_into()?,
)?;
return Ok(format!(
"\nYour contract is ready. You can find it here:\n{}",
"\nYour contract's code is ready. You can find it here:\n{}",
dest_wasm.display().to_string().bold()
));
}
Expand All @@ -267,15 +267,15 @@ fn exec(cmd: Command) -> Result<String> {
false,
unstable_options.try_into()?,
)?;
if *(skip_packing) {
if *(skip_bundle) {
return Ok(format!(
"\nYour contract's code is ready. You can find it here:\n{}
\nYour contract's metadata is ready. You can find it here:\n{}",
metadata_result.wasm_file.display().to_string().bold(),
metadata_result.metadata_file.display().to_string().bold(),
));
}
let pack_result = cmd::metadata::execute(
let bundle_result = cmd::metadata::execute(
&manifest_path,
verbosity.try_into()?,
true,
Expand All @@ -285,9 +285,9 @@ fn exec(cmd: Command) -> Result<String> {
"\nYour contract's code is ready. You can find it here:\n{}
\nYour contract's metadata is ready. You can find it here:\n{}
\nYour contract bundle (code + metadata) is ready. You can find it here:\n{}",
pack_result.wasm_file.display().to_string().bold(),
bundle_result.wasm_file.display().to_string().bold(),
metadata_result.metadata_file.display().to_string().bold(),
pack_result.metadata_file.display().to_string().bold()
bundle_result.metadata_file.display().to_string().bold()
))
}
Command::Test {} => Err(anyhow::anyhow!("Command unimplemented")),
Expand Down