Skip to content

Commit

Permalink
build(deps): feature config for ci checks
Browse files Browse the repository at this point in the history
  • Loading branch information
evilrobot-01 committed Mar 12, 2024
1 parent 150beb8 commit 4890736
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 8 deletions.
11 changes: 6 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@ strum = "0.26"
strum_macros = "0.26"
tempfile = "3.8"
tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] }
url = { version = "2.5", optional = true }
walkdir = "2.4"

# contracts
contract-build = { version = "4.0.0-rc.3", optional = true }
contract-extrinsics = { version = "4.0.0-rc.3", optional = true }
sp-core = { version = "30.0.0", optional = true }
subxt-signer = { version = "0.34.0", features = ["subxt", "sr25519"], optional = true }
subxt = { version = "0.34.0", optional = true }
ink_env = { version = "5.0.0-rc.2", optional = true }
sp-weights = { version ="29.0.0", optional = true }
subxt-signer = { version = "0.34.0", features = ["subxt", "sr25519"], optional = true }
subxt = { version = "0.34.0", optional = true }
ink_env = { version = "5.0.0-rc.2", optional = true }
sp-weights = { version = "29.0.0", optional = true }
ansi_term = "0.12.1"

# parachains
Expand All @@ -46,7 +47,6 @@ serde = { version = "1.0", features = ["derive"], optional = true }
symlink = { version = "0.1", optional = true }
toml_edit = { version = "0.22", optional = true }
tracing-subscriber = { version = "0.3", optional = true }
url = { version = "2.5", optional = true }
zombienet-sdk = { git = "https://github.com/r0gue-io/zombienet-sdk", branch = "pop", optional = true }
zombienet-support = { git = "https://github.com/r0gue-io/zombienet-sdk", branch = "pop", optional = true }

Expand All @@ -60,6 +60,7 @@ contract = [
"dep:subxt",
"dep:ink_env",
"dep:sp-weights",
"dep:url",
]
parachain = [
"dep:dirs",
Expand Down
2 changes: 2 additions & 0 deletions src/commands/build/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use clap::{Args, Subcommand};

#[cfg(feature = "contract")]
pub(crate) mod contract;
#[cfg(feature = "parachain")]
pub(crate) mod parachain;

#[derive(Args)]
Expand Down
1 change: 1 addition & 0 deletions src/commands/call/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use clap::{Args, Subcommand};

#[cfg(feature = "contract")]
pub(crate) mod contract;

#[derive(Args)]
Expand Down
1 change: 1 addition & 0 deletions src/commands/test/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use clap::{Args, Subcommand};

#[cfg(feature = "contract")]
pub mod contract;

#[derive(Args)]
Expand Down
3 changes: 3 additions & 0 deletions src/engines/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#[cfg(feature = "contract")]
pub mod contract_engine;
pub mod generator;
#[cfg(feature = "parachain")]
pub mod pallet_engine;
#[cfg(feature = "parachain")]
pub mod parachain_engine;
1 change: 1 addition & 0 deletions src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ pub(crate) fn clone_and_degit(url: &str, target: &Path) -> Result<()> {
/// Resolve pallet path
/// For a template it should be `<template>/pallets/`
/// For no path, it should just place it in the current working directory
#[cfg(feature = "parachain")]
pub(crate) fn resolve_pallet_path(path: Option<String>) -> PathBuf {
use std::process;

Expand Down
8 changes: 5 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ mod style;

#[cfg(feature = "parachain")]
mod git;
#[cfg(feature = "parachain")]
#[cfg(any(feature = "contract", feature = "parachain"))]
mod helpers;
#[cfg(feature = "parachain")]
mod parachains;
Expand Down Expand Up @@ -37,12 +37,14 @@ enum Commands {
Build(commands::build::BuildArgs),
/// Call a smart contract.
#[clap(alias = "c")]
#[cfg(feature = "contract")]
Call(commands::call::CallArgs),
/// Deploy a parachain or smart contract.
#[clap(alias = "u")]
Up(commands::up::UpArgs),
/// Test a smart contract.
#[clap(alias = "t")]
#[cfg(feature = "contract")]
Test(commands::test::TestArgs),
}

Expand All @@ -64,8 +66,8 @@ async fn main() -> Result<()> {
#[cfg(feature = "contract")]
commands::build::BuildCommands::Contract(cmd) => cmd.execute(),
},
#[cfg(feature = "contract")]
Commands::Call(args) => Ok(match &args.command {
#[cfg(feature = "contract")]
commands::call::CallCommands::Contract(cmd) => cmd.execute().await?,
}),
Commands::Up(args) => Ok(match &args.command {
Expand All @@ -74,8 +76,8 @@ async fn main() -> Result<()> {
#[cfg(feature = "contract")]
commands::up::UpCommands::Contract(cmd) => cmd.execute().await?,
}),
#[cfg(feature = "contract")]
Commands::Test(args) => match &args.command {
#[cfg(feature = "contract")]
commands::test::TestCommands::Contract(cmd) => cmd.execute(),
},
}
Expand Down

0 comments on commit 4890736

Please sign in to comment.