Skip to content

Commit

Permalink
Split the project in a library workspace and a binary workspace.
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Christophe Dubois <[email protected]>
  • Loading branch information
jcdubois committed Nov 12, 2023
1 parent a36196c commit 3fdaba3
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 35 deletions.
35 changes: 6 additions & 29 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,35 +1,12 @@
[package]
name = "heatshrink-rs"
version = "0.4.1"
edition = "2021"
authors = ["J-C Dubois"]
description = "A minimal implementation of the heatshrink compression algorithm for no_std environments"
readme = "README.md"
publish = false
autobins = false
license = "ISC"

[lib]
name = "heatshrink"
path = "src/lib.rs"

[[bin]]
name = "heatshrink"
path = "src/bin/heatshrink.rs"
[workspace]
members = [
"heatshrink-bin",
"heatshrink-lib",
]
resolver = "2"

[profile.release]
opt-level = 's' # Optimize for size.
lto = true # Link Time Optimization (LTO)
# codegen-units = 1 # Set this to 1 to allow for maximum size reduction optimizations:
# panic = 'abort' # removes the need for this extra unwinding code.

[dependencies]
clap = { version = "4.4.8", features = ["derive"] }

[dev-dependencies]
hex-literal = "0.4.1"

[features]
default = ["heatshrink-use-index"]
# Define features
heatshrink-use-index = []
8 changes: 4 additions & 4 deletions fuzz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "heatshrink-fuzz"
version = "0.0.0"
version = "0.4.1"
publish = false
edition = "2021"

Expand All @@ -10,11 +10,11 @@ cargo-fuzz = true
[dependencies]
libfuzzer-sys = "0.4"

[dependencies.heatshrink-rs]
path = ".."
[dependencies.heatshrink-lib]
path = "../heatshrink-lib"

[features]
heatshrink-use-index = ["heatshrink-rs/heatshrink-use-index"]
heatshrink-use-index = ["heatshrink-lib/heatshrink-use-index"]

# Prevent this from interfering with workspaces
[workspace]
Expand Down
20 changes: 20 additions & 0 deletions heatshrink-bin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[package]
name = "heatshrink-bin"
version = "0.4.1"
edition = "2021"
authors = ["J-C Dubois"]
description = "A program using the heatshrink library that cas be used to compress and decompresse data"
readme = "../README.md"
publish = false
autobins = false
license = "ISC"

[[bin]]
name = "heatshrink"
path = "src/main.rs"

[dependencies]
heatshrink-lib = { version = "0.4.1", path = "../heatshrink-lib" }
clap = { version = "4.4.8", features = ["derive"] }

[dev-dependencies]
4 changes: 2 additions & 2 deletions src/bin/heatshrink.rs → heatshrink-bin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ struct Cli {
)]
bits: u8,

/// some regular input
/// some regular input. It will default to stdin if unspecified.
#[clap(group = "input")]
input_file: Option<String>,

/// some regular output
/// some regular output. It will default to stdout if unspecified.
#[clap(group = "output")]
output_file: Option<String>,
}
Expand Down
24 changes: 24 additions & 0 deletions heatshrink-lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[package]
name = "heatshrink-lib"
version = "0.4.1"
edition = "2021"
authors = ["J-C Dubois"]
description = "A minimal library implementing the heatshrink compression algorithm for no_std environments"
readme = "../README.md"
publish = false
autobins = false
license = "ISC"

[lib]
name = "heatshrink"
path = "src/lib.rs"

[dependencies]

[dev-dependencies]
hex-literal = "0.4.1"

[features]
default = ["heatshrink-use-index"]
# Define features
heatshrink-use-index = []
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 3fdaba3

Please sign in to comment.