Skip to content

Commit

Permalink
Move api-desc binary target to its own crate (#491)
Browse files Browse the repository at this point in the history
This avoids sharing dependencies between the library and the binary.
  • Loading branch information
ia0 committed May 26, 2024
1 parent a9a59a8 commit 484ffa6
Show file tree
Hide file tree
Showing 70 changed files with 334 additions and 3,386 deletions.
7 changes: 6 additions & 1 deletion crates/api-desc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog

## 0.1.7-git
## 0.2.0-git

### Major

- Remove the binary target making this crate a pure library
- Remove implementation of `clap::ValueEnum` for `Lang`

### Minor

Expand Down
60 changes: 1 addition & 59 deletions crates/api-desc/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions crates/api-desc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wasefire-applet-api-desc"
version = "0.1.7-git"
version = "0.2.0-git"
authors = ["Julien Cretin <cretin@google.com>"]
license = "Apache-2.0"
publish = true
Expand All @@ -12,8 +12,6 @@ keywords = ["embedded", "framework", "no-std", "wasm"]
categories = ["embedded", "no-std", "wasm"]

[dependencies]
anyhow = { version = "1.0.86", default-features = false, features = ["std"] }
clap = { version = "4.5.4", default-features = false, features = ["derive", "std"] }
data-encoding = { version = "2.6.0", default-features = false }
data-encoding-macro = { version = "0.1.15", default-features = false }
proc-macro2 = { version = "1.0.83", default-features = false }
Expand Down Expand Up @@ -75,3 +73,4 @@ internal-api-usb = []
clippy.unit-arg = "allow"
rust.unreachable-pub = "warn"
rust.unsafe-op-in-unsafe-fn = "warn"
rust.unused-crate-dependencies = "warn"
3 changes: 1 addition & 2 deletions crates/api-desc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use std::io::Write;
use std::ops;

use clap::ValueEnum;
use proc_macro2::{Ident, Span, TokenStream};
use quote::{format_ident, quote};

Expand Down Expand Up @@ -88,7 +87,7 @@ impl Default for Api {
}
}

#[derive(Copy, Clone, ValueEnum)]
#[derive(Copy, Clone)]
pub enum Lang {
C,
Assemblyscript,
Expand Down
2 changes: 0 additions & 2 deletions crates/api-desc/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,3 @@ check_applet_api api- --features=
test_helper

cargo test --lib --features=full-api
# TODO: Move this bin target to xtask.
cargo check --bin=wasefire-applet-api-desc
2 changes: 1 addition & 1 deletion crates/api-macro/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@

## 0.1.0

<!-- Increment to skip CHANGELOG.md test: 4 -->
<!-- Increment to skip CHANGELOG.md test: 5 -->
60 changes: 1 addition & 59 deletions crates/api-macro/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/api-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ categories = ["embedded", "no-std", "wasm"]
proc-macro = true

[dependencies]
wasefire-applet-api-desc = { version = "=0.1.7-git", path = "../api-desc" }
wasefire-applet-api-desc = { version = "=0.2.0-git", path = "../api-desc" }

[features]
api-button = ["wasefire-applet-api-desc/api-button"]
Expand Down
62 changes: 2 additions & 60 deletions crates/api/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 484ffa6

Please sign in to comment.