Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor the xtask package and implement a bump-version subcommand #120

Merged
merged 3 commits into from
May 22, 2023
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
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- uses: Swatinem/rust-cache@v2

- name: generate pac
run: cargo run --manifest-path=xtask/Cargo.toml -- --generate-only ${{ matrix.chip }}
run: cargo run --manifest-path=xtask/Cargo.toml -- generate ${{ matrix.chip }}
- name: build pac
run: cd ${{ matrix.chip }} && cargo check --all-targets

Expand All @@ -62,7 +62,7 @@ jobs:
- uses: Swatinem/rust-cache@v2

- name: generate pac
run: cargo run --manifest-path=xtask/Cargo.toml -- --generate-only ${{ matrix.chip }}
run: cargo run --manifest-path=xtask/Cargo.toml -- generate ${{ matrix.chip }}
- name: build pac
run: cd ${{ matrix.chip }} && cargo check --all-targets

Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:
- uses: Swatinem/rust-cache@v2

- name: generate pac
run: cargo +nightly run --manifest-path=xtask/Cargo.toml -- --generate-only ${{ matrix.chip }}
run: cargo +nightly run --manifest-path=xtask/Cargo.toml -- generate ${{ matrix.chip }}
- name: build pac
run: cd ${{ matrix.chip }} && cargo +1.65.0 check --all-targets

Expand All @@ -113,6 +113,6 @@ jobs:
- uses: Swatinem/rust-cache@v2

- name: generate pac
run: cargo run --manifest-path=xtask/Cargo.toml -- --generate-only ${{ matrix.chip }}
run: cargo run --manifest-path=xtask/Cargo.toml -- generate ${{ matrix.chip }}
- name: build pac
run: cd ${{ matrix.chip }} && cargo check --all-targets
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,26 @@ If you submit a pull request we kindly ask that you keep the patches and generat

## Generating the PACs

We use the workflow described by [cargo-xtask] to automate tasks within this monorepo. Currently there is only a single task which generates a Peripheral Access Crate (PAC) for the specified chip(s). We've opted not to use the `cargo xtask` alias, as this requires a workspace which can cause problems when using different toolchains and targets like we are.
We use the workflow described by [cargo-xtask] to automate tasks within this monorepo. We've opted not to use the `cargo xtask` alias as this requires a workspace, which can cause problems when using different toolchains and targets like we are.

```text
Usage: xtask [OPTIONS] [CHIPS]...
Usage: xtask <COMMAND>

Arguments:
[CHIPS]... Chip(s) to target [possible values: esp32, esp32c2, esp32c3, esp32c6, esp32h2, esp32s2, esp32s3, esp8266]
Commands:
patch Patch the specified package(s)'s SVD file
generate Generate the specified package(s)
build Build the specified package(s)
bump-version Bump the version of the specified package(s)
help Print this message or the help of the given subcommand(s)

Options:
-p, --patch-only Only patch the SVD, do not generate or build the PAC
-g, --generate-only Patch the SVD and generate the PAC, but do not build it
-h, --help Print help
-h, --help Print help
```

For example, to generate a PAC for the ESP32-C3 _without_ subsequently building the crate, from within the `xtask/` directory run:

```shell
$ cargo run -- --generate-only esp32c3
$ cargo run -- generate esp32c3
```

[cargo-xtask]: https://github.com/matklad/cargo-xtask/
Expand Down
Loading