diff --git a/.github/workflows/cd-pr.yml b/.github/workflows/cd-pr.yml new file mode 100644 index 0000000..b2f29f3 --- /dev/null +++ b/.github/workflows/cd-pr.yml @@ -0,0 +1,163 @@ +# todo-zm: create a merge to main job that deletes old draft releases +# todo-zm: clean the release assets (only keep: dmg, setup.exe, .exe, .app) +name: "CD PR" +on: + pull_request: + branches: + - main + types: [opened, synchronize, reopened, labeled, unlabeled] + +concurrency: + group: "cd-pr" + cancel-in-progress: true + +jobs: + sysmon-build-upload: + if: contains(github.event.pull_request.labels.*.name, 'preview') + permissions: + contents: write + strategy: + fail-fast: false + matrix: + include: # https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#standard-github-hosted-runners-for-public-repositories + - platform: macos-latest + arch: aarch64-apple-darwin + - platform: macos-13 + arch: x86_64-apple-darwin + - platform: windows-latest + arch: x86_64-pc-windows-msvc + - platform: windows-11-arm + arch: aarch64-pc-windows-msvc + runs-on: ${{ matrix.platform }} + env: + SCCACHE_GHA_ENABLED: "true" + # todo-zm: remove conditional once https://github.com/Mozilla-Actions/sccache-action/issues/189 is resolved + RUSTC_WRAPPER: ${{ matrix.platform != 'windows-11-arm' && 'sccache' || '' }} + RUSTFLAGS: -Ctarget-feature=+crt-static + PR_NUMBER: ${{ github.event.pull_request.number }} + + steps: + - uses: actions/checkout@v4 + + - if: startsWith(matrix.platform, 'macos') + # todo-zm: change to @3 once https://github.com/swift-actions/setup-swift/pull/710 is resolved + uses: swift-actions/setup-swift@next + with: + swift-version: "6.1" + + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + target: ${{ matrix.arch }} + # todo-zm: remove conditional ...(see above) + - if: matrix.platform != 'windows-11-arm' + uses: mozilla-actions/sccache-action@v0.0.9 + + - uses: actions/setup-node@v4 + with: + node-version: "lts/*" + + # todo-zm: move npm i to `before[Dev/Build]Command` + - run: npm i + working-directory: ./desktop/web + + - run: cargo install typeshare-cli --git https://github.com/tomjw64/typeshare.git --branch allow-override-for-disallowed-types + + - if: startsWith(matrix.platform, 'macos') + run: cargo install swift-bridge-cli + + - name: Build Dependencies + run: cargo build --lib --release --no-default-features --workspace --exclude sysmon + env: + RUST_BACKTRACE: full + + - run: npx -y @tauri-apps/cli icon ./assets/svg/logo.svg + working-directory: ./desktop + + - name: Tauri Build ${{ matrix.arch }} + uses: tauri-apps/tauri-action@v0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} + TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} + APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} + APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} + APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} + APPLE_ID: ${{ secrets.APPLE_ID }} + APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} + APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} + # todo-zm: use `assetNamePattern` and remove README.md version update workaround in `./scripts/bump-version.rs` + with: + projectPath: ./desktop + tagName: "v__VERSION__-pr-${{ env.PR_NUMBER }}" + releaseName: "v__VERSION__-pr-${{ env.PR_NUMBER }}" + releaseBody: "See the assets to download this version and install." + releaseDraft: true + prerelease: true + args: --target ${{ matrix.arch }} -- -p sysmon # --verbose + + native-libs-build-upload: + if: contains(github.event.pull_request.labels.*.name, 'preview') + permissions: + contents: write + strategy: + fail-fast: false + matrix: + include: + - platform: macos-latest + arch: aarch64-apple-darwin + crate: lib-swift + - platform: macos-13 + arch: x86_64-apple-darwin + crate: lib-swift + - platform: windows-latest + arch: x86_64-pc-windows-msvc + crate: lib-cpp + - platform: windows-11-arm + arch: aarch64-pc-windows-msvc + crate: lib-cpp + runs-on: ${{ matrix.platform }} + env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: ${{ matrix.platform != 'windows-11-arm' && 'sccache' || '' }} + RUSTFLAGS: -Ctarget-feature=+crt-static + PR_NUMBER: ${{ github.event.pull_request.number }} + + steps: + - uses: actions/checkout@v4 + + - if: startsWith(matrix.platform, 'macos') + uses: swift-actions/setup-swift@next + with: + swift-version: "6.1" + + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + target: ${{ matrix.arch }} + + - if: matrix.platform != 'windows-11-arm' + uses: mozilla-actions/sccache-action@v0.0.9 + + - run: cargo install typeshare-cli --git https://github.com/tomjw64/typeshare.git --branch allow-override-for-disallowed-types + + - if: startsWith(matrix.platform, 'macos') + run: cargo install swift-bridge-cli + + - name: Build ${{ matrix.crate }} binary + run: cargo build --release --bin ${{ matrix.crate }}-cli-${{ matrix.arch }} --target ${{ matrix.arch }} + working-directory: ./${{ matrix.crate }} + env: + RUST_BACKTRACE: full + + - name: Extract version from package.json + shell: bash + run: | + VERSION=$(jq -r '.version' ./desktop/web/package.json) + echo "Extracted version: $VERSION" + echo "VERSION=$VERSION" >> $GITHUB_ENV + + - name: Upload ${{ matrix.crate }} binary to release + uses: softprops/action-gh-release@v2 + with: + tag_name: "v${{ env.VERSION }}-pr-${{ env.PR_NUMBER }}" + draft: true + files: ./target/**/${{ matrix.crate }}-cli* diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 0dfb9a3..3cbdc11 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -1,11 +1,11 @@ -name: "publish a draft release" +name: "CD" on: push: branches: - main concurrency: - group: "publish-draft-release" + group: "cd" cancel-in-progress: true jobs: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f817c50..9ffe077 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,13 +56,13 @@ jobs: # - name: lint todo-zm: bring this back # run: cargo clippy -- -D warnings - name: build - run: cargo build + run: cargo build -p sysmon env: RUST_BACKTRACE: full - name: test # todo-zm: fix swift build issue on old mac: dyld[34620]: Library not loaded: @rpath/libswiftCore.dylib if: matrix.platform != 'macos-13' - run: cargo test + run: cargo test -p sysmon web: strategy: diff --git a/Cargo.lock b/Cargo.lock index df4524c..60204a5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -56,12 +56,56 @@ dependencies = [ "libc", ] +[[package]] +name = "anstream" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ae563653d1938f79b1ab1b5e668c87c76a9930414574a6583a7b7e11a8e6192" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + [[package]] name = "anstyle" version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" +[[package]] +name = "anstyle-parse" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" +dependencies = [ + "windows-sys 0.60.2", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.60.2", +] + [[package]] name = "anyhow" version = "1.0.99" @@ -300,9 +344,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.9.2" +version = "2.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a65b545ab31d687cff52899d4890855fec459eb6afe0da6417b8a18da87aa29" +checksum = "34efbcccd345379ca2868b2b2c9d3782e9cc58ba87bc7d79d5b53d9c9ae6f25d" dependencies = [ "serde", ] @@ -401,7 +445,7 @@ version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.3", "cairo-sys-rs", "glib", "libc", @@ -449,7 +493,7 @@ dependencies = [ "semver", "serde", "serde_json", - "thiserror 2.0.15", + "thiserror 2.0.16", ] [[package]] @@ -464,9 +508,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.33" +version = "1.2.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ee0f8803222ba5a7e2777dd72ca451868909b1ac410621b676adf07280e9b5f" +checksum = "42bc4aea80032b7bf409b0bc7ccad88853858911b7713a8062fdc0623867bedc" dependencies = [ "shlex", ] @@ -500,9 +544,9 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.1" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" +checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" [[package]] name = "cfg_aliases" @@ -532,6 +576,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fc0e74a703892159f5ae7d3aac52c8e6c392f5ae5f359c70b5881d60aaac318" dependencies = [ "clap_builder", + "clap_derive", ] [[package]] @@ -540,11 +585,24 @@ version = "4.5.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3e7f4214277f3c7aa526a59dd3fbe306a370daee1f8b7b8c987069cd8e888a8" dependencies = [ + "anstream", "anstyle", "clap_lex", "strsim", ] +[[package]] +name = "clap_derive" +version = "4.5.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14cb31bb0a7d536caef2639baa7fad459e15c3144efefa6dbd1c84562c4739f6" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.106", +] + [[package]] name = "clap_lex" version = "0.7.5" @@ -562,6 +620,12 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "colorchoice" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" + [[package]] name = "combine" version = "4.6.7" @@ -629,7 +693,7 @@ version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa95a34622365fa5bbf40b20b75dba8dfa8c94c734aea8ac9a5ca38af14316f1" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.3", "core-foundation", "core-graphics-types", "foreign-types", @@ -642,7 +706,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.3", "core-foundation", "libc", ] @@ -749,7 +813,7 @@ checksum = "12d3cbb84fb003242941c231b45ca9417e786e66e94baa39584bd99df3a270b6" dependencies = [ "cc", "codespan-reporting", - "indexmap 2.10.0", + "indexmap 2.11.0", "proc-macro2", "quote", "scratch", @@ -764,7 +828,7 @@ checksum = "3fa36b7b249d43f67a3f54bd65788e35e7afe64bbc671396387a48b3e8aaea94" dependencies = [ "clap", "codespan-reporting", - "indexmap 2.10.0", + "indexmap 2.11.0", "proc-macro2", "quote", "syn 2.0.106", @@ -782,7 +846,7 @@ version = "1.0.168" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ede6c0fb7e318f0a11799b86ee29dcf17b9be2960bd379a6c38e1a96a6010fff" dependencies = [ - "indexmap 2.10.0", + "indexmap 2.11.0", "proc-macro2", "quote", "rustversion", @@ -932,7 +996,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89a09f22a6c6069a18470eb92d2298acf25463f14256d24778e1230d789a2aec" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.3", "objc2 0.6.2", ] @@ -949,9 +1013,9 @@ dependencies = [ [[package]] name = "dlopen2" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1297103d2bbaea85724fcee6294c2d50b1081f9ad47d0f6f6f61eda65315a6" +checksum = "b54f373ccf864bf587a89e880fb7610f8d73f3045f13580948ccbcaff26febff" dependencies = [ "dlopen2_derive", "libc", @@ -1127,14 +1191,14 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.25" +version = "0.2.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +checksum = "bc0505cd1b6fa6580283f6bdf70a73fcf4aba1184038c90902b92b3dd0df63ed" dependencies = [ "cfg-if", "libc", "libredox", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] @@ -1188,9 +1252,9 @@ checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" [[package]] name = "form_urlencoded" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" dependencies = [ "percent-encoding", ] @@ -1490,7 +1554,7 @@ version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "233daaf6e83ae6a12a52055f568f9d7cf4671dabb78ff9560ab6da230ce00ee5" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.3", "futures-channel", "futures-core", "futures-executor", @@ -1690,18 +1754,20 @@ checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "hyper" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" +checksum = "eb3aa54a13a0dfe7fbe3a59e0c76093041720fdc77b110cc0fc260fafb4dc51e" dependencies = [ + "atomic-waker", "bytes", "futures-channel", - "futures-util", + "futures-core", "http", "http-body", "httparse", "itoa", "pin-project-lite", + "pin-utils", "smallvec", "tokio", "want", @@ -1876,9 +1942,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" dependencies = [ "idna_adapter", "smallvec", @@ -1908,9 +1974,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.10.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" +checksum = "f2481980430f9f78649238835720ddccc57e52df14ffce1c6f37391d61b563e9" dependencies = [ "equivalent", "hashbrown 0.15.5", @@ -1928,11 +1994,11 @@ dependencies = [ [[package]] name = "io-uring" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d93587f37623a1a17d94ef2bc9ada592f5465fe7732084ab7beefabe5c77c0c4" +checksum = "046fa2d4d00aea763528b4950358d0ead425372445dc8ff86312b3c69ff7727b" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.3", "cfg-if", "libc", ] @@ -1953,6 +2019,12 @@ dependencies = [ "serde", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + [[package]] name = "itoa" version = "1.0.15" @@ -2042,7 +2114,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b750dcadc39a09dbadd74e118f6dd6598df77fa01df0cfcdc52c28dece74528a" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.3", "serde", "unicode-segmentation", ] @@ -2055,7 +2127,7 @@ checksum = "02cb977175687f33fa4afa0c95c112b987ea1443e5a51c8f8ff27dc618270cc2" dependencies = [ "cssparser", "html5ever", - "indexmap 2.10.0", + "indexmap 2.11.0", "selectors", ] @@ -2081,6 +2153,8 @@ name = "lib-swift" version = "0.1.16" dependencies = [ "anyhow", + "clap", + "clap_derive", "common-types", "swift-bridge", "swift-bridge-build", @@ -2132,7 +2206,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "391290121bad3d37fbddad76d8f5d1c1c314cfc646d143d7e07a3086ddff0ce3" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.3", "libc", "redox_syscall", ] @@ -2282,7 +2356,7 @@ dependencies = [ "once_cell", "png", "serde", - "thiserror 2.0.15", + "thiserror 2.0.16", "windows-sys 0.60.2", ] @@ -2292,7 +2366,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.3", "jni-sys", "log", "ndk-sys", @@ -2328,7 +2402,7 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.3", "cfg-if", "libc", "memoffset", @@ -2409,7 +2483,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6f29f568bec459b0ddff777cec4fe3fd8666d82d5a40ebd0ff7e66134f89bcc" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.3", "block2 0.6.1", "libc", "objc2 0.6.2", @@ -2428,7 +2502,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17614fdcd9b411e6ff1117dfb1d0150f908ba83a7df81b1f118005fe0a8ea15d" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.3", "objc2 0.6.2", "objc2-foundation 0.3.1", ] @@ -2439,7 +2513,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "291fbbf7d29287518e8686417cf7239c74700fd4b607623140a7d4a3c834329d" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.3", "objc2 0.6.2", "objc2-foundation 0.3.1", ] @@ -2450,7 +2524,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c10c2894a6fed806ade6027bcd50662746363a9589d3ec9d9bef30a4e4bc166" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.3", "dispatch2", "objc2 0.6.2", ] @@ -2461,7 +2535,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "989c6c68c13021b5c2d6b71456ebb0f9dc78d752e86a98da7c716f4f9470f5a4" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.3", "dispatch2", "objc2 0.6.2", "objc2-core-foundation", @@ -2499,7 +2573,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.3", "block2 0.5.1", "libc", "objc2 0.5.2", @@ -2511,7 +2585,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "900831247d2fe1a09a683278e5384cfb8c80c79fe6b166f9d14bfdde0ea1b03c" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.3", "block2 0.6.1", "libc", "objc2 0.6.2", @@ -2524,7 +2598,17 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7282e9ac92529fa3457ce90ebb15f4ecbc383e8338060960760fa2cf75420c3c" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.3", + "objc2 0.6.2", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-javascript-core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9052cb1bb50a4c161d934befcf879526fb87ae9a68858f241e693ca46225cf5a" +dependencies = [ "objc2 0.6.2", "objc2-core-foundation", ] @@ -2535,7 +2619,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.3", "block2 0.5.1", "objc2 0.5.2", "objc2-foundation 0.2.2", @@ -2547,7 +2631,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26bb88504b5a050dbba515d2414607bf5e57dd56b107bc5f0351197a3e7bdc5d" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.3", "objc2 0.6.2", "objc2-app-kit", "objc2-foundation 0.3.1", @@ -2559,7 +2643,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.3", "block2 0.5.1", "objc2 0.5.2", "objc2-foundation 0.2.2", @@ -2572,18 +2656,29 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90ffb6a0cd5f182dc964334388560b12a57f7b74b3e2dec5e2722aa2dfb2ccd5" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.3", "objc2 0.6.2", "objc2-foundation 0.3.1", ] +[[package]] +name = "objc2-security" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1f8e0ef3ab66b08c42644dcb34dba6ec0a574bbd8adbb8bdbdc7a2779731a44" +dependencies = [ + "bitflags 2.9.3", + "objc2 0.6.2", + "objc2-core-foundation", +] + [[package]] name = "objc2-ui-kit" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25b1312ad7bc8a0e92adae17aa10f90aae1fb618832f9b993b022b591027daed" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.3", "objc2 0.6.2", "objc2-core-foundation", "objc2-foundation 0.3.1", @@ -2595,12 +2690,14 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91672909de8b1ce1c2252e95bbee8c1649c9ad9d14b9248b3d7b4c47903c47ad" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.3", "block2 0.6.1", "objc2 0.6.2", "objc2-app-kit", "objc2-core-foundation", "objc2-foundation 0.3.1", + "objc2-javascript-core", + "objc2-security", ] [[package]] @@ -2618,6 +2715,12 @@ version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +[[package]] +name = "once_cell_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" + [[package]] name = "option-ext" version = "0.2.0" @@ -2645,7 +2748,7 @@ dependencies = [ "objc2-osa-kit", "serde", "serde_json", - "thiserror 2.0.15", + "thiserror 2.0.16", ] [[package]] @@ -2704,9 +2807,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "phf" @@ -2878,7 +2981,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3af6b589e163c5a788fab00ce0c0366f6efbb9959c2f9874b224936af7fce7e1" dependencies = [ "base64 0.22.1", - "indexmap 2.10.0", + "indexmap 2.11.0", "quick-xml", "serde", "time", @@ -3002,9 +3105,9 @@ dependencies = [ [[package]] name = "quick-xml" -version = "0.38.1" +version = "0.38.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9845d9dccf565065824e69f9f235fafba1587031eda353c1f1561cd6a6be78f4" +checksum = "d200a41a7797e6461bd04e4e95c3347053a731c32c87f066f2f0dda22dbdbba8" dependencies = [ "memchr", ] @@ -3023,7 +3126,7 @@ dependencies = [ "rustc-hash", "rustls", "socket2 0.5.10", - "thiserror 2.0.15", + "thiserror 2.0.16", "tokio", "tracing", "web-time", @@ -3044,7 +3147,7 @@ dependencies = [ "rustls", "rustls-pki-types", "slab", - "thiserror 2.0.15", + "thiserror 2.0.16", "tinyvec", "tracing", "web-time", @@ -3201,7 +3304,7 @@ version = "0.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5407465600fb0548f1442edf71dd20683c6ed326200ace4b1ef0763521bb3b77" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.3", ] [[package]] @@ -3223,7 +3326,7 @@ checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" dependencies = [ "getrandom 0.2.16", "libredox", - "thiserror 2.0.15", + "thiserror 2.0.16", ] [[package]] @@ -3357,7 +3460,7 @@ version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.3", "errno", "libc", "linux-raw-sys", @@ -3554,9 +3657,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.142" +version = "1.0.143" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "030fedb782600dcbd6f02d479bf0d817ac3bb40d644745b769d6a96bc3afc5a7" +checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a" dependencies = [ "itoa", "memchr", @@ -3615,7 +3718,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.10.0", + "indexmap 2.11.0", "schemars 0.9.0", "schemars 1.0.4", "serde", @@ -3639,9 +3742,9 @@ dependencies = [ [[package]] name = "serialize-to-javascript" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9823f2d3b6a81d98228151fdeaf848206a7855a7a042bbf9bf870449a66cafb" +checksum = "04f3666a07a197cdb77cdf306c32be9b7f598d7060d50cfd4d5aa04bfd92f6c5" dependencies = [ "serde", "serde_json", @@ -3650,13 +3753,13 @@ dependencies = [ [[package]] name = "serialize-to-javascript-impl" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74064874e9f6a15f04c1f3cb627902d0e6b410abbf36668afa873c61889f1763" +checksum = "772ee033c0916d670af7860b6e1ef7d658a4629a6d0b4c8c3e67f09b3765b75d" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.106", ] [[package]] @@ -3984,11 +4087,12 @@ dependencies = [ [[package]] name = "tao" -version = "0.34.0" +version = "0.34.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49c380ca75a231b87b6c9dd86948f035012e7171d1a7c40a9c2890489a7ffd8a" +checksum = "4daa814018fecdfb977b59a094df4bd43b42e8e21f88fddfc05807e6f46efaaf" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.3", + "block2 0.6.1", "core-foundation", "core-graphics", "crossbeam-channel", @@ -4051,12 +4155,13 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tauri" -version = "2.7.0" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "352a4bc7bf6c25f5624227e3641adf475a6535707451b09bb83271df8b7a6ac7" +checksum = "a54629607ea3084a8b455c1ebe888cbdfc4de02fa5edb2e40db0dc97091007e3" dependencies = [ "anyhow", "bytes", + "cookie", "dirs 6.0.0", "dunce", "embed_plist", @@ -4074,6 +4179,7 @@ dependencies = [ "objc2-app-kit", "objc2-foundation 0.3.1", "objc2-ui-kit", + "objc2-web-kit", "percent-encoding", "plist", "raw-window-handle", @@ -4088,7 +4194,7 @@ dependencies = [ "tauri-runtime", "tauri-runtime-wry", "tauri-utils", - "thiserror 2.0.15", + "thiserror 2.0.16", "tokio", "tray-icon", "url", @@ -4101,9 +4207,9 @@ dependencies = [ [[package]] name = "tauri-build" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "182d688496c06bf08ea896459bf483eb29cdff35c1c4c115fb14053514303064" +checksum = "67945dbaf8920dbe3a1e56721a419a0c3d085254ab24cff5b9ad55e2b0016e0b" dependencies = [ "anyhow", "cargo_toml", @@ -4117,15 +4223,15 @@ dependencies = [ "serde_json", "tauri-utils", "tauri-winres", - "toml 0.8.2", + "toml 0.9.5", "walkdir", ] [[package]] name = "tauri-codegen" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b54a99a6cd8e01abcfa61508177e6096a4fe2681efecee9214e962f2f073ae4a" +checksum = "1ab3a62cf2e6253936a8b267c2e95839674e7439f104fa96ad0025e149d54d8a" dependencies = [ "base64 0.22.1", "brotli", @@ -4141,7 +4247,7 @@ dependencies = [ "sha2", "syn 2.0.106", "tauri-utils", - "thiserror 2.0.15", + "thiserror 2.0.16", "time", "url", "uuid", @@ -4150,9 +4256,9 @@ dependencies = [ [[package]] name = "tauri-macros" -version = "2.3.2" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7945b14dc45e23532f2ded6e120170bbdd4af5ceaa45784a6b33d250fbce3f9e" +checksum = "4368ea8094e7045217edb690f493b55b30caf9f3e61f79b4c24b6db91f07995e" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -4164,9 +4270,9 @@ dependencies = [ [[package]] name = "tauri-plugin" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bd5c1e56990c70a906ef67a9851bbdba9136d26075ee9a2b19c8b46986b3e02" +checksum = "9946a3cede302eac0c6eb6c6070ac47b1768e326092d32efbb91f21ed58d978f" dependencies = [ "anyhow", "glob", @@ -4175,7 +4281,7 @@ dependencies = [ "serde", "serde_json", "tauri-utils", - "toml 0.8.2", + "toml 0.9.5", "walkdir", ] @@ -4190,7 +4296,7 @@ dependencies = [ "serde_json", "tauri", "tauri-plugin", - "thiserror 2.0.15", + "thiserror 2.0.16", ] [[package]] @@ -4202,7 +4308,7 @@ dependencies = [ "serde", "serde_json", "tauri", - "thiserror 2.0.15", + "thiserror 2.0.16", "tracing", "windows-sys 0.59.0", "zbus", @@ -4232,7 +4338,7 @@ dependencies = [ "tauri", "tauri-plugin", "tempfile", - "thiserror 2.0.15", + "thiserror 2.0.16", "time", "tokio", "url", @@ -4242,9 +4348,9 @@ dependencies = [ [[package]] name = "tauri-runtime" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b1cc885be806ea15ff7b0eb47098a7b16323d9228876afda329e34e2d6c4676" +checksum = "d4cfc9ad45b487d3fded5a4731a567872a4812e9552e3964161b08edabf93846" dependencies = [ "cookie", "dpi", @@ -4253,20 +4359,23 @@ dependencies = [ "jni", "objc2 0.6.2", "objc2-ui-kit", + "objc2-web-kit", "raw-window-handle", "serde", "serde_json", "tauri-utils", - "thiserror 2.0.15", + "thiserror 2.0.16", "url", + "webkit2gtk", + "webview2-com", "windows", ] [[package]] name = "tauri-runtime-wry" -version = "2.7.2" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe653a2fbbef19fe898efc774bc52c8742576342a33d3d028c189b57eb1d2439" +checksum = "5bb0f10f831f75832ac74d14d98f701868f9a8adccef2c249b466cf70b607db9" dependencies = [ "gtk", "http", @@ -4291,9 +4400,9 @@ dependencies = [ [[package]] name = "tauri-utils" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9330c15cabfe1d9f213478c9e8ec2b0c76dab26bb6f314b8ad1c8a568c1d186e" +checksum = "41a3852fdf9a4f8fbeaa63dc3e9a85284dd6ef7200751f0bd66ceee30c93f212" dependencies = [ "anyhow", "brotli", @@ -4319,8 +4428,8 @@ dependencies = [ "serde_json", "serde_with", "swift-rs", - "thiserror 2.0.15", - "toml 0.8.2", + "thiserror 2.0.16", + "toml 0.9.5", "url", "urlpattern", "uuid", @@ -4339,15 +4448,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.20.0" +version = "3.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" +checksum = "15b61f8f20e3a6f7e0649d825294eaf317edce30f82cf6026e7e4cb9222a7d1e" dependencies = [ "fastrand", "getrandom 0.3.3", "once_cell", "rustix", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] @@ -4381,11 +4490,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.15" +version = "2.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d76d3f064b981389ecb4b6b7f45a0bf9fdac1d5b9204c7bd6714fecc302850" +checksum = "3467d614147380f2e4e374161426ff399c91084acd2363eaf549172b3d5e60c0" dependencies = [ - "thiserror-impl 2.0.15", + "thiserror-impl 2.0.16", ] [[package]] @@ -4401,9 +4510,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.15" +version = "2.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d29feb33e986b6ea906bd9c3559a856983f92371b3eaa5e83782a351623de0" +checksum = "6c5e1be1c48b9172ee610da68fd9cd2770e7a4056cb3fc98710ee6906f0c7960" dependencies = [ "proc-macro2", "quote", @@ -4453,9 +4562,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" +checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" dependencies = [ "tinyvec_macros", ] @@ -4538,13 +4647,13 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75129e1dc5000bfbaa9fee9d1b21f974f9fbad9daec557a521ee6e080825f6e8" dependencies = [ - "indexmap 2.10.0", + "indexmap 2.11.0", "serde", "serde_spanned 1.0.0", "toml_datetime 0.7.0", "toml_parser", "toml_writer", - "winnow 0.7.12", + "winnow 0.7.13", ] [[package]] @@ -4571,7 +4680,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.10.0", + "indexmap 2.11.0", "toml_datetime 0.6.3", "winnow 0.5.40", ] @@ -4582,7 +4691,7 @@ version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ - "indexmap 2.10.0", + "indexmap 2.11.0", "serde", "serde_spanned 0.6.9", "toml_datetime 0.6.3", @@ -4595,7 +4704,7 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b551886f449aa90d4fe2bdaa9f4a2577ad2dde302c61ecf262d80b116db95c10" dependencies = [ - "winnow 0.7.12", + "winnow 0.7.13", ] [[package]] @@ -4625,7 +4734,7 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.3", "bytes", "futures-util", "http", @@ -4698,7 +4807,7 @@ dependencies = [ "once_cell", "png", "serde", - "thiserror 2.0.15", + "thiserror 2.0.16", "windows-sys 0.59.0", ] @@ -4818,9 +4927,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.4" +version = "2.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +checksum = "137a3c834eaf7139b73688502f3f1141a0337c5d8e4d9b536f9b8c796e26a7c4" dependencies = [ "form_urlencoded", "idna", @@ -4852,6 +4961,12 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + [[package]] name = "uuid" version = "1.18.0" @@ -5124,7 +5239,7 @@ version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "36695906a1b53a3bf5c4289621efedac12b73eeb0b89e7e1a89b517302d5d75c" dependencies = [ - "thiserror 2.0.15", + "thiserror 2.0.16", "windows", "windows-core", ] @@ -5147,11 +5262,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +checksum = "0978bf7171b3d90bac376700cb56d606feb40f251a475a5d6634613564460b22" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] @@ -5528,9 +5643,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.7.12" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3edebf492c8125044983378ecb5766203ad3b4c2f7a922bd7dd207f6d443e95" +checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" [[package]] name = "winreg" @@ -5557,7 +5672,7 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" dependencies = [ - "bitflags 2.9.2", + "bitflags 2.9.3", ] [[package]] @@ -5568,14 +5683,15 @@ checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" [[package]] name = "wry" -version = "0.52.1" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12a714d9ba7075aae04a6e50229d6109e3d584774b99a6a8c60de1698ca111b9" +checksum = "5698e50a589268aec06d2219f48b143222f7b5ad9aa690118b8dce0a8dcac574" dependencies = [ "base64 0.22.1", "block2 0.6.1", "cookie", "crossbeam-channel", + "dirs 6.0.0", "dpi", "dunce", "gdkx11", @@ -5599,7 +5715,7 @@ dependencies = [ "sha2", "soup3", "tao-macros", - "thiserror 2.0.15", + "thiserror 2.0.16", "url", "webkit2gtk", "webkit2gtk-sys", @@ -5821,13 +5937,13 @@ dependencies = [ [[package]] name = "zip" -version = "4.3.0" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aed4ac33e8eb078c89e6cbb1d5c4c7703ec6d299fc3e7c3695af8f8b423468b" +checksum = "8835eb39822904d39cb19465de1159e05d371973f0c6df3a365ad50565ddc8b9" dependencies = [ "arbitrary", "crc32fast", - "indexmap 2.10.0", + "indexmap 2.11.0", "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index 51c46b7..41f3fc4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,15 +10,14 @@ package.repository = "https://github.com/ZibanPirate/sysmon" package.version = "0.1.16" package.publish = false - [workspace.dependencies] serde = { version = "1", features = ["derive"] } serde_json = "1" anyhow = "1" tokio = { version = "1", features = ["full"] } common-types = { path = "./common-types" } -lib-swift = { path = "./lib-swift" } -lib-cpp = { path = "./lib-cpp" } +lib-swift = { path = "./lib-swift", default-features = false } +lib-cpp = { path = "./lib-cpp", default-features = false } # todo-zm: switch to upstream once https://github.com/1Password/typeshare/pull/140 is merged typeshare = { git = "https://github.com/tomjw64/typeshare", branch = "allow-override-for-disallowed-types" } tauri = { version = "2", default-features = false } diff --git a/desktop/tauri.conf.json b/desktop/tauri.conf.json index 75df871..797973f 100644 --- a/desktop/tauri.conf.json +++ b/desktop/tauri.conf.json @@ -32,7 +32,10 @@ "icons/128x128@2x.png", "icons/icon.icns", "icons/icon.ico" - ] + ], + "macOS": { + "minimumSystemVersion": "10.15.0" + } }, "plugins": { "updater": { diff --git a/lib-cpp/Cargo.toml b/lib-cpp/Cargo.toml index 7a504f3..171fe76 100644 --- a/lib-cpp/Cargo.toml +++ b/lib-cpp/Cargo.toml @@ -8,6 +8,14 @@ repository.workspace = true version.workspace = true publish.workspace = true +[[bin]] +path = "src/main.rs" +name = "lib-cpp-cli-x86_64-pc-windows-msvc" + +[[bin]] +path = "src/main.rs" +name = "lib-cpp-cli-aarch64-pc-windows-msvc" + [dependencies] cxx = "1" common-types = { workspace = true } diff --git a/lib-cpp/src/main.rs b/lib-cpp/src/main.rs new file mode 100644 index 0000000..c89b901 --- /dev/null +++ b/lib-cpp/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + todo!(); +} diff --git a/lib-swift/Cargo.toml b/lib-swift/Cargo.toml index df67661..8a88b60 100644 --- a/lib-swift/Cargo.toml +++ b/lib-swift/Cargo.toml @@ -8,10 +8,25 @@ repository.workspace = true version.workspace = true publish.workspace = true +[[bin]] +path = "src/main.rs" +name = "lib-swift-cli-aarch64-apple-darwin" + +[[bin]] +path = "src/main.rs" +name = "lib-swift-cli-x86_64-apple-darwin" + [dependencies] swift-bridge = "0.1" common-types = { workspace = true } anyhow = { workspace = true } +# todo-zm: move this two to workspace level +clap = { version = "4", features = ["derive"], optional = true } +clap_derive = { version = "4", optional = true } [build-dependencies] swift-bridge-build = "0.1" + +[features] +default = ["lib-cli"] +lib-cli = ["clap", "clap_derive"] diff --git a/lib-swift/src/main.rs b/lib-swift/src/main.rs new file mode 100644 index 0000000..a6fe019 --- /dev/null +++ b/lib-swift/src/main.rs @@ -0,0 +1,34 @@ +use clap::{Parser, Subcommand}; + +#[derive(Parser)] +#[command(name = "lib-swift")] +#[command(about = "A CLI tool to test native macOS code")] +struct Cli { + #[command(subcommand)] + command: Commands, +} + +#[derive(Subcommand)] +enum Commands { + /// Get screen information + ScreenInfo, + /// Get network information + NetworkInfo, +} + +fn main() { + let cli = Cli::parse(); + + match cli.command { + Commands::ScreenInfo => { + println!("=== Screen Info ==="); + let screen_info = lib_swift::get_screen_info(); + println!("Screen Info: {:#?}", screen_info); + } + Commands::NetworkInfo => { + println!("=== Network Info ==="); + let network_info = lib_swift::get_network_info(); + println!("Network Info: {:#?}", network_info); + } + } +} diff --git a/lib-swift/swift/Package.swift b/lib-swift/swift/Package.swift index 297449b..575510e 100644 --- a/lib-swift/swift/Package.swift +++ b/lib-swift/swift/Package.swift @@ -5,6 +5,9 @@ import PackageDescription let package = Package( name: "lib-rust", + platforms: [ + .macOS(.v10_15) + ], products: [ .library( name: "rust", @@ -13,6 +16,9 @@ let package = Package( ], targets: [ .target( - name: "lib-rust") - ] + name: "lib-rust", + swiftSettings: [ + .define("SWIFT_PACKAGE_ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES") + ]) + ], ) diff --git a/lib-swift/swift/Sources/lib-rust/NetworkInfo.swift b/lib-swift/swift/Sources/lib-rust/NetworkInfo.swift index b8abe89..1803b65 100644 --- a/lib-swift/swift/Sources/lib-rust/NetworkInfo.swift +++ b/lib-swift/swift/Sources/lib-rust/NetworkInfo.swift @@ -1,5 +1,4 @@ import AppKit -import Darwin import Foundation func getNetworkStatistics() -> (totalSent: UInt64, totalReceived: UInt64) { diff --git a/lib-swift/swift/Sources/lib-rust/ObserveScreenInfo.swift b/lib-swift/swift/Sources/lib-rust/ObserveScreenInfo.swift index 1373a2b..4cf65e6 100644 --- a/lib-swift/swift/Sources/lib-rust/ObserveScreenInfo.swift +++ b/lib-swift/swift/Sources/lib-rust/ObserveScreenInfo.swift @@ -1,5 +1,4 @@ import AppKit -import Cocoa import Foundation public class ScreenChangeObserver {