Skip to content

Commit

Permalink
Fix issues with publishing (#462)
Browse files Browse the repository at this point in the history
* Include `.scale` files

At the moment it's only `src/cmd/extrinsics/runtime_api/contracts_runtime.scale`.

* Fix `cargo publish`

* Add CI stage for `cargo package`

* Remove unused import

* Revert "Add CI stage for `cargo package`"

This reverts commit f1f5cb2.
  • Loading branch information
cmichi authored Mar 14, 2022
1 parent 2d43c18 commit eec7c00
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ homepage = "https://www.parity.io/"
description = "Setup and deployment tool for developing Wasm based smart contracts via ink!"
keywords = ["wasm", "parity", "webassembly", "blockchain", "edsl"]
categories = ["command-line-utilities", "development-tools::build-utils", "development-tools::cargo-plugins"]
include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE", "build.rs", "templates"]
include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE", "build.rs", "templates", "src/**/*.scale"]

[dependencies]
env_logger = "0.9.0"
Expand Down
19 changes: 18 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,24 @@ fn build_and_zip_dylint_driver(
out_dir: PathBuf,
dylint_driver_dst_file: PathBuf,
) -> Result<()> {
let ink_dylint_driver_dir = manifest_dir.join("ink_linting");
let mut ink_dylint_driver_dir = manifest_dir.join("ink_linting");

// The following condition acocunts for the case when `cargo package` or
// `cargo publish` is used. In that case the `CARGO_MANIFEST_DIR` is actually
// of the form `cargo-contract/target/package/cargo-contract-0.18.0/`.
// But since the `ink_linting/` folder is not part of the `cargo-contract`
// project it would not be found in this `CARGO_MANIFEST_DIR`.
if !ink_dylint_driver_dir.exists() {
println!(
"Folder `ink_linting` not found at {:?}",
ink_dylint_driver_dir
);
ink_dylint_driver_dir = manifest_dir.join("../../../ink_linting/");
println!(
"Added a relative path to reference the `ink_linting` folder at: {:?}",
ink_dylint_driver_dir
);
}

let mut cmd = Command::new("cargo");

Expand Down

0 comments on commit eec7c00

Please sign in to comment.