@ -0,0 +1,11 @@
|
||||
[advisories]
|
||||
ignore = [
|
||||
# time 0.1
|
||||
"RUSTSEC-2020-0071",
|
||||
# needs sqlx 0.7 (still in alpha)
|
||||
"RUSTSEC-2022-0090",
|
||||
# wry needs kuchiki on Android
|
||||
"RUSTSEC-2023-0019",
|
||||
# atty is only used when the `colored` feature is enabled on tauri-plugin-log
|
||||
"RUSTSEC-2021-0145"
|
||||
]
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
"notification": patch
|
||||
---
|
||||
|
||||
Use `window.__TAURI_INVOKE__` instead of `window.__TAURI__` in init.js, fixes usage in apps without `withGlobalTauri` enabled.
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
"notification": patch
|
||||
---
|
||||
|
||||
Play a default sound when showing a notification on Windows.
|
@ -0,0 +1,11 @@
|
||||
---
|
||||
"os": minor
|
||||
"os-js": minor
|
||||
---
|
||||
|
||||
The os plugin is recieving a few changes to improve consistency and add new features:
|
||||
|
||||
- Renamed `Kind` enum to `OsType` and `kind()` function to `os_type()`.
|
||||
- Added `family()`,`exe_extension()`, and `hostname()` functions and their equivalents for JS.
|
||||
- Removed `tempdir()` function and its equivalent on JS, use `std::env::temp_dir` instead of `temp_dir` from `tauri::path::PathResolver::temp_dir` and `path.tempDir` on JS.
|
||||
- Modified `platform()` implementation to return `windows` instead of `win32` and `macos` instead of `darwin` to align with Rust's `std::env::consts::OS`
|
@ -1,5 +0,0 @@
|
||||
---
|
||||
persisted-scope: patch
|
||||
---
|
||||
|
||||
Recursively unescape saved patterns before allowing/forbidding them. This effectively prevents `.persisted-scope` files from blowing up, which caused Out-Of-Memory issues, while automatically fixing existing broken files seamlessly.
|
@ -0,0 +1,9 @@
|
||||
{
|
||||
"tag": "alpha",
|
||||
"changes": [
|
||||
".changes/notification-init-script.md",
|
||||
".changes/notification-sound.md",
|
||||
".changes/stronghold-constructor.md",
|
||||
".changes/v2-alpha.md"
|
||||
]
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
"stronghold-js": minor
|
||||
---
|
||||
|
||||
Added `Stronghold.load` and removed its constructor.
|
@ -0,0 +1,53 @@
|
||||
---
|
||||
"app": major
|
||||
"app-js": major
|
||||
"authenticator": major
|
||||
"authenticator-js": major
|
||||
"autostart": major
|
||||
"autostart-js": major
|
||||
"cli": major
|
||||
"cli-js": major
|
||||
"clipboard-manager": major
|
||||
"clipboard-manager-js": major
|
||||
"dialog": major
|
||||
"dialog-js": major
|
||||
"fs": major
|
||||
"fs-js": major
|
||||
"global-shortcut": major
|
||||
"global-shortcut-js": major
|
||||
"http": major
|
||||
"http-js": major
|
||||
"localhost": major
|
||||
"log-plugin": major
|
||||
"log-js": major
|
||||
"notification": major
|
||||
"notification-js": major
|
||||
"os": major
|
||||
"os-js": major
|
||||
"persisted-scope": major
|
||||
"positioner": major
|
||||
"positioner-js": major
|
||||
"process": major
|
||||
"process-js": major
|
||||
"shell": major
|
||||
"shell-js": major
|
||||
"single-instance": major
|
||||
"sql": major
|
||||
"sql-js": major
|
||||
"store": major
|
||||
"store-js": major
|
||||
"stronghold": major
|
||||
"stronghold-js": major
|
||||
"updater": major
|
||||
"updater-js": major
|
||||
"upload": major
|
||||
"upload-js": major
|
||||
"websocket": major
|
||||
"websocket-js": major
|
||||
"window": major
|
||||
"window-js": major
|
||||
"window-state": major
|
||||
"window-state-js": major
|
||||
---
|
||||
|
||||
First v2 alpha release!
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
"window-state": "patch"
|
||||
---
|
||||
|
||||
Correctly set decoration state if no saved state xists
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
"window-state-js": "patch"
|
||||
---
|
||||
|
||||
Correctly propagate the promise inside `saveWindowState`, `restoreState` and `restoreStateCurrent` so callers can choose to `await` them.
|
@ -0,0 +1,155 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: check generated files
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- ".github/workflows/check-generated-files.yml"
|
||||
- "**/guest-js/**"
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
packages: ${{ steps.filter.outputs.changes }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: dorny/paths-filter@v2
|
||||
id: filter
|
||||
with:
|
||||
filters: |
|
||||
app:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- plugins/app/guest-js/**
|
||||
- plugins/app/src/api-iife.js
|
||||
authenticator:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- plugins/authenticator/guest-js/**
|
||||
- plugins/authenticator/src/api-iife.js
|
||||
autostart:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- plugins/autostart/guest-js/**
|
||||
- plugins/autostart/src/api-iife.js
|
||||
cli:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- plugins/cli/guest-js/**
|
||||
- plugins/cli/src/api-iife.js
|
||||
clipboard-manager:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- plugins/clipboard-manager/guest-js/**
|
||||
- plugins/clipboard-manager/src/api-iife.js
|
||||
dialog:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- plugins/dialog/guest-js/**
|
||||
- plugins/dialog/src/api-iife.js
|
||||
fs:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- plugins/fs/guest-js/**
|
||||
- plugins/fs/src/api-iife.js
|
||||
global-shortcut:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- plugins/global-shortcut/guest-js/**
|
||||
- plugins/global-shortcut/src/api-iife.js
|
||||
http:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- plugins/http/guest-js/**
|
||||
- plugins/http/src/api-iife.js
|
||||
log:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- plugins/log/guest-js/**
|
||||
- plugins/log/src/api-iife.js
|
||||
notification:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- plugins/notification/guest-js/**
|
||||
- plugins/notification/src/api-iife.js
|
||||
os:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- plugins/os/guest-js/**
|
||||
- plugins/os/src/api-iife.js
|
||||
positioner:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- plugins/positioner/guest-js/**
|
||||
- plugins/positioner/src/api-iife.js
|
||||
process:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- plugins/process/guest-js/**
|
||||
- plugins/process/src/api-iife.js
|
||||
shell:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- plugins/shell/guest-js/**
|
||||
- plugins/shell/src/api-iife.js
|
||||
sql:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- plugins/sql/guest-js/**
|
||||
- plugins/sql/src/api-iife.js
|
||||
store:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- plugins/store/guest-js/**
|
||||
- plugins/store/src/api-iife.js
|
||||
stronghold:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- plugins/stronghold/guest-js/**
|
||||
- plugins/stronghold/src/api-iife.js
|
||||
updater:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- plugins/updater/guest-js/**
|
||||
- plugins/updater/src/api-iife.js
|
||||
upload:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- plugins/upload/guest-js/**
|
||||
- plugins/upload/src/api-iife.js
|
||||
websocket:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- plugins/websocket/guest-js/**
|
||||
- plugins/websocket/src/api-iife.js
|
||||
window:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- plugins/window/guest-js/**
|
||||
- plugins/window/src/api-iife.js
|
||||
window-state:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- plugins/window-state/guest-js/**
|
||||
- plugins/window-state/src/api-iife.js
|
||||
|
||||
test:
|
||||
needs: changes
|
||||
if: ${{ needs.changes.outputs.packages != '[]' && needs.changes.outputs.packages != '' }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
package: ${{ fromJSON(needs.changes.outputs.packages) }}
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Cache pnpm modules
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
- uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 7.x.x
|
||||
run_install: true
|
||||
|
||||
- name: build api
|
||||
working-directory: plugins/${{ matrix.package }}
|
||||
run: pnpm install && pnpm build
|
||||
|
||||
- name: check diff
|
||||
run: |
|
||||
./.scripts/ci/has-diff.sh
|
@ -0,0 +1,28 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: check license header
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: dorny/paths-filter@v2
|
||||
id: filter
|
||||
with:
|
||||
list-files: shell
|
||||
filters: |
|
||||
added:
|
||||
- added: '**'
|
||||
- name: check header license on new files
|
||||
if: ${{ steps.filter.outputs.added == 'true' }}
|
||||
run: node .scripts/ci/check-license-header.js ${{ steps.filter.outputs.added_files }}
|
@ -0,0 +1,68 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: version or publish
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- v2
|
||||
|
||||
jobs:
|
||||
version-or-publish:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 65
|
||||
outputs:
|
||||
change: ${{ steps.covector.outputs.change }}
|
||||
commandRan: ${{ steps.covector.outputs.commandRan }}
|
||||
successfulPublish: ${{ steps.covector.outputs.successfulPublish }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0 # required for use of git history
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "lts/*"
|
||||
registry-url: "https://registry.npmjs.org"
|
||||
|
||||
- uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 7.x.x
|
||||
run_install: true
|
||||
|
||||
- name: install webkit2gtk and libudev for [authenticator]
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libudev-dev
|
||||
|
||||
- name: cargo login
|
||||
run: cargo login ${{ secrets.ORG_CRATES_IO_TOKEN }}
|
||||
|
||||
- name: git config
|
||||
run: |
|
||||
git config --global user.name "${{ github.event.pusher.name }}"
|
||||
git config --global user.email "${{ github.event.pusher.email }}"
|
||||
|
||||
- name: covector version or publish (publish when no change files present)
|
||||
uses: jbolda/covector/packages/action@covector-v0
|
||||
id: covector
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }}
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
command: "version-or-publish"
|
||||
createRelease: true
|
||||
|
||||
- name: Create Pull Request With Versions Bumped
|
||||
id: cpr
|
||||
uses: tauri-apps/create-pull-request@v3
|
||||
if: steps.covector.outputs.commandRan == 'version'
|
||||
with:
|
||||
title: "Publish New Versions (v2)"
|
||||
commit-message: "publish new versions"
|
||||
labels: "version updates"
|
||||
branch: "release-v2"
|
||||
body: ${{ steps.covector.outputs.change }}
|
@ -1,55 +0,0 @@
|
||||
name: Check MSRV
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- v1
|
||||
- v2
|
||||
paths:
|
||||
- ".github/workflows/msrv-check.yml"
|
||||
- "plugins/*/src/**"
|
||||
- "**/Cargo.toml"
|
||||
- "**/Cargo.lock"
|
||||
pull_request:
|
||||
branches:
|
||||
- v1
|
||||
- v2
|
||||
paths:
|
||||
- ".github/workflows/msrv-check.yml"
|
||||
- "plugins/*/src/**"
|
||||
- "**/Cargo.toml"
|
||||
- "**/Cargo.lock"
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
msrv:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: install webkit2gtk and libudev for [authenticator]
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libudev-dev
|
||||
|
||||
- uses: dtolnay/rust-toolchain@1.64.0
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: build
|
||||
run: cargo build --workspace --exclude 'tauri-plugin-sql' --all-targets --all-features
|
||||
|
||||
- name: build sql:sqlite
|
||||
run: cargo build --package 'tauri-plugin-sql' --all-targets --features sqlite
|
||||
|
||||
- name: build sql:mysql
|
||||
run: cargo build --package 'tauri-plugin-sql' --all-targets --features mysql
|
||||
|
||||
- name: build sql:postgres
|
||||
run: cargo build --package 'tauri-plugin-sql' --all-targets --features postgres
|
@ -0,0 +1,226 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: Test Rust
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- v1
|
||||
- v2
|
||||
paths:
|
||||
- ".github/workflows/test-rust.yml"
|
||||
- "plugins/*/src/**"
|
||||
- "!plugins/*/src/api-iife.js"
|
||||
- "**/Cargo.toml"
|
||||
- "**/Cargo.lock"
|
||||
pull_request:
|
||||
branches:
|
||||
- v1
|
||||
- v2
|
||||
paths:
|
||||
- ".github/workflows/test-rust.yml"
|
||||
- "plugins/*/src/**"
|
||||
- "!plugins/*/src/api-iife.js"
|
||||
- "**/Cargo.toml"
|
||||
- "**/Cargo.lock"
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: read
|
||||
outputs:
|
||||
packages: ${{ steps.filter.outputs.changes }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: dorny/paths-filter@v2
|
||||
id: filter
|
||||
with:
|
||||
filters: |
|
||||
tauri-plugin-app:
|
||||
- .github/workflows/test-rust.yml
|
||||
- plugins/app/**
|
||||
tauri-plugin-authenticator:
|
||||
- .github/workflows/test-rust.yml
|
||||
- plugins/authenticator/**
|
||||
tauri-plugin-autostart:
|
||||
- .github/workflows/test-rust.yml
|
||||
- plugins/autostart/**
|
||||
tauri-plugin-cli:
|
||||
- .github/workflows/test-rust.yml
|
||||
- plugins/cli/**
|
||||
tauri-plugin-clipboard-manager:
|
||||
- .github/workflows/test-rust.yml
|
||||
- plugins/clipboard-manager/**
|
||||
tauri-plugin-dialog:
|
||||
- .github/workflows/test-rust.yml
|
||||
- plugins/dialog/**
|
||||
- plugins/fs/**
|
||||
tauri-plugin-fs:
|
||||
- .github/workflows/test-rust.yml
|
||||
- plugins/fs/**
|
||||
tauri-plugin-global-shortcut:
|
||||
- .github/workflows/test-rust.yml
|
||||
- plugins/global-shortcut/**
|
||||
tauri-plugin-http:
|
||||
- .github/workflows/test-rust.yml
|
||||
- plugins/http/**
|
||||
- plugins/fs/**
|
||||
tauri-plugin-localhost:
|
||||
- .github/workflows/test-rust.yml
|
||||
- plugins/localhost/**
|
||||
tauri-plugin-log:
|
||||
- .github/workflows/test-rust.yml
|
||||
- plugins/log/**
|
||||
tauri-plugin-notification:
|
||||
- .github/workflows/test-rust.yml
|
||||
- plugins/notification/**
|
||||
tauri-plugin-os:
|
||||
- .github/workflows/test-rust.yml
|
||||
- plugins/os/**
|
||||
tauri-plugin-persisted-scope:
|
||||
- .github/workflows/test-rust.yml
|
||||
- plugins/persisted-scope/**
|
||||
- plugins/fs/**
|
||||
tauri-plugin-positioner:
|
||||
- .github/workflows/test-rust.yml
|
||||
- plugins/positioner/**
|
||||
tauri-plugin-process:
|
||||
- .github/workflows/test-rust.yml
|
||||
- plugins/process/**
|
||||
tauri-plugin-shell:
|
||||
- .github/workflows/test-rust.yml
|
||||
- plugins/shell/**
|
||||
tauri-plugin-single-instance:
|
||||
- .github/workflows/test-rust.yml
|
||||
- plugins/single-instance/**
|
||||
tauri-plugin-sql:
|
||||
- .github/workflows/test-rust.yml
|
||||
- plugins/sql/**
|
||||
tauri-plugin-store:
|
||||
- .github/workflows/test-rust.yml
|
||||
- plugins/store/**
|
||||
tauri-plugin-stronghold:
|
||||
- .github/workflows/test-rust.yml
|
||||
- plugins/stronghold/**
|
||||
tauri-plugin-updater:
|
||||
- .github/workflows/test-rust.yml
|
||||
- plugins/updater/**
|
||||
tauri-plugin-upload:
|
||||
- .github/workflows/test-rust.yml
|
||||
- plugins/upload/**
|
||||
tauri-plugin-websocket:
|
||||
- .github/workflows/test-rust.yml
|
||||
- plugins/websocket/**
|
||||
tauri-plugin-window:
|
||||
- .github/workflows/test-rust.yml
|
||||
- plugins/window/**
|
||||
tauri-plugin-window-state:
|
||||
- .github/workflows/test-rust.yml
|
||||
- plugins/window-state/**
|
||||
|
||||
test:
|
||||
needs: changes
|
||||
if: ${{ needs.changes.outputs.packages != '[]' && needs.changes.outputs.packages != '' }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
package: ${{ fromJSON(needs.changes.outputs.packages) }}
|
||||
platform:
|
||||
- {
|
||||
target: x86_64-pc-windows-msvc,
|
||||
os: windows-latest,
|
||||
cross: false,
|
||||
command: "test",
|
||||
}
|
||||
- {
|
||||
target: x86_64-unknown-linux-gnu,
|
||||
os: ubuntu-latest,
|
||||
cross: false,
|
||||
command: "test",
|
||||
}
|
||||
- {
|
||||
target: x86_64-apple-darwin,
|
||||
os: macos-latest,
|
||||
cross: false,
|
||||
command: "test",
|
||||
}
|
||||
- {
|
||||
target: aarch64-apple-ios,
|
||||
os: macos-latest,
|
||||
cross: false,
|
||||
command: "build",
|
||||
}
|
||||
- {
|
||||
target: aarch64-linux-android,
|
||||
os: ubuntu-latest,
|
||||
cross: true,
|
||||
command: "build",
|
||||
}
|
||||
|
||||
runs-on: ${{ matrix.platform.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: install webkit2gtk and libudev for [authenticator]
|
||||
if: contains(matrix.platform.target, 'unknown-linux')
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libudev-dev
|
||||
|
||||
- name: install openssl
|
||||
if: ${{ matrix.platform.os == 'windows-latest' && matrix.package == 'tauri-plugin-authenticator' }}
|
||||
run: |
|
||||
echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
|
||||
vcpkg install openssl:x64-windows-static-md
|
||||
|
||||
- uses: dtolnay/rust-toolchain@1.65.0
|
||||
with:
|
||||
targets: ${{ matrix.platform.target }}
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
key: ${{ matrix.package }}
|
||||
|
||||
- name: create dummy dist
|
||||
working-directory: examples/api
|
||||
run: mkdir dist
|
||||
|
||||
- name: test ${{ matrix.package }}
|
||||
if: matrix.package != 'tauri-plugin-sql'
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
use-cross: ${{ matrix.platform.cross }}
|
||||
command: ${{ matrix.platform.command }}
|
||||
args: --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets
|
||||
|
||||
- name: test ${{ matrix.package }} --all-features
|
||||
if: ${{ !contains(fromJSON('["tauri-plugin-http", "tauri-plugin-upload", "tauri-plugin-updater", "tauri-plugin-websocket", "tauri-plugin-sql"]'), matrix.package) }}
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
use-cross: ${{ matrix.platform.cross }}
|
||||
command: ${{ matrix.platform.command }}
|
||||
args: --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets --all-features
|
||||
|
||||
- name: test ${{ matrix.package }} mysql
|
||||
if: matrix.package == 'tauri-plugin-sql'
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
use-cross: ${{ matrix.platform.cross }}
|
||||
command: ${{ matrix.platform.command }}
|
||||
args: --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets --features mysql
|
||||
|
||||
- name: test ${{ matrix.package }} postgres
|
||||
if: matrix.package == 'tauri-plugin-sql'
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
use-cross: ${{ matrix.platform.cross }}
|
||||
command: ${{ matrix.platform.command }}
|
||||
args: --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets --features postgres
|
@ -1,5 +1,8 @@
|
||||
target
|
||||
node_modules
|
||||
dist
|
||||
dist-js
|
||||
pnpm-lock.yaml
|
||||
Cargo.lock
|
||||
Cargo.lock
|
||||
.build
|
||||
api-iife.js
|
@ -0,0 +1,121 @@
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
import readline from "readline";
|
||||
|
||||
const header = `Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
SPDX-License-Identifier: MIT`;
|
||||
const ignoredLicense = "// Copyright 2021 Jonas Kruckenberg";
|
||||
|
||||
const extensions = [".rs", ".js", ".ts", ".yml", ".swift", ".kt"];
|
||||
const ignore = [
|
||||
"target",
|
||||
"templates",
|
||||
"node_modules",
|
||||
"gen",
|
||||
"dist",
|
||||
"dist-js",
|
||||
".svelte-kit",
|
||||
"api-iife.js",
|
||||
];
|
||||
|
||||
async function checkFile(file) {
|
||||
if (
|
||||
extensions.some((e) => file.endsWith(e)) &&
|
||||
!ignore.some((i) => file.endsWith(i))
|
||||
) {
|
||||
const fileStream = fs.createReadStream(file);
|
||||
const rl = readline.createInterface({
|
||||
input: fileStream,
|
||||
crlfDelay: Infinity,
|
||||
});
|
||||
|
||||
let contents = ``;
|
||||
let i = 0;
|
||||
for await (let line of rl) {
|
||||
// ignore empty lines, allow shebang, swift-tools-version and bundler license
|
||||
if (
|
||||
line.length === 0 ||
|
||||
line.startsWith("#!") ||
|
||||
line.startsWith("// swift-tools-version:") ||
|
||||
line === ignoredLicense
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// strip comment marker
|
||||
if (line.startsWith("// ")) {
|
||||
line = line.substring(3);
|
||||
} else if (line.startsWith("# ")) {
|
||||
line = line.substring(2);
|
||||
}
|
||||
|
||||
contents += line;
|
||||
if (++i === 3) {
|
||||
break;
|
||||
}
|
||||
contents += "\n";
|
||||
}
|
||||
if (contents !== header) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
async function check(src) {
|
||||
const missingHeader = [];
|
||||
|
||||
for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
|
||||
const p = path.join(src, entry.name);
|
||||
|
||||
if (entry.isSymbolicLink() || ignore.includes(entry.name)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (entry.isDirectory()) {
|
||||
const missing = await check(p);
|
||||
missingHeader.push(...missing);
|
||||
} else {
|
||||
const isMissing = await checkFile(p);
|
||||
if (isMissing) {
|
||||
missingHeader.push(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return missingHeader;
|
||||
}
|
||||
|
||||
const [_bin, _script, ...files] = process.argv;
|
||||
|
||||
if (files.length > 0) {
|
||||
async function run() {
|
||||
const missing = [];
|
||||
for (const f of files) {
|
||||
const isMissing = await checkFile(f);
|
||||
if (isMissing) {
|
||||
missing.push(f);
|
||||
}
|
||||
}
|
||||
if (missing.length > 0) {
|
||||
console.log(missing.join("\n"));
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
} else {
|
||||
check(path.resolve(new URL(import.meta.url).pathname, "../../..")).then(
|
||||
(missing) => {
|
||||
if (missing.length > 0) {
|
||||
console.log(missing.join("\n"));
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
if git diff --quiet --ignore-submodules HEAD
|
||||
then
|
||||
echo "working directory is clean"
|
||||
else
|
||||
echo "found diff"
|
||||
exit 1
|
||||
fi
|
@ -1,21 +1,19 @@
|
||||
## Plugins Found Here
|
||||
|
||||
| | | Win | Mac | Lin | iOS | And |
|
||||
| ------------------------------------------ | --------------------------------------------------------- | --- | --- | --- | --- | --- |
|
||||
| [authenticator](plugins/authenticator) | Interface with hardware security keys. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [autostart](plugins/autostart) | Automatically launch your app at system startup. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [fs-extra](plugins/fs-extra) | File system methods that aren't included in the core API. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [fs-watch](plugins/fs-watch) | Watch the filesystem for changes. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [localhost](plugins/localhost) | Use a localhost server in production apps. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [log](plugins/log) | Configurable logging. | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| [persisted-scope](plugins/persisted-scope) | Persist runtime scope changes on the filesystem. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [positioner](plugins/positioner) | Move windows to common locations. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [single-instance](plugins/single-instance) | Ensure a single instance of your tauri app is running. | ✅ | ? | ✅ | ? | ? |
|
||||
| [sql](plugins/sql) | Interface with SQL databases. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [store](plugins/store) | Persistent key value storage. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [stronghold](plugins/stronghold) | Encrypted, secure database. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [upload](plugins/upload) | Tauri plugin for file uploads through HTTP. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [websocket](plugins/websocket) | Open a WebSocket connection using a Rust client in JS. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [window-state](plugins/window-state) | Persist window sizes and positions. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| | | Win | Mac | Lin | iOS | And |
|
||||
| ------------------------------------------ | ------------------------------------------------------ | --- | --- | --- | --- | --- |
|
||||
| [authenticator](plugins/authenticator) | Interface with hardware security keys. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [autostart](plugins/autostart) | Automatically launch your app at system startup. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [localhost](plugins/localhost) | Use a localhost server in production apps. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [log](plugins/log) | Configurable logging. | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| [persisted-scope](plugins/persisted-scope) | Persist runtime scope changes on the filesystem. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [positioner](plugins/positioner) | Move windows to common locations. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [single-instance](plugins/single-instance) | Ensure a single instance of your tauri app is running. | ✅ | ? | ✅ | ? | ? |
|
||||
| [sql](plugins/sql) | Interface with SQL databases. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [store](plugins/store) | Persistent key value storage. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [stronghold](plugins/stronghold) | Encrypted, secure database. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [upload](plugins/upload) | Tauri plugin for file uploads through HTTP. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [websocket](plugins/websocket) | Open a WebSocket connection using a Rust client in JS. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [window-state](plugins/window-state) | Persist window sizes and positions. | ✅ | ✅ | ✅ | ? | ? |
|
||||
|
||||
_This repo and all plugins require a Rust version of at least **1.64**_
|
||||
_This repo and all plugins require a Rust version of at least **1.65**_
|
||||
|
@ -0,0 +1,7 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-alpha.0]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Plugins v2 alpha.
|
@ -0,0 +1,13 @@
|
||||
# Changelog
|
||||
|
||||
## \[2.0.0-alpha.1]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Updated to latest `notification`
|
||||
|
||||
## \[2.0.0-alpha.0]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Plugins v2 alpha.
|
@ -1,113 +0,0 @@
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
id("rustPlugin")
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk = 33
|
||||
defaultConfig {
|
||||
manifestPlaceholders["usesCleartextTraffic"] = "false"
|
||||
applicationId = "com.tauri.api"
|
||||
minSdk = 24
|
||||
targetSdk = 33
|
||||
versionCode = 1
|
||||
versionName = "1.0"
|
||||
}
|
||||
sourceSets.getByName("main") {
|
||||
// Vulkan validation layers
|
||||
val ndkHome = System.getenv("NDK_HOME")
|
||||
jniLibs.srcDir("${ndkHome}/sources/third_party/vulkan/src/build-android/jniLibs")
|
||||
}
|
||||
buildTypes {
|
||||
getByName("debug") {
|
||||
manifestPlaceholders["usesCleartextTraffic"] = "true"
|
||||
isDebuggable = true
|
||||
isJniDebuggable = true
|
||||
isMinifyEnabled = false
|
||||
packagingOptions { jniLibs.keepDebugSymbols.add("*/arm64-v8a/*.so")
|
||||
jniLibs.keepDebugSymbols.add("*/armeabi-v7a/*.so")
|
||||
jniLibs.keepDebugSymbols.add("*/x86/*.so")
|
||||
jniLibs.keepDebugSymbols.add("*/x86_64/*.so")
|
||||
}
|
||||
}
|
||||
getByName("release") {
|
||||
isMinifyEnabled = true
|
||||
val proguards = fileTree(".") {
|
||||
include("*.pro")
|
||||
}
|
||||
proguardFiles(*proguards.toList().toTypedArray())
|
||||
}
|
||||
}
|
||||
flavorDimensions.add("abi")
|
||||
productFlavors {
|
||||
create("universal") {
|
||||
dimension = "abi"
|
||||
ndk {
|
||||
abiFilters += (findProperty("abiList") as? String)?.split(",") ?: listOf( "arm64-v8a", "armeabi-v7a", "x86", "x86_64",
|
||||
)
|
||||
}
|
||||
}
|
||||
create("arm64") {
|
||||
dimension = "abi"
|
||||
ndk {
|
||||
abiFilters += listOf("arm64-v8a")
|
||||
}
|
||||
}
|
||||
|
||||
create("arm") {
|
||||
dimension = "abi"
|
||||
ndk {
|
||||
abiFilters += listOf("armeabi-v7a")
|
||||
}
|
||||
}
|
||||
|
||||
create("x86") {
|
||||
dimension = "abi"
|
||||
ndk {
|
||||
abiFilters += listOf("x86")
|
||||
}
|
||||
}
|
||||
|
||||
create("x86_64") {
|
||||
dimension = "abi"
|
||||
ndk {
|
||||
abiFilters += listOf("x86_64")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
assetPacks += mutableSetOf()
|
||||
namespace = "com.tauri.api"
|
||||
}
|
||||
|
||||
rust {
|
||||
rootDirRel = "../../../../"
|
||||
targets = (findProperty("targetList") as? String)?.split(",") ?: listOf("aarch64", "armv7", "i686", "x86_64")
|
||||
arches = (findProperty("archList") as? String)?.split(",") ?: listOf("arm64", "arm", "x86", "x86_64")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("androidx.webkit:webkit:1.5.0")
|
||||
implementation("androidx.appcompat:appcompat:1.5.1")
|
||||
implementation("com.google.android.material:material:1.7.0")
|
||||
testImplementation("junit:junit:4.13.2")
|
||||
androidTestImplementation("androidx.test.ext:junit:1.1.4")
|
||||
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.0")
|
||||
implementation(project(":tauri-android"))
|
||||
}
|
||||
|
||||
apply(from = "tauri.build.gradle.kts")
|
||||
|
||||
afterEvaluate {
|
||||
android.applicationVariants.all {
|
||||
tasks["mergeUniversalReleaseJniLibFolders"].dependsOn(tasks["rustBuildRelease"])
|
||||
tasks["mergeUniversalDebugJniLibFolders"].dependsOn(tasks["rustBuildDebug"])
|
||||
if (findProperty("targetList") == null) {
|
||||
productFlavors.filter{ it.name != "universal" }.forEach { _ ->
|
||||
val archAndBuildType = name.capitalize()
|
||||
tasks["merge${archAndBuildType}JniLibFolders"].dependsOn(tasks["rustBuild${archAndBuildType}"])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
package com.tauri.api
|
||||
|
||||
class MainActivity : TauriActivity() {
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
buildscript {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath("com.android.tools.build:gradle:7.3.1")
|
||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10")
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register("clean").configure {
|
||||
delete("build")
|
||||
}
|
||||
|
@ -1,23 +0,0 @@
|
||||
plugins {
|
||||
`kotlin-dsl`
|
||||
}
|
||||
|
||||
gradlePlugin {
|
||||
plugins {
|
||||
create("pluginsForCoolKids") {
|
||||
id = "rustPlugin"
|
||||
implementationClass = "com.tauri.RustPlugin"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly(gradleApi())
|
||||
implementation("com.android.tools.build:gradle:7.3.1")
|
||||
}
|
||||
|
@ -1,59 +0,0 @@
|
||||
package com.tauri
|
||||
|
||||
import org.gradle.api.DefaultTask
|
||||
import org.gradle.api.GradleException
|
||||
import org.gradle.api.Plugin
|
||||
import org.gradle.api.Project
|
||||
import java.io.File
|
||||
import java.util.*
|
||||
|
||||
const val TASK_GROUP = "rust"
|
||||
|
||||
open class Config {
|
||||
var rootDirRel: String? = null
|
||||
var targets: List<String>? = null
|
||||
var arches: List<String>? = null
|
||||
}
|
||||
|
||||
open class RustPlugin : Plugin<Project> {
|
||||
private lateinit var config: Config
|
||||
|
||||
override fun apply(project: Project) {
|
||||
config = project.extensions.create("rust", Config::class.java)
|
||||
project.afterEvaluate {
|
||||
if (config.targets == null) {
|
||||
throw GradleException("targets cannot be null")
|
||||
}
|
||||
if (config.arches == null) {
|
||||
throw GradleException("arches cannot be null")
|
||||
}
|
||||
for (profile in listOf("debug", "release")) {
|
||||
val profileCapitalized = profile.capitalize(Locale.ROOT)
|
||||
val buildTask = project.tasks.maybeCreate(
|
||||
"rustBuild$profileCapitalized",
|
||||
DefaultTask::class.java
|
||||
).apply {
|
||||
group = TASK_GROUP
|
||||
description = "Build dynamic library in $profile mode for all targets"
|
||||
}
|
||||
for (targetPair in config.targets!!.withIndex()) {
|
||||
val targetName = targetPair.value
|
||||
val targetArch = config.arches!![targetPair.index]
|
||||
val targetArchCapitalized = targetArch.capitalize(Locale.ROOT)
|
||||
val targetBuildTask = project.tasks.maybeCreate(
|
||||
"rustBuild$targetArchCapitalized$profileCapitalized",
|
||||
BuildTask::class.java
|
||||
).apply {
|
||||
group = TASK_GROUP
|
||||
description = "Build dynamic library in $profile mode for $targetArch"
|
||||
rootDirRel = config.rootDirRel?.let { File(it) }
|
||||
target = targetName
|
||||
release = profile == "release"
|
||||
}
|
||||
buildTask.dependsOn(targetBuildTask)
|
||||
project.tasks.findByName("preBuild")?.mustRunAfter(targetBuildTask)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
include ':app'
|
||||
|
||||
include ':tauri-android'
|
||||
project(':tauri-android').projectDir = new File('./.tauri/tauri-api')
|
||||
|
||||
apply from: 'tauri.settings.gradle'
|
@ -1,4 +1,5 @@
|
||||
/src/main/java/com/tauri/api/generated
|
||||
/src/main/jniLibs/**/*.so
|
||||
/src/main/assets/tauri.conf.json
|
||||
/tauri.build.gradle.kts
|
||||
/proguard-tauri.pro
|
@ -0,0 +1,57 @@
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
id("rust")
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk = 33
|
||||
namespace = "com.tauri.api"
|
||||
defaultConfig {
|
||||
manifestPlaceholders["usesCleartextTraffic"] = "false"
|
||||
applicationId = "com.tauri.api"
|
||||
minSdk = 24
|
||||
targetSdk = 33
|
||||
versionCode = 1
|
||||
versionName = "1.0"
|
||||
}
|
||||
buildTypes {
|
||||
getByName("debug") {
|
||||
manifestPlaceholders["usesCleartextTraffic"] = "true"
|
||||
isDebuggable = true
|
||||
isJniDebuggable = true
|
||||
isMinifyEnabled = false
|
||||
packaging { jniLibs.keepDebugSymbols.add("*/arm64-v8a/*.so")
|
||||
jniLibs.keepDebugSymbols.add("*/armeabi-v7a/*.so")
|
||||
jniLibs.keepDebugSymbols.add("*/x86/*.so")
|
||||
jniLibs.keepDebugSymbols.add("*/x86_64/*.so")
|
||||
}
|
||||
}
|
||||
getByName("release") {
|
||||
isMinifyEnabled = true
|
||||
proguardFiles(
|
||||
*fileTree(".") { include("**/*.pro") }
|
||||
.plus(getDefaultProguardFile("proguard-android-optimize.txt"))
|
||||
.toList().toTypedArray()
|
||||
)
|
||||
}
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
}
|
||||
}
|
||||
|
||||
rust {
|
||||
rootDirRel = "../../../"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("androidx.webkit:webkit:1.6.1")
|
||||
implementation("androidx.appcompat:appcompat:1.6.1")
|
||||
implementation("com.google.android.material:material:1.8.0")
|
||||
testImplementation("junit:junit:4.13.2")
|
||||
androidTestImplementation("androidx.test.ext:junit:1.1.4")
|
||||
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.0")
|
||||
}
|
||||
|
||||
apply(from = "tauri.build.gradle.kts")
|
@ -0,0 +1,3 @@
|
||||
package com.tauri.api
|
||||
|
||||
class MainActivity : TauriActivity()
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
@ -1,14 +1,11 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
buildscript {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath("com.android.tools.build:gradle:7.3.1")
|
||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10")
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
classpath("com.android.tools.build:gradle:8.0.0")
|
||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21")
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,85 @@
|
||||
import com.android.build.api.dsl.ApplicationExtension
|
||||
import org.gradle.api.DefaultTask
|
||||
import org.gradle.api.Plugin
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.kotlin.dsl.configure
|
||||
import org.gradle.kotlin.dsl.get
|
||||
|
||||
const val TASK_GROUP = "rust"
|
||||
|
||||
open class Config {
|
||||
lateinit var rootDirRel: String
|
||||
}
|
||||
|
||||
open class RustPlugin : Plugin<Project> {
|
||||
private lateinit var config: Config
|
||||
|
||||
override fun apply(project: Project) = with(project) {
|
||||
config = extensions.create("rust", Config::class.java)
|
||||
|
||||
val defaultAbiList = listOf("arm64-v8a", "armeabi-v7a", "x86", "x86_64");
|
||||
val abiList = (findProperty("abiList") as? String)?.split(',') ?: defaultAbiList
|
||||
|
||||
val defaultArchList = listOf("arm64", "arm", "x86", "x86_64");
|
||||
val archList = (findProperty("archList") as? String)?.split(',') ?: defaultArchList
|
||||
|
||||
val targetsList = (findProperty("targetList") as? String)?.split(',') ?: listOf("aarch64", "armv7", "i686", "x86_64")
|
||||
|
||||
extensions.configure<ApplicationExtension> {
|
||||
@Suppress("UnstableApiUsage")
|
||||
flavorDimensions.add("abi")
|
||||
productFlavors {
|
||||
create("universal") {
|
||||
dimension = "abi"
|
||||
ndk {
|
||||
abiFilters += abiList
|
||||
}
|
||||
}
|
||||
defaultArchList.forEachIndexed { index, arch ->
|
||||
create(arch) {
|
||||
dimension = "abi"
|
||||
ndk {
|
||||
abiFilters.add(defaultAbiList[index])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
for (profile in listOf("debug", "release")) {
|
||||
val profileCapitalized = profile.replaceFirstChar { it.uppercase() }
|
||||
val buildTask = tasks.maybeCreate(
|
||||
"rustBuildUniversal$profileCapitalized",
|
||||
DefaultTask::class.java
|
||||
).apply {
|
||||
group = TASK_GROUP
|
||||
description = "Build dynamic library in $profile mode for all targets"
|
||||
}
|
||||
|
||||
tasks["mergeUniversal${profileCapitalized}JniLibFolders"].dependsOn(buildTask)
|
||||
|
||||
for (targetPair in targetsList.withIndex()) {
|
||||
val targetName = targetPair.value
|
||||
val targetArch = archList[targetPair.index]
|
||||
val targetArchCapitalized = targetArch.replaceFirstChar { it.uppercase() }
|
||||
val targetBuildTask = project.tasks.maybeCreate(
|
||||
"rustBuild$targetArchCapitalized$profileCapitalized",
|
||||
BuildTask::class.java
|
||||
).apply {
|
||||
group = TASK_GROUP
|
||||
description = "Build dynamic library in $profile mode for $targetArch"
|
||||
rootDirRel = config.rootDirRel
|
||||
target = targetName
|
||||
release = profile == "release"
|
||||
}
|
||||
|
||||
buildTask.dependsOn(targetBuildTask)
|
||||
tasks["merge$targetArchCapitalized${profileCapitalized}JniLibFolders"].dependsOn(
|
||||
targetBuildTask
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
#Tue May 10 19:22:52 CST 2022
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
|
||||
distributionPath=wrapper/dists
|
||||
zipStorePath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
@ -0,0 +1,3 @@
|
||||
include ':app'
|
||||
|
||||
apply from: 'tauri.settings.gradle'
|
@ -1,76 +1,86 @@
|
||||
<script>
|
||||
import { onMount, onDestroy } from 'svelte'
|
||||
import { check } from "@tauri-apps/plugin-updater";
|
||||
import { relaunch } from "@tauri-apps/plugin-process";
|
||||
|
||||
// This example show how updater events work when dialog is disabled.
|
||||
// This allow you to use custom dialog for the updater.
|
||||
// This is your responsibility to restart the application after you receive the STATUS: DONE.
|
||||
export let onMessage;
|
||||
|
||||
import { checkUpdate, installUpdate } from '@tauri-apps/api/updater'
|
||||
import { listen } from '@tauri-apps/api/event'
|
||||
import { relaunch } from '@tauri-apps/api/process'
|
||||
let isChecking, isInstalling, newUpdate;
|
||||
let totalSize = 0,
|
||||
downloadedSize = 0;
|
||||
|
||||
export let onMessage
|
||||
let unlisten
|
||||
|
||||
onMount(async () => {
|
||||
unlisten = await listen('tauri://update-status', onMessage)
|
||||
})
|
||||
onDestroy(() => {
|
||||
if (unlisten) {
|
||||
unlisten()
|
||||
}
|
||||
})
|
||||
|
||||
let isChecking, isInstalling, newUpdate
|
||||
|
||||
async function check() {
|
||||
isChecking = true
|
||||
async function checkUpdate() {
|
||||
isChecking = true;
|
||||
try {
|
||||
const { shouldUpdate, manifest } = await checkUpdate()
|
||||
onMessage(`Should update: ${shouldUpdate}`)
|
||||
onMessage(manifest)
|
||||
const update = await check();
|
||||
onMessage(`Should update: ${update.response.available}`);
|
||||
onMessage(update.response);
|
||||
|
||||
newUpdate = shouldUpdate
|
||||
newUpdate = update;
|
||||
} catch (e) {
|
||||
onMessage(e)
|
||||
onMessage(e);
|
||||
} finally {
|
||||
isChecking = false
|
||||
isChecking = false;
|
||||
}
|
||||
}
|
||||
|
||||
async function install() {
|
||||
isInstalling = true
|
||||
isInstalling = true;
|
||||
downloadedSize = 0;
|
||||
try {
|
||||
await installUpdate()
|
||||
onMessage('Installation complete, restart required.')
|
||||
await relaunch()
|
||||
await newUpdate.downloadAndInstall((downloadProgress) => {
|
||||
switch (downloadProgress.event) {
|
||||
case "Started":
|
||||
totalSize = downloadProgress.data.contentLength;
|
||||
break;
|
||||
case "Progress":
|
||||
downloadedSize += downloadProgress.data.chunkLength;
|
||||
break;
|
||||
case "Finished":
|
||||
break;
|
||||
}
|
||||
});
|
||||
onMessage("Installation complete, restarting...");
|
||||
await new Promise((resolve) => setTimeout(resolve, 2000));
|
||||
await relaunch();
|
||||
} catch (e) {
|
||||
onMessage(e)
|
||||
console.error(e);
|
||||
onMessage(e);
|
||||
} finally {
|
||||
isInstalling = false
|
||||
isInstalling = false;
|
||||
}
|
||||
}
|
||||
|
||||
$: progress = totalSize ? Math.round((downloadedSize / totalSize) * 100) : 0;
|
||||
</script>
|
||||
|
||||
<div class="flex children:grow children:h10">
|
||||
{#if !isChecking && !newUpdate}
|
||||
<button class="btn" on:click={check}>Check update</button>
|
||||
<button class="btn" on:click={checkUpdate}>Check update</button>
|
||||
{:else if !isInstalling && newUpdate}
|
||||
<button class="btn" on:click={install}>Install update</button>
|
||||
{:else}
|
||||
<button
|
||||
class="btn text-accentText dark:text-darkAccentText flex items-center justify-center"
|
||||
><div class="spinner animate-spin" /></button
|
||||
>
|
||||
<div class="progress">
|
||||
<span>{progress}%</span>
|
||||
<div class="progress-bar" style="width: {progress}%" />
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.spinner {
|
||||
height: 1.2rem;
|
||||
width: 1.2rem;
|
||||
border-radius: 50rem;
|
||||
color: currentColor;
|
||||
border: 2px dashed currentColor;
|
||||
.progress {
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
position: relative;
|
||||
margin-top: 5%;
|
||||
}
|
||||
|
||||
.progress > span {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
height: 30px;
|
||||
background-color: hsl(32, 94%, 46%);
|
||||
border: 1px solid #333;
|
||||
}
|
||||
</style>
|
||||
|