Skip to content

Commit

Permalink
Reorganize repository into a single source folder
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmunns committed May 13, 2024
1 parent 5fa649a commit 67b795b
Show file tree
Hide file tree
Showing 26 changed files with 102 additions and 103 deletions.
96 changes: 5 additions & 91 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,92 +1,6 @@
[package]
name = "postcard"
version = "1.0.9"
authors = ["James Munns <[email protected]>"]
edition = "2018"
readme = "README.md"
repository = "https://github.com/jamesmunns/postcard"
description = "A no_std + serde compatible message library for Rust"
license = "MIT OR Apache-2.0"
categories = [
"embedded",
"no-std",
]
keywords = [
"serde",
"cobs",
"framing",
]
documentation = "https://docs.rs/postcard/"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]

[dependencies.heapless]
version = "0.8.0"
default-features = false
features = ["serde"]
optional = true

[dependencies.serde]
version = "1.0.100"
default-features = false
features = ["derive"]

[dependencies.cobs]
version = "0.2.3"
default-features = false

[dependencies.defmt]
version = "0.3"
optional = true

[dependencies.embedded-io-04]
package = "embedded-io"
version = "0.4"
optional = true

[dependencies.embedded-io-06]
package = "embedded-io"
version = "0.6"
optional = true

[dependencies.postcard-derive]
path = "./postcard-derive"
version = "0.1.1"
optional = true

[dependencies.crc]
version = "3.0.1"
optional = true

[dependencies.paste]
version = "1.0.12"
optional = true

[features]
default = ["heapless-cas"]

# Enables support for `embedded-io` traits
# This feature will track the latest `embedded-io` when major releases are made
embedded-io = ["dep:embedded-io-04"]

# Specific versions of `embedded-io` can be selected through the features below
embedded-io-04 = ["dep:embedded-io-04"]
embedded-io-06 = ["dep:embedded-io-06"]

use-std = ["serde/std", "alloc"]
heapless-cas = ["heapless", "heapless/portable-atomic"]
alloc = ["serde/alloc", "embedded-io-04?/alloc", "embedded-io-06?/alloc"]
use-defmt = ["defmt"]
use-crc = ["crc", "paste"]

# Experimental features!
#
# NOT subject to SemVer guarantees!
experimental-derive = ["postcard-derive"]

[workspace]
members = ["postcard-derive"]
resolver = '2'
members = [
"source/postcard",
"source/postcard-derive",
]
18 changes: 7 additions & 11 deletions ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,23 @@ ensure_toolchain() {
has_toolchain "$1" || rustup toolchain install "$1"
}

ensure_toolchain nightly-x86_64-unknown-linux-gnu
ensure_toolchain nightly

cargo_check() {
cargo check "$@"
cargo clippy "$@" -- --deny=warnings
cargo check --all "$@"
cargo clippy --all "$@" -- --deny=warnings
}
cargo_test() {
cargo_check --all-targets "$@"
cargo test "$@"
cargo test --all "$@"
}

cargo_test --features=alloc,experimental-derive,use-std,use-crc

cargo_check --target=thumbv7em-none-eabi --no-default-features
cargo_check --target=thumbv7em-none-eabi --features=alloc,experimental-derive

cargo fmt -- --check
cargo fmt --all -- --check

env RUSTDOCFLAGS='--cfg=docsrs --deny=warnings' cargo +nightly doc --no-deps --all-features

cd postcard-derive

cargo_check
cargo fmt -- --check
# Check docs.rs build
env RUSTDOCFLAGS='--cfg=docsrs --deny=warnings' cargo +nightly doc --all --no-deps --all-features
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
89 changes: 89 additions & 0 deletions source/postcard/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
[package]
name = "postcard"
version = "1.0.9"
authors = ["James Munns <[email protected]>"]
edition = "2018"
readme = "README.md"
repository = "https://github.com/jamesmunns/postcard"
description = "A no_std + serde compatible message library for Rust"
license = "MIT OR Apache-2.0"
categories = [
"embedded",
"no-std",
]
keywords = [
"serde",
"cobs",
"framing",
]
documentation = "https://docs.rs/postcard/"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]

[dependencies.heapless]
version = "0.8.0"
default-features = false
features = ["serde"]
optional = true

[dependencies.serde]
version = "1.0.100"
default-features = false
features = ["derive"]

[dependencies.cobs]
version = "0.2.3"
default-features = false

[dependencies.defmt]
version = "0.3"
optional = true

[dependencies.embedded-io-04]
package = "embedded-io"
version = "0.4"
optional = true

[dependencies.embedded-io-06]
package = "embedded-io"
version = "0.6"
optional = true

[dependencies.postcard-derive]
path = "../postcard-derive"
version = "0.1.1"
optional = true

[dependencies.crc]
version = "3.0.1"
optional = true

[dependencies.paste]
version = "1.0.12"
optional = true

[features]
default = ["heapless-cas"]

# Enables support for `embedded-io` traits
# This feature will track the latest `embedded-io` when major releases are made
embedded-io = ["dep:embedded-io-04"]

# Specific versions of `embedded-io` can be selected through the features below
embedded-io-04 = ["dep:embedded-io-04"]
embedded-io-06 = ["dep:embedded-io-06"]

use-std = ["serde/std", "alloc"]
heapless-cas = ["heapless", "heapless/portable-atomic"]
alloc = ["serde/alloc", "embedded-io-04?/alloc", "embedded-io-06?/alloc"]
use-defmt = ["defmt"]
use-crc = ["crc", "paste"]

# Experimental features!
#
# NOT subject to SemVer guarantees!
experimental-derive = ["postcard-derive"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/lib.rs → source/postcard/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![cfg_attr(not(any(test, feature = "use-std")), no_std)]
#![warn(missing_docs)]
#![cfg_attr(not(doctest), doc = include_str!("../README.md"))]
#![cfg_attr(not(doctest), doc = include_str!("../../../README.md"))]
#![cfg_attr(docsrs, feature(doc_cfg))]

pub mod accumulator;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 67b795b

Please sign in to comment.