Skip to content

Commit

Permalink
Remove all feature flags except event-stream (#322)
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Vojta <[email protected]>
  • Loading branch information
zrzka authored Nov 20, 2019
1 parent 011a47e commit 7333de7
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 43 deletions.
25 changes: 8 additions & 17 deletions .github/workflows/crossterm_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,26 +50,17 @@ jobs:
- name: Test Build
run: cargo build
continue-on-error: ${{ matrix.can-fail }}
- name: Test all features
run: cargo test --all-features --no-default-features -- --nocapture --test-threads 1
continue-on-error: ${{ matrix.can-fail }}
- name: Test cursor feature
run: cargo test --features cursor --no-default-features --lib -- --nocapture --test-threads 1
continue-on-error: ${{ matrix.can-fail }}
- name: Test style feature
run: cargo test --features style --no-default-features --lib -- --nocapture --test-threads 1
- name: Test default features
run: cargo test --lib -- --nocapture --test-threads 1
continue-on-error: ${{ matrix.can-fail }}
- name: Test terminal feature
run: cargo test --features terminal --no-default-features --lib -- --nocapture --test-threads 1
- name: Test serde feature
run: cargo test --lib --features serde -- --nocapture --test-threads 1
continue-on-error: ${{ matrix.can-fail }}
- name: Test screen feature
run: cargo test --features screen --no-default-features --lib -- --nocapture --test-threads 1
- name: Test event-stream feature
run: cargo test --lib --features event-stream -- --nocapture --test-threads 1
continue-on-error: ${{ matrix.can-fail }}
- name: Test event feature
run: cargo test --features event --no-default-features --lib -- --nocapture --test-threads 1
continue-on-error: ${{ matrix.can-fail }}
- name: Test async-event feature
run: cargo test --features event-stream --no-default-features --lib -- --nocapture --test-threads 1
- name: Test all features
run: cargo test --all-features -- --nocapture --test-threads 1
continue-on-error: ${{ matrix.can-fail }}
- name: Test Packaging
if: matrix.rust == 'stable'
Expand Down
12 changes: 5 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@ script:
- if [ "$TRAVIS_RUST_VERSION" = "stable" ]; then cargo fmt --all -- --check; fi
- cargo clippy -- -D clippy::all
- cargo build
- cargo test --all-features --no-default-features -- --nocapture --test-threads 1
- cargo test --features cursor --no-default-features --lib -- --nocapture --test-threads 1
- cargo test --features style --no-default-features --lib -- --nocapture --test-threads 1
- cargo test --features terminal --no-default-features --lib -- --nocapture --test-threads 1
- cargo test --features screen --no-default-features --lib -- --nocapture --test-threads 1
- cargo test --features event --no-default-features --lib -- --nocapture --test-threads 1
- cargo test --features event-stream --no-default-features --lib -- --nocapture --test-threads 1
- cargo test --lib -- --nocapture --test-threads 1
- cargo test --lib --features serde -- --nocapture --test-threads 1
- cargo test --lib --features event-stream -- --nocapture --test-threads 1
- cargo test --all-features -- --nocapture --test-threads 1
- if [ "$TRAVIS_RUST_VERSION" = "stable" ]; then cargo package; fi
44 changes: 30 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,50 @@ categories = ["command-line-interface", "command-line-utilities"]
name = "crossterm"
path = "src/lib.rs"

#
# Build documentation with all features -> EventStream is available
#
[package.metadata.docs.rs]
all-features = true

#
# Features
#
[features]
default = ["cursor", "style", "terminal", "screen", "event"]
cursor = ["lazy_static", "event", "winapi/wincon", "winapi/winnt", "winapi/minwindef"]
style = ["lazy_static", "winapi/wincon"]
terminal = ["cursor"]
screen = ["lazy_static", "winapi/wincon", "winapi/minwindef"]
event = ["bitflags", "mio", "lazy_static", "parking_lot", "screen", "terminal", "winapi/winnt", "winapi/winuser", "winapi/wincon", "winapi/synchapi", "winapi/namedpipeapi", "winapi/impl-default"]
event-stream = ["event", "futures"]
default = []
event-stream = ["futures"]

#
# Shared dependencies
#
[dependencies]
bitflags = { version = "1.2", optional = true }
lazy_static = { version = "1.4", optional = true }
parking_lot = { version = "0.9", optional = true }
bitflags = "1.2"
futures = { version = "0.3", optional = true }
lazy_static = "1.4"
parking_lot = "0.9"
serde = { version = "1.0.0", features = ["derive"], optional = true }
futures = {version = "0.3", optional = true }

#
# Windows dependencies
#
[target.'cfg(windows)'.dependencies.winapi]
version = "0.3.8"
features = ["winuser"]

[target.'cfg(windows)'.dependencies]
winapi = "0.3.8"
crossterm_winapi = "0.5.0"

#
# UNIX dependencies
#
[target.'cfg(unix)'.dependencies]
libc = "0.2.51"
mio = { version = "0.6.19", optional = true }
signal-hook = { version = "0.1.11", features=["mio-support"]}
mio = "0.6.19"
signal-hook = { version = "0.1.11", features = ["mio-support"] }

#
# Dev dependencies (examples, ...)
#
[dev-dependencies]
tokio = "0.2.0-alpha.6"
futures = "0.3"
Expand Down
5 changes: 0 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,19 +232,14 @@ pub use utils::functions::supports_ansi;
pub use utils::{Command, ErrorKind, ExecutableCommand, Output, QueueableCommand, Result};

/// A module to work with the terminal cursor
#[cfg(feature = "cursor")]
pub mod cursor;
/// A module to read events.
#[cfg(feature = "event")]
pub mod event;
/// A module to work with the terminal screen.
#[cfg(feature = "screen")]
pub mod screen;
/// A module to apply attributes and colors on your text.
#[cfg(feature = "style")]
pub mod style;
/// A module to work with the terminal.
#[cfg(feature = "terminal")]
pub mod terminal;
/// Shared utilities.
pub mod utils;

0 comments on commit 7333de7

Please sign in to comment.