Skip to content

Commit 65c1159

Browse files
add stub cli exes
- add cli and clite to the actions matrix - add compress stub - add extract stubs - add info stub - introspect inputs to compress
1 parent 5895805 commit 65c1159

File tree

6 files changed

+393
-3
lines changed

6 files changed

+393
-3
lines changed

.github/workflows/ci.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
2323
strategy:
2424
matrix:
25-
workspace: ['Cargo.toml', 'fuzz/Cargo.toml']
25+
workspace: ['Cargo.toml', 'fuzz/Cargo.toml', 'cli/Cargo.toml', 'cli/clite/Cargo.toml']
2626
os: [ubuntu-latest, macOS-latest, windows-latest]
2727
rustalias: [stable, nightly, msrv]
2828
feature_flag:
@@ -53,7 +53,7 @@ jobs:
5353
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
5454
strategy:
5555
matrix:
56-
workspace: ['Cargo.toml', 'fuzz/Cargo.toml']
56+
workspace: ['Cargo.toml', 'fuzz/Cargo.toml', 'cli/Cargo.toml', 'cli/clite/Cargo.toml']
5757
feature_flag:
5858
- "--all-features"
5959
- "--no-default-features"
@@ -100,6 +100,10 @@ jobs:
100100
run: cargo fmt --all -- --check
101101
- name: fmt fuzz
102102
run: cargo fmt --all --manifest-path ${{ github.workspace }}/fuzz/Cargo.toml -- --check
103+
- name: fmt cli
104+
run: cargo fmt --all --manifest-path ${{ github.workspace }}/cli/Cargo.toml -- --check
105+
- name: fmt clite
106+
run: cargo fmt --all --manifest-path ${{ github.workspace }}/cli/clite/Cargo.toml -- --check
103107

104108
check_minimal_versions:
105109
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
@@ -124,7 +128,7 @@ jobs:
124128
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
125129
strategy:
126130
matrix:
127-
workspace: ['Cargo.toml', 'fuzz/Cargo.toml']
131+
workspace: ['Cargo.toml', 'fuzz/Cargo.toml', 'cli/Cargo.toml', 'cli/clite/Cargo.toml']
128132
feature_flag: ["--all-features", "--no-default-features", ""]
129133
runs-on: ubuntu-latest
130134
steps:

cli/Cargo.toml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
[package]
2+
name = "zip-cli"
3+
version = "0.0.1"
4+
authors = [
5+
"Danny McClanahan <[email protected]>",
6+
]
7+
license = "MIT"
8+
repository = "https://github.com/zip-rs/zip2.git"
9+
keywords = ["zip", "archive", "compression", "cli"]
10+
categories = ["command-line-utilities", "compression", "filesystem", "development-tools::build-utils"]
11+
# This field is not as important as in the top-level library API, but as there:
12+
# Any change to rust-version must be reflected also in `README.md` and `.github/workflows/ci.yaml`.
13+
# The MSRV policy is documented in `README.md`.
14+
rust-version = "1.83.0"
15+
description = """
16+
Binary for creation and manipulation of zip files.
17+
18+
This package can enable or disable certain dependencies during the build and install process with
19+
cargo features.
20+
"""
21+
edition = "2021"
22+
23+
# Prevent this from interfering with workspaces
24+
[workspace]
25+
members = ["."]
26+
27+
[lib]
28+
29+
[[bin]]
30+
name = "zip-cli"
31+
32+
[dependencies.zip]
33+
path = ".."
34+
default-features = false
35+
36+
[features]
37+
aes-crypto = ["zip/aes-crypto"]
38+
bzip2 = ["zip/bzip2"]
39+
chrono = ["zip/chrono"]
40+
deflate64 = ["zip/deflate64"]
41+
deflate = ["zip/deflate"]
42+
deflate-flate2 = ["zip/deflate-flate2"]
43+
deflate-flate2-zlib-rs = ["zip/deflate-flate2-zlib-rs"]
44+
deflate-flate2-zlib = ["zip/deflate-flate2-zlib"]
45+
deflate-zopfli = ["zip/deflate-zopfli"]
46+
lzma = ["zip/lzma"]
47+
ppmd = ["zip/ppmd"]
48+
time = ["zip/time"]
49+
xz = ["zip/xz"]
50+
zstd = ["zip/zstd"]
51+
52+
default = [
53+
"aes-crypto",
54+
"bzip2",
55+
"deflate64",
56+
"deflate",
57+
"lzma",
58+
"ppmd",
59+
"time",
60+
"xz",
61+
"zstd",
62+
]
63+
64+
[profile.release]
65+
strip = true
66+
lto = true
67+
opt-level = 3
68+
codegen-units = 1

cli/clite/Cargo.toml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
[package]
2+
name = "zip-clite"
3+
version = "0.0.1"
4+
authors = [
5+
"Danny McClanahan <[email protected]>",
6+
]
7+
license = "MIT"
8+
repository = "https://github.com/zip-rs/zip2.git"
9+
keywords = ["zip", "archive", "compression", "cli"]
10+
categories = ["command-line-utilities", "compression", "filesystem", "development-tools::build-utils"]
11+
# This field is not as important as in the top-level library API, but as there:
12+
# Any change to rust-version must be reflected also in `README.md` and `.github/workflows/ci.yaml`.
13+
# The MSRV policy is documented in `README.md`.
14+
rust-version = "1.83.0"
15+
description = """
16+
Binary for creation and manipulation of zip files.
17+
18+
This distribution is created to be intentionally very small and easy to audit. It has reduced
19+
functionality, builds to optimize for size, and only bundles in support for a Rust
20+
DEFLATE implementation.
21+
"""
22+
edition = "2021"
23+
24+
# Prevent this from interfering with workspaces
25+
[workspace]
26+
members = ["."]
27+
28+
[[bin]]
29+
name = "zip-clite"
30+
31+
# NB: This is not a dependency on the top-level `zip` crate, but the `zip-cli` crate (which mirrors
32+
# the declared features from `zip`). We do not use its `main.rs` entry point, but rely upon
33+
# `lib.rs`, which was specifically designed to minimize the amount of code specific to
34+
# `zip-clite`.
35+
[dependencies.zip-cli]
36+
path = ".."
37+
default-features = false
38+
features = [
39+
"deflate-flate2",
40+
"deflate-flate2-zlib-rs",
41+
]
42+
43+
# No features, no options, no decisions! We're just making it explicit.
44+
[features]
45+
default = []
46+
47+
[profile.release]
48+
strip = true
49+
lto = true
50+
opt-level = "s"
51+
codegen-units = 1

cli/clite/src/main.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
use zip_cli::shared_main;
2+
3+
fn main() {
4+
shared_main()
5+
}

0 commit comments

Comments
 (0)