From 020c1a5ee1fabbdc07714c85abf2367fcfa96636 Mon Sep 17 00:00:00 2001 From: tami5 Date: Sun, 26 Jun 2022 08:54:55 +0300 Subject: [PATCH] chore(deps): bump process-stream to 0.4 --- Cargo.lock | 6 +++--- Cargo.toml | 4 ++-- src/compile/tests.rs | 1 + src/logger.rs | 22 +++++++++++----------- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b0ee68a..5a3d566 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -492,9 +492,9 @@ dependencies = [ [[package]] name = "process-stream" -version = "0.3.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "396ef89a4907712cf2542cfa475225ef7f5d2c2a6664ce7748e44c4980b9de30" +checksum = "9393a84f579ff868398996c087baee67ab3b068abb0cc8564d6125890d8d13d1" dependencies = [ "async-stream", "async-trait", @@ -1039,7 +1039,7 @@ checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" [[package]] name = "xclog" -version = "0.3.0" +version = "0.3.1" dependencies = [ "anyhow", "async-stream", diff --git a/Cargo.toml b/Cargo.toml index f87cef3..1ded709 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "xclog" -version = "0.3.0" +version = "0.3.1" edition = "2021" description = "xcodebuild build-log formater and parser" license = "MIT OR Apache-2.0" @@ -26,7 +26,7 @@ tracing-subscriber = { version = "0.3.9", features = ["env-filter"], optiona anyhow = "1.0.57" async-stream = "0.3.3" -process-stream = "0.3.2" +process-stream = "0.4.0" paste = "1.0.7" derive_is_enum_variant = "0.1.1" serde = { version = "1.0.137", features = ["derive"] } diff --git a/src/compile/tests.rs b/src/compile/tests.rs index 29ad7bd..f4a53fd 100644 --- a/src/compile/tests.rs +++ b/src/compile/tests.rs @@ -1,4 +1,5 @@ use super::*; +use crate::XCLogger; use process_stream::{ProcessExt, StreamExt}; fn get_compile_commands(content: &str) -> XCCompilationDatabase { diff --git a/src/logger.rs b/src/logger.rs index 392edbb..89fa3d2 100644 --- a/src/logger.rs +++ b/src/logger.rs @@ -8,8 +8,8 @@ use std::path::PathBuf; use std::sync::Arc; use std::{path::Path, pin::Pin}; use tokio::process::Command; -use tokio::sync::mpsc::Sender; use tokio::sync::Mutex; +use tokio::sync::Notify; /// XCLogger struct #[derive(derive_deref_rs::Deref)] @@ -18,7 +18,7 @@ pub struct XCLogger { root: PathBuf, #[deref] inner: tokio::process::Command, - kill_send: Option>, + abort: Option>, /// Arc Reference to compile_commands pub compile_commands: Arc>>, } @@ -28,14 +28,6 @@ impl ProcessExt for XCLogger { &mut self.inner } - fn killer(&self) -> Option> { - self.kill_send.clone() - } - - fn set_killer(&mut self, killer: Sender<()>) { - self.kill_send = killer.into() - } - fn spawn_and_stream( &mut self, ) -> std::io::Result + Send>>> { @@ -77,6 +69,14 @@ impl ProcessExt for XCLogger { } .boxed()) } + + fn aborter(&self) -> Option> { + self.abort.clone() + } + + fn set_aborter(&mut self, aborter: Option>) { + self.abort = aborter + } } impl XCLogger { @@ -95,7 +95,7 @@ impl XCLogger { Ok(Self { root: root.as_ref().to_path_buf(), inner, - kill_send: None, + abort: None, compile_commands: Default::default(), }) }