Remove all feature flags except event-stream (#322)

Signed-off-by: Robert Vojta <rvojta@me.com>
This commit is contained in:
Robert Vojta 2019-11-20 14:03:22 +01:00 committed by GitHub
parent 011a47e93d
commit 7333de70a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 45 additions and 45 deletions

View File

@ -50,26 +50,17 @@ jobs:
- name: Test Build
run: cargo build
continue-on-error: ${{ matrix.can-fail }}
- name: Test default features
run: cargo test --lib -- --nocapture --test-threads 1
continue-on-error: ${{ matrix.can-fail }}
- name: Test serde feature
run: cargo test --lib --features serde -- --nocapture --test-threads 1
continue-on-error: ${{ matrix.can-fail }}
- name: Test event-stream feature
run: cargo test --lib --features event-stream -- --nocapture --test-threads 1
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
continue-on-error: ${{ matrix.can-fail }}
- name: Test terminal feature
run: cargo test --features terminal --no-default-features --lib -- --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
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
run: cargo test --all-features -- --nocapture --test-threads 1
continue-on-error: ${{ matrix.can-fail }}
- name: Test Packaging
if: matrix.rust == 'stable'

View File

@ -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

View File

@ -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"

View File

@ -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;