diff --git a/Cargo.toml b/Cargo.toml index e8911979b9da67c7a0961d6ae7c9ea08824d7028..52a82c7000752e36cf36d3b759dd6bd898ed5b10 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/build.rs b/build.rs index 513df6cca96419087a907611a31e7dc73284bd9a..f7085a3bcda5b1a37307283fa93530d81aea8aaa 100644 --- a/build.rs +++ b/build.rs @@ -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");