address review comments

- rename feature to `windows`
- remove unused config key from `Cargo.toml`, unfortunately `cfg` isn't available for everything
- make sure feature is toggled on on CI when checking and when publishing
This commit is contained in:
Sebastian Thiel 2024-04-25 11:17:52 +02:00
parent 3058ffbc9b
commit 29525ffd03
No known key found for this signature in database
GPG Key ID: 9CB5EE7895E8268B
6 changed files with 11 additions and 13 deletions

View File

@ -225,4 +225,4 @@ jobs:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- name: "cargo check"
run: cargo check --all --bins --examples
run: cargo check --all --bins --examples --features windows

View File

@ -63,9 +63,6 @@ features = [
"window-unmaximize"
]
[target."cfg(windows)".features]
gitbutler-watcher = { workspace = true, features = ["adapt-to-windows"] }
[lints.clippy]
all = "deny"
perf = "deny"
@ -74,7 +71,7 @@ correctness = "deny"
[features]
default = ["custom-protocol", "sentry", "devtools"]
## A forwarding to all crates that have windows-specific adjustments for testing on non-Windows.
adapt-to-windows = ["gitbutler-watcher/adapt-to-windows"]
windows = ["gitbutler-watcher/windows"]
devtools = ["tauri/devtools"]
# this feature is used used for production builds where `devPath` points to the filesystem

View File

@ -35,7 +35,7 @@ pub fn init(app_handle: &AppHandle) {
.parse()
.unwrap_or(LevelFilter::INFO);
let use_colors_in_logs = cfg!(not(feature = "adapt-to-windows"));
let use_colors_in_logs = cfg!(not(feature = "windows"));
let subscriber = tracing_subscriber::registry()
.with(
// subscriber for https://github.com/tokio-rs/console

View File

@ -7,7 +7,7 @@ publish = false
[features]
default = []
## A trial to see if doing things differently on Windows helps with #3601
adapt-to-windows = []
windows = []
[lib]
doctest = false

View File

@ -12,11 +12,8 @@ use tracing::Level;
/// The timeout for debouncing file change events.
/// This is used to prevent multiple events from being sent for a single file change.
const DEBOUNCE_TIMEOUT: Duration = Duration::from_millis(if cfg!(feature = "adapt-to-windows") {
2000
} else {
100
});
const DEBOUNCE_TIMEOUT: Duration =
Duration::from_millis(if cfg!(feature = "windows") { 2000 } else { 100 });
/// This error is required only because `anyhow::Error` isn't implementing `std::error::Error`, and [`spawn()`]
/// needs to wrap it into a `backoff::Error` which also has to implement the `Error` trait.

View File

@ -163,7 +163,11 @@ CONFIG_PATH=$(readlink -f "$PWD/../crates/gitbutler-tauri/tauri.conf.$CHANNEL.js
# update the version in the tauri release config
jq '.package.version="'"$VERSION"'"' "$CONFIG_PATH" >"$TMP_DIR/tauri.conf.json"
FEATURES=""
if [ "$OS" = "windows" ]; then
FEATURES="windows"
else
FEATURES=""
fi
# build the app with release config
SENTRY_RELEASE="$VERSION" tauri build \