mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-12-05 05:50:04 +08:00
* chore(clippy): scope crate lint policy Keep panic-on-error lints at application target roots and scope signal dependencies to Linux. * docs(agents): define Rust backend architecture boundaries Document which layer owns Rust capabilities, fallible inputs, background work, and crate validation. * refactor(draft): type async publication conflicts Return typed conflicts for async Draft edits. Release the lock and edit permit before converting the error, and exercise overlapping updates. * refactor(logging): use typed logger errors Expose crate-owned logger errors and preserve the underlying error sources. * refactor(subscription): extract response decoding Keep HTTP and persistence in the app. Decode response metadata and framing in the crate, and fall back when the server filename is invalid. * refactor(profile): extract profile models and index rules Move profile models and index rules into the crate, preserving serialization and returning a typed missing-profile error. * refactor(profile): separate subscription refresh and scheduling policy Separate download and scheduling policy from the subscription use case while retaining the existing write path. * refactor(subscription): decode deep links in the subscription crate * refactor(profile): extract selected node recovery rules * docs(agents): define dependencies between capability crates * refactor(task): move retry primitives into the task crate * refactor(backup): extract backup ZIP writing * refactor(subscription): keep profile writes outside proxy fallback * fix(profile): preserve delays for future update timestamps * fix(subscription): preserve filenames from response headers and URL paths * fix(subscription): separate deep link parameters from nested URLs * refactor(profile): look up the refresh target once * refactor(subscription): pass the proxy directly to each download * refactor(profile): build companion options in one place * refactor(profile): remove companions from the deleted profile * style(profile): keep profile fields together * refactor(profile): name index operations after what they change * refactor(profile): call the core reload directly * refactor(backup): move archive validation to the restore change
49 lines
1.8 KiB
Rust
49 lines
1.8 KiB
Rust
#![deny(clippy::expect_used, clippy::unwrap_used)]
|
|
|
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
if std::env::var("CARGO_CFG_TARGET_OS").as_deref() == Ok("windows")
|
|
&& std::env::var("CARGO_CFG_TARGET_ENV").as_deref() == Ok("msvc")
|
|
{
|
|
// Tauri's resource is linked to the app binary, but not to Rust unit-test harnesses or examples.
|
|
// Give non-app targets their own manifest so tests and examples can resolve TaskDialogIndirect.
|
|
let out_dir = std::env::var_os("OUT_DIR").ok_or_else(|| std::io::Error::other("OUT_DIR is not set"))?;
|
|
let manifest_path = std::path::PathBuf::from(out_dir).join("windows-test-manifest.xml");
|
|
std::fs::write(
|
|
&manifest_path,
|
|
r#"<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
|
<dependency>
|
|
<dependentAssembly>
|
|
<assemblyIdentity
|
|
type="win32"
|
|
name="Microsoft.Windows.Common-Controls"
|
|
version="6.0.0.0"
|
|
processorArchitecture="*"
|
|
publicKeyToken="6595b64144ccf1df"
|
|
language="*"
|
|
/>
|
|
</dependentAssembly>
|
|
</dependency>
|
|
</assembly>
|
|
"#,
|
|
)?;
|
|
let manifest_display = manifest_path.display();
|
|
if std::env::var_os("CARGO_FEATURE_CLIPPY").is_some() {
|
|
println!("cargo:rustc-link-arg=/MANIFEST:EMBED");
|
|
println!("cargo:rustc-link-arg=/MANIFESTINPUT:{manifest_display}");
|
|
} else {
|
|
println!("cargo:rustc-link-arg-examples=/MANIFEST:EMBED");
|
|
println!("cargo:rustc-link-arg-examples=/MANIFESTINPUT:{manifest_display}");
|
|
}
|
|
}
|
|
|
|
#[cfg(feature = "clippy")]
|
|
{
|
|
println!("cargo:warning=Skipping tauri_build during Clippy");
|
|
}
|
|
|
|
#[cfg(not(feature = "clippy"))]
|
|
tauri_build::build();
|
|
|
|
Ok(())
|
|
}
|