* refactor(tauri-cli): use OsString where possible
* refactor(tauri-cli): remove needless scoping blocks
* refactor(tauri-cli): make return type concrete
* refactor(tauri-cli): use ?
* refactor(tauri-cli): coerce later to trait object
* refactor(tauri-cli): remove clone
* refactor(tauri-cli): make better use of static OnceLock
* fix(tauri-cli): upgrade atomics to SeqCst
* Add change file
* Update .changes/change-pr-14836.md
Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
* refactor(tauri-cli): introduce replacement functions
* refactor(tauri-cli): apply replacement to remove.rs
* refactor(tauri-cli): apply replacement to icon.rs
* refactor(tauri-cli): apply replacement to bundle.rs
* refactor(tauri-cli): apply replacement to build.rs
* refactor(tauri-cli): apply replacement to add.rs
* refactor(tauri-cli): apply replacement to dev.rs
* refactor(tauri-cli): less controlflow
* refactor(tauri-cli): split config loading from locking static
* refactor(tauri-cli): remove duplicate checks covered by if let Some(tauri_dir) = tauri_dir
tauri_dir.is_some() must be true, otherwise the entire block is not run, so the frontend_dir check
is irrelevant
* fmt
* refactor(tauri-cli): apply replacement to inspect.rs
* refactor(tauri-cli): dont use statics for config
* refactor(tauri-cli): finish threading directory paths through functions
* fix: clippy
* fixup CI
* refactor(tauri-cli): dont need mutex
* refactor(tauri-cli): rescope mutex use to minimal necessary
* fix CI, reduce mutex use
* fixup PR #14607
* fix: clippy
* refactor(tauri-cli): remove ConfigHandle
* refactor(tauri-cli): remove more unwraps and panicing functions
* refactor(tauri-cli): less mutexes
* refactor(tauri-cli): undo mistaken change, address review comment
* Split android build to 2 functions
* Pass in dirs to migration v1 like the v2 beta
* Add change file
---------
Co-authored-by: Tony <legendmastertony@gmail.com>
* refactor: use empty vector for features instead of None
* refactor: reorder
* add change file
* comment: highlight places where serialization is used
* refactor: simplify serialization
* Update .changes/empty-vec-instead-of-none.md
* Update crates/tauri-cli/src/mobile/ios/mod.rs
---------
Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
* refactor(tauri-utils): current_dest and current_pattern always change in-sync, group them to one Option
* refactor(tauri-utils): pass path as explicit argument instead of implicitly through self
* refactor(tauri-utils): remove struct field that is never set to Some
* refactor(tauri-cli): use OsString, OsStr where possible
* refactor(tauri-cli): Deref Arc early
* refactor(tauri-cli): lock config before passing to build::setup()
* refactor(tauri-build, tauri-utils): bettern pattern matching and borrowing
* refactor(tauri-cli): dont need Arc if already have static
* fix(tauri-cli): race condition initializing static flag, remove unnecessary OnceLock
* refactor(tauri-cli): use expect
* refactor(tauri-cli): remove unnecessary OnceLock
* refactor(tauri-cli): better use of dunce api
* refactor(tauri-cli): rename
* add new api (auto_increment_version_code) in android configuration
* ensure increment is only ran once
* skip on dev
* update doc
* change file
---------
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
* fix(cli): improve Android BuildTask.kt Windows executable detection
- Fix Android build error on Windows when using nvm4w
- Add robust fallback logic for Windows executable detection
- Prevent 'node.exe.cmd' and 'Cannot find module' errors
- Graceful fallback to cargo when Node.js detection fails
Fixes#13892
* strip extension from project, try exe/cmd/bat
* revert args
---------
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
currently the `use_network_address_for_dev_url` function already detects Ipv4Addr::UNSPECIFIED to resolve the local IP address for mobile development when the dev URL host is 0.0.0.0, but we only call it when `--host` is provided or running on a physical device. This change detects the unspecified host early and force the resolution to run even for simulator builds
* feat(cli): detect Android env and install SDK and NDK if needed
changes the Android setup to be a bit more automated - looking up ANDROID_HOME and NDK_HOME from common system paths and installing the Android SDK and NDK if needed using the command line tools
* fix windows
* clippy
* lint
* add prmopts and ci check
* also check ANDROID_SDK_ROOT
* feat(bundle): add --no-sign flag to skip code signing in bundling process
- Introduce a
o_sign option in bundle settings to allow skipping code signing
- Update macOS and Windows bundler implementations to respect the flag
- Wire up CLI option --no-sign to control signing behavior during bundling
- Add necessary config and type changes to propagate the flag throughout bundler
Signed-off-by: ShigrafS <shigrafsalik@proton.me>
* ci: added yml for github action testing
Signed-off-by: ShigrafS <shigrafsalik@proton.me>
* fix: fixed field 'digest_algorithm' is already declared error
Signed-off-by: ShigrafS <shigrafsalik@proton.me>
* ci: updated to test the new features as well
Signed-off-by: ShigrafS <shigrafsalik@proton.me>
* ci: fixed yml issue
Signed-off-by: ShigrafS <shigrafsalik@proton.me>
* fix: fixed missing parameter issue in android sign.rs
Signed-off-by: ShigrafS <shigrafsalik@proton.me>
* chore: apply linting
Signed-off-by: ShigrafS <shigrafsalik@proton.me>
* chore: remove redundant files
Signed-off-by: ShigrafS <shigrafsalik@proton.me>
* chore: revert indentations
Signed-off-by: ShigrafS <shigrafsalik@proton.me>
* fix: added parameters to ios mobile build.rs
Signed-off-by: ShigrafS <shigrafsalik@proton.me>
* docs: updated documentation for settigs.rs
Signed-off-by: ShigrafS <shigrafsalik@proton.me>
* docs(cli): add documentation for
o_sign flag in build options
Signed-off-by: ShigrafS <shigrafsalik@proton.me>
* chore: apply cargo fmt
Signed-off-by: ShigrafS <shigrafsalik@proton.me>
* docs: added CHANGES.md
Signed-off-by: ShigrafS <shigrafsalik@proton.me>
* refactor(bundler): make
o_sign private and add getter
Signed-off-by: ShigrafS <shigrafsalik@proton.me>
* fix: minor error
Signed-off-by: ShigrafS <shigrafsalik@proton.me>
* refactor: revert build_benchmark_jsons.rs
Signed-off-by: ShigrafS <shigrafsalik@proton.me>
* impl for macos too
* fix ci
* fix windows build
---------
Signed-off-by: ShigrafS <shigrafsalik@proton.me>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
currently we only install Rust targets for mobile when initializing the projects.
Users can commit the Android/iOS projects, so running the init command is not a requirement to develop mobile apps. This change ensures the Rust targets are installed before trying to compile them.
* feat(cli): check plugin versions for incompatibilities
check core plugin versions for incompatibilities between Cargo and NPM releases
a plugin NPM/cargo version is considered "incompatible" if their major or minor versions are not equal
on dev we show an warning
on build we error out (with a `--ignore-incompatible-plugins` flag to prevent that)
this is an idea from @oscartbeaumont
we've seen several plugin changes that require updates for both the cargo and the NPM releases of a plugin, and if they are not in sync, the functionality does not work
e.g. https://github.com/tauri-apps/plugins-workspace/pull/2573 where the change actually breaks the app updater if you miss the NPM update
* Use list to get multiple package versions at once
* Fix for older rust versions
* Clippy
* Support yarn classic
* Support yarn berry
* Use `.cmd` only for `npm`, `yarn`, `pnpm`
* Use yarn list without --pattern
* rename
* Extract function `check_incompatible_packages`
* Check `tauri` <-> `@tauri-apps/api`
* incompatible -> mismatched
* run build check in parallel
* rename struct
* Switch back to use sync check and add todo
* Extract to function `cargo_manifest_and_lock`
---------
Co-authored-by: Tony <legendmastertony@gmail.com>
* feat: add `--root-certificate-path` option for mobile dev
lets you use a HTTPS development server
example usage:
```
cargo install tauri-cli --git https://github.com/tauri-apps/tauri --branch feat/mobile-dev-cert
cargo tauri android dev --open --root-certificate-path "/Users/lucas/Library/Application Support/mkcert/rootCA.pem" --features tauri/rustls-tls
```
* Apply suggestions from code review
Co-authored-by: Fabian-Lars <github@fabianlars.de>
---------
Co-authored-by: Fabian-Lars <github@fabianlars.de>
* feat: add option to not wait on notarization to finish
* cli arg istead of config
* changefile
* fix serde
---------
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
* feat: add config option for custom watch folders
* fix: cargo clippy changes
* chore: remove file
* fix: ios dev
* docs: clarify absolute allowed
* refactor: rename variable
* fix: review suggestions
* fix: resolve paths
* fixL use canonicalize
* chore: add changefile
* chore: add error if cant canonicalize
* reformat changelog
* Update .changes/additional-watch-folders.md
* Update crates/tauri-cli/src/interface/rust.rs
Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
* Revert "Update .changes/additional-watch-folders.md"
This reverts commit 98186b1a89.
* Also bump `@tauri-apps/cli`
* Apparently I'm so used to a higher rust version
* Revert "Apparently I'm so used to a higher rust version"
This reverts commit ea1d89e2d3.
* Need to check for existence for abs paths as well
---------
Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
Co-authored-by: Tony <legendmastertony@gmail.com>
* fix(cli): read original identifier to fix mobile options reading
the iOS and Android CLI commands leverage an android_studio_script/xcode_script that is executed by the native IDE or build tool. This script reads the Tauri configuration to find the app identifier used to communicate with the parent Tauri CLI process to read CLI options.
The communication is broken when the `--config` arg is used, since the IDE script does not have access to that value before reaching the parent process, which is impossible without knowing the actual identifier used.
To bypass this we'll agree on using the original identifier. This obviously won't work if the original tauri.conf.json do not have an identifier, so we error out in this case
* fix build, lint
* feat(cli): enhance iOS bundle version formatting
follow-up for #13030 and https://github.com/tauri-apps/cargo-mobile2/pull/450
the bundle version validation has been updated, now it can actually handle one or two integers (e.g. `100` or `10.7`) instead of just full triple semver strings (e.g. `10.7.1`).
* lint
* fix(cli): iOS dev broken on Xcode 16.3, closes#13128
Looks like we cannot use the arm64-sim custom architecture on Xcode 16.3, as it incorrectly appends the -sim suffix on some clang build scripts which ends up with an invalid target triple.
Currently we do not have automation to update Xcode/Android projects, so a manual intervention is required by our users, either recreating the project or modifying it manually (the arm64-sim arch must be removed and all its references).
ref https://github.com/tauri-apps/cargo-mobile2/pull/445
* fix dev on macOS with intel chip
* chore: fix a few internal docs
* Remove label clone
* Unused allow lint
* No way clippy just updated
* `cargo clippy --fix -- -W clippy::redundant_clone`
* format
* feat(cli): allow merging multiple configuration values
Currently the dev/build/bundle commands can only merge a single Tauri configuration value (file or raw JSON string), which imposes a limitation in scenarios where you need more flexibility (like multiple app flavors and environments). This changes the config CLI option to allow multiple values, letting you merge multiple Tauri config files with the main one.
* fix ios build