Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 4 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ jobs:
run: cargo +${{ matrix.rust_toolchain }} install --path=crates/cargo-wdk --profile ${{ matrix.cargo_profile }} --locked --force

- name: Build & Package Examples (via cargo-wdk)
run: cargo +${{ matrix.rust_toolchain }} wdk build --cwd ./examples --profile ${{ matrix.cargo_profile }} --target-arch ${{ matrix.target_triple.arch }} --sample
run: cargo +${{ matrix.rust_toolchain }} wdk build --profile ${{ matrix.cargo_profile }} --target-arch ${{ matrix.target_triple.arch }} --sample
working-directory: ./examples

- name: Run build on tests folder (via cargo-wdk)
run: cargo +${{ matrix.rust_toolchain }} wdk build --cwd ./tests --profile ${{ matrix.cargo_profile }} --target-arch ${{ matrix.target_triple.arch }}
run: cargo +${{ matrix.rust_toolchain }} wdk build --profile ${{ matrix.cargo_profile }} --target-arch ${{ matrix.target_triple.arch }}
working-directory: ./tests
6 changes: 0 additions & 6 deletions crates/cargo-wdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,6 @@ The recommended way to do this is to [enter an eWDK developer prompt](https://le
cargo wdk build
```

* With `--cwd`

```pwsh
cargo wdk build --cwd /path/to/project
```

* With `--target-arch`

```pwsh
Expand Down
5 changes: 2 additions & 3 deletions crates/cargo-wdk/src/actions/new/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ impl<'a> NewAction<'a> {
///
/// # Arguments
///
/// * `driver_project_name` - The name of the driver project to be created.
/// * `path` - The path to the new driver project. The last part of the path
/// is used as the package name.
/// * `driver_type` - The type of the driver project to be created.
/// * `cwd` - The current working directory inside which driver project will
/// be created.
/// * `verbosity_level` - The verbosity level for logging.
/// * `command_exec` - The provider for command exection.
/// * `fs` - The provider for file system operations.
Expand Down
8 changes: 2 additions & 6 deletions crates/cargo-wdk/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! This module defines the top-level CLI layer, its argument types and
//! structures used for parsing and validating arguments for various
//! subcommands.
use std::path::PathBuf;
use std::path::{Path, PathBuf};

use anyhow::{Ok, Result};
use clap::{ArgGroup, Args, Parser, Subcommand};
Expand Down Expand Up @@ -78,10 +78,6 @@ impl NewArgs {
/// Arguments for the `build` subcommand
#[derive(Debug, Args)]
pub struct BuildArgs {
/// Path to the project
#[arg(long, default_value = ".")]
pub cwd: PathBuf,

/// Build artifacts with the specified profile
#[arg(long, ignore_case = true)]
pub profile: Option<Profile>,
Expand Down Expand Up @@ -160,7 +156,7 @@ impl Cli {
};
let build_action = BuildAction::new(
&BuildActionParams {
working_dir: &cli_args.cwd,
working_dir: Path::new("."), // Using current dir as working dir
profile: cli_args.profile.as_ref(),
target_arch,
verify_signature: cli_args.verify_signature,
Expand Down
2 changes: 1 addition & 1 deletion crates/cargo-wdk/tests/build_command_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ fn run_build_cmd(driver_path: &str) -> String {
set_crt_static_flag();

let mut cmd = Command::cargo_bin("cargo-wdk").expect("unable to find cargo-wdk binary");
cmd.args(["build", "--cwd", driver_path]);
cmd.args(["build"]).current_dir(driver_path);

// assert command output
let cmd_assertion = cmd.assert().success();
Expand Down
7 changes: 2 additions & 5 deletions crates/cargo-wdk/tests/new_command_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,8 @@ fn create_and_build_new_driver_project(driver_type: &str) -> (String, String) {
set_crt_static_flag();

let mut cmd = Command::cargo_bin("cargo-wdk").expect("unable to find cargo-wdk binary");
cmd.args([
"build",
"--cwd",
&tmp_dir.join(&driver_name).to_string_lossy(), // Root dir for tests is cargo-wdk
]);
let driver_path = tmp_dir.join(&driver_name); // Root dir for tests
cmd.args(["build"]).current_dir(&driver_path);

let cmd_assertion = cmd.assert().failure();
tmp_dir
Expand Down
Loading