Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/tauri-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ jobs:
VITE_IS_RELEASE_TAG: ${{ needs.setup-release.outputs.nightly == 'true' && 'true' || '' }}
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
MISE_ENV: tauri
NODE_OPTIONS: --max-old-space-size=8192
RUST_TARGETS: aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
ANDROID_KEY_BASE64: ${{ secrets.ANDROID_KEY_BASE64 }}
Expand All @@ -341,6 +342,10 @@ jobs:
with:
tauri: 'true'

- name: Setup Android SDK + NDK
shell: bash
run: mise run tauri:setup:android

- name: Add Rust targets
shell: bash
run: rustup target add $RUST_TARGETS
Expand All @@ -350,10 +355,13 @@ jobs:
with:
workspaces: src-tauri

- name: Setup Gradle
uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0

- name: Resolve NDK
shell: bash
run: |
echo "NDK_HOME=$ANDROID_HOME/ndk/$(ls -1 "$ANDROID_HOME/ndk" | sort -V | tail -n1)" >> "$GITHUB_ENV"
echo "NDK_HOME=$ANDROID_HOME/ndk/$ANDROID_NDK_VERSION" >> "$GITHUB_ENV"

- name: Stamp release version into tauri.conf.json
shell: bash
Expand Down
3 changes: 3 additions & 0 deletions mise.tauri.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Tauri-specific dev tools and system dependencies.
# Loaded via `MISE_ENV=tauri` (set by `mise run setup:tauri` or CI).

[env]
ANDROID_NDK_VERSION = "29.0.14206865"

[settings]
idiomatic_version_file_enable_tools = ["pnpm", "node", "rust"]
experimental = true
Expand Down
9 changes: 9 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ description = "Install Tauri tools and system packages"
run = ["mise install", "mise bootstrap packages apply --yes"]
env = { MISE_ENV = "tauri" }

[tasks."tauri:setup:android"]
description = "Install Android SDK packages + NDK (no Android Studio needed)"
depends = ["tauri:setup"]
env = { MISE_ENV = "tauri" }
run = [
"yes | sdkmanager --licenses",
'sdkmanager "platform-tools" "platforms;android-36" "build-tools;35.0.0" "ndk;{{env.ANDROID_NDK_VERSION}}"',
]

[tasks."tauri:setup:macos"]
description = "Install Xcode"
confirm = { message = "Install Xcode? (required for Tauri)", default = "no" }
Expand Down
5 changes: 5 additions & 0 deletions src-tauri/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ fn main() {
println!("cargo:rustc-link-arg-bins=-Wl,-rpath,/usr/lib/swift");
}

// Use the NDK's lld linker for faster Android linking.
if std::env::var("CARGO_CFG_TARGET_OS").as_deref() == Ok("android") {
println!("cargo:rustc-link-arg=-fuse-ld=lld");
}

tauri_typegen::BuildSystem::generate_at_build_time()
.expect("Failed to generate TypeScript bindings");

Expand Down
4 changes: 3 additions & 1 deletion src-tauri/gen/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
org.gradle.parallel=true
# Enable the Gradle build cache so task outputs are reused across runs.
org.gradle.caching=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
Expand Down
Loading