diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 6a0c704..813928c 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -13,7 +13,7 @@ jobs: build: runs-on: macos-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: rustup target add run: rustup target add aarch64-apple-darwin aarch64-apple-ios aarch64-apple-ios-sim x86_64-apple-ios - name: Build @@ -22,7 +22,7 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v4 - - uses: jdx/mise-action@v2 + - uses: jdx/mise-action@v3 with: mise_toml: | [tools] diff --git a/Cargo.toml b/Cargo.toml index 44cdb71..873bd96 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "xcframework" version = "0.1.0" -edition = "2021" +edition = "2024" license = "MIT" repository = "https://github.com/human-solutions/xcframework" description = "A Cargo plugin and library for building Apple XCFrameworks" @@ -17,11 +17,11 @@ cargo_metadata = { version = "0.19", features = ["builder"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" yansi = "1.0" -fs-err = "3.0" +fs-err = "3.1" zip-extensions = { version = "0.8", default-features = false } -xshell = "0.2.6" -glob = "0.3.1" +xshell = "0.2" +glob = "0.3" xflags = "0.3" [dev-dependencies] -tempfile = "3.3" +tempfile = "3.20" diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 58d0ea2..66b24af 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,9 +1,10 @@ [toolchain] channel = "stable" +components = ["rustfmt", "clippy"] targets = [ - "aarch64-apple-darwin", - "aarch64-apple-ios", - "aarch64-apple-ios-sim", - "x86_64-apple-darwin", - "x86_64-apple-ios" + "aarch64-apple-darwin", + "aarch64-apple-ios", + "aarch64-apple-ios-sim", + "x86_64-apple-darwin", + "x86_64-apple-ios", ] diff --git a/src/cmd/mod.rs b/src/cmd/mod.rs index a6ff03d..b4dcd6f 100644 --- a/src/cmd/mod.rs +++ b/src/cmd/mod.rs @@ -1,7 +1,7 @@ pub mod cargo; pub mod modulemap; -use anyhow::{anyhow, Result}; +use anyhow::{Result, anyhow}; use std::process::Command; use yansi::Paint; diff --git a/src/cmd/modulemap.rs b/src/cmd/modulemap.rs index c5a5550..a0f4f8f 100644 --- a/src/cmd/modulemap.rs +++ b/src/cmd/modulemap.rs @@ -1,7 +1,7 @@ use std::io; use crate::conf::Configuration; -use anyhow::{bail, Context, Result}; +use anyhow::{Context, Result, bail}; use camino_fs::*; use std::fs::File; @@ -46,6 +46,6 @@ fn ls_modulemap_files(dir: &Utf8Path) -> Result> { Ok(dir .ls() .files() - .filter(|path| path.extension().map_or(false, |ext| ext == "modulemap")) + .filter(|path| path.extension() == Some("modulemap")) .collect()) } diff --git a/src/conf/configuration.rs b/src/conf/configuration.rs index 9c025c7..a906ebb 100644 --- a/src/conf/configuration.rs +++ b/src/conf/configuration.rs @@ -1,5 +1,5 @@ use crate::cmd::modulemap; -use anyhow::{anyhow, bail, Context, Result}; +use anyhow::{Context, Result, anyhow, bail}; use camino_fs::Utf8PathBuf; use cargo_metadata::{Metadata, MetadataCommand, Package, TargetKind}; @@ -71,9 +71,9 @@ impl Configuration { let metadata = MetadataCommand::new().manifest_path(manifest_path).exec()?; + let workspace_packages = metadata.workspace_packages(); let package = if let Some(package) = &cli.package { - metadata - .workspace_packages() + workspace_packages .iter() .find(|p| &p.name == package) .ok_or(anyhow!("Could not find package '{package}'"))? diff --git a/src/conf/xcframework.rs b/src/conf/xcframework.rs index 566b456..fd4ddb2 100644 --- a/src/conf/xcframework.rs +++ b/src/conf/xcframework.rs @@ -1,7 +1,7 @@ #![allow(non_snake_case)] use super::Target; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use camino_fs::*; use serde::Deserialize; use std::str::FromStr; @@ -102,11 +102,7 @@ impl XCFrameworkConfiguration { ) -> Result { let mut me = serde_json::from_value::(section.clone())?; me.include_dir = package_dir.join(me.include_dir); - if validate { - me.validated() - } else { - Ok(me) - } + if validate { me.validated() } else { Ok(me) } } fn validated(self) -> Result { diff --git a/src/core.rs b/src/core.rs index f3eb9d4..cb90991 100644 --- a/src/core.rs +++ b/src/core.rs @@ -3,7 +3,7 @@ use std::collections::HashMap; use anyhow::{Context, Ok}; use camino_fs::*; use platform::ApplePlatform; -use xshell::{cmd, Shell}; +use xshell::{Shell, cmd}; pub mod platform; pub mod plist;