Skip to content

Commit

Permalink
add a progenitor feature for use of macro (and client)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahl committed Dec 18, 2024
1 parent 8369e5f commit 3f9147e
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 5 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ jobs:
- name: Run tests
run: cargo test --locked --verbose

build-no-default-features:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
steps:
- uses: actions/checkout@v2
- name: Build
run: cargo build --locked --no-default-features

test-wasm:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ members = [
resolver = "2"

[workspace.dependencies]
progenitor = { version = "0.8.0", path = "progenitor" }
progenitor = { version = "0.8.0", path = "progenitor", default-features = false }
progenitor-client = { version = "0.8.0", path = "progenitor-client" }
progenitor-impl = { version = "0.8.0", path = "progenitor-impl" }
progenitor-macro = { version = "0.8.0", path = "progenitor-macro" }
Expand Down
2 changes: 1 addition & 1 deletion cargo-progenitor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ build = "build.rs"
default-run = "cargo-progenitor"

[dependencies]
progenitor = { workspace = true }
progenitor = { workspace = true, default-features = false }
progenitor-client = { workspace = true }
progenitor-impl = { workspace = true }

Expand Down
2 changes: 1 addition & 1 deletion example-build/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ uuid = { version = "1.11", features = ["serde", "v4"] }

[build-dependencies]
prettyplease = "0.2.25"
progenitor = { path = "../progenitor" }
progenitor = { path = "../progenitor", default-features = false }
serde_json = "1.0"
syn = "2.0"
8 changes: 6 additions & 2 deletions progenitor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ readme = "../README.md"
keywords = ["openapi", "openapiv3", "sdk", "generator", "proc_macro"]
categories = ["api-bindings", "compilers"]

[features]
default = ["macro"]
macro = ["dep:progenitor-client", "dep:progenitor-macro"]

[dependencies]
progenitor-client = { workspace = true }
progenitor-client = { workspace = true, optional = true }
progenitor-impl = { workspace = true }
progenitor-macro = { workspace = true }
progenitor-macro = { workspace = true, optional = true }

[dev-dependencies]
base64 = { workspace = true }
Expand Down
2 changes: 2 additions & 0 deletions progenitor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#![deny(missing_docs)]

#[cfg(feature = "macro")]
pub use progenitor_client;
pub use progenitor_impl::CrateVers;
pub use progenitor_impl::Error;
Expand All @@ -21,4 +22,5 @@ pub use progenitor_impl::InterfaceStyle;
pub use progenitor_impl::TagStyle;
pub use progenitor_impl::TypeImpl;
pub use progenitor_impl::TypePatch;
#[cfg(feature = "macro")]
pub use progenitor_macro::generate_api;

0 comments on commit 3f9147e

Please sign in to comment.