Commit Graph

22 Commits

Author SHA1 Message Date
sftse
e3fdcb5002 refactor tauri-cli (#14836)
* 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>
2026-01-29 10:39:00 +08:00
sftse
d453e2e06a refactor(tauri-cli): remove trait implemented only once (#14840) 2026-01-29 10:35:55 +08:00
sftse
7f7d9aac21 Less statics (#14668)
* 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>
2026-01-17 23:52:42 +08:00
sftse
a2abe2e6bc refactor(cli): simplify features: Option<Vec<String>> to Vec<String> (#14607)
* 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>
2025-12-29 13:54:51 +08:00
Lucas Fernandes Nogueira
28a2f9bc55 fix(cli): ensure Xcode project is up to date with Cargo project name (#14101)
* fix(cli): ensure Xcode project is up to date with Cargo project name

closes #13542

* clippy
2025-10-06 14:06:04 -03:00
Lucas Fernandes Nogueira
b06b3bd091 refactor(cli): improve errors (#14126)
* refactor(cli): improve errors

* update change files

* license

* add errorext with fs_context helper

* update linux

* lint

* fmt

* windows

* revert bundler breaking change

* fix ios mod

* ref

* reduce amount of enum variants

* fix macos build

* Fix windows build

* Clippy

* capitalize cargo [skip ci]

---------

Co-authored-by: Tony <legendmastertony@gmail.com>
2025-10-02 06:58:26 -03:00
Lucas Fernandes Nogueira
bcf000c0a8 fix(cli): ios command failing when running with deno, closes #13547 (#14110)
Deno doesn't set an environment variable to help us, so I had to use the exe path to determine whether we're running under deno or not
2025-08-28 18:02:46 -03:00
Lucas Fernandes Nogueira
f70b28529d feat(cli): ensure mobile Rust targets are installed (#14093)
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.
2025-08-27 18:05:24 -03:00
Lucas Fernandes Nogueira
cbd9629729 fix(cli): load --config values on xcode and android-studio scripts (#13730) 2025-06-28 17:16:36 -03:00
Fabian-Lars
6b2b9d6cbf chore: clippy 1.88 (#13720) 2025-06-27 15:33:36 +02:00
Lucas Fernandes Nogueira
ec6065fa4a fix(cli): use original identifier to fix mobile options reading (#13625)
* 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
2025-06-23 09:29:46 -03:00
Lucas Fernandes Nogueira
5a5291d66c fix(cli): use platform name to detect iOS architecture to build (#13483) 2025-05-21 14:12:44 -03:00
Lucas Fernandes Nogueira
0802529031 fix(cli): iOS dev broken on Xcode 16.3, closes #13128 (#13210)
* 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
2025-04-12 12:50:06 -03:00
Matthew Richardson
0aa48fb9e4 feat: Support custom CFBundleVersion for iOS and macOS (#13030)
* feat: Add bundleVersion for iOS and macOS

* feat: Use bundleVersion for CFBundleVersion

* feat: Synchronize bundleVersion with Info.plist

* cleanup

* fix bundle version, enhance prerelease/buildnumber support and checks

* fix change file

* tauri-bundler to change file

* expand doc

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-04-12 09:28:48 -03:00
Lucas Fernandes Nogueira
b83921226c fix(cli): ios command wrong cwd on bun 1.2, closes #12965 (#12977)
bun 1.2 changed the current working directory behavior to match NPM managers, so we must adapt our xcode-script logic to check the bun version

see https://bun.sh/blog/bun-v1.2#bun-run-uses-the-correct-directory
2025-03-14 16:20:39 -03:00
Lucas Fernandes Nogueira
d91bfa5cb9 feat(cli): allow merging multiple configuration values (#12970)
* 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
2025-03-14 12:04:58 -03:00
Fabian-Lars
cde0ff7798 chore: Fix clippy 1.84 warnings (#12328) 2025-01-10 13:47:37 +01:00
Lucas Fernandes Nogueira
56e087471a fix(cli): ios xcode-script arg parsing when using bun, closes #10742 (#11100) 2024-09-23 18:31:29 -03:00
Amr Bashir
35bd9dd3dc feat: add mainBinaryName option (#10977)
* feat: add `mainBinaryName` option

* remove unused imports [skip ci]

* enhance error message [skip ci]

* migrate `mainBinaryName`

* change file

* revert bin src_path

* add link

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-09-15 07:51:01 -03:00
Lucas Fernandes Nogueira
9c9644d155 feat(cli): always validate iOS lib (#10845) 2024-09-02 13:13:34 -03:00
Lucas Fernandes Nogueira
f67a9eb6de feat(cli): synchronize Tauri config and lib name with iOS Xcode project (#10802)
- the Xcode project now uses a fixed output library name, which means changes to the Cargo.toml lib name won't affect it (backwards compatible change, we're checking if this new format is being used or not by reading the project.pbxproj)
- sync config identifier with the pbxproj
- sync development team config with the pbxproj

the sync runs both on dev and on build

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2024-08-28 12:11:50 -03:00
Amr Bashir
36eee37220 Restructure the repository (#10796)
* Restructure the repository

* lock file

* fmt

* fix bench

* fix cli template test

* remove accidental file

* fix mv command

* clippy

* upgrade paths-filter github action

* fix cli migration tests

* lockfile

* license headers

* clippy

* scope test-core to tauri crate

* license header

* correct --manifest-path usage

* lockfile

* fix tauri-driver on macOS [skip ci]

* build target ios

* try downgrade env_logger

* downgrade 0.1.7

* try to fix bench

* bench overflow

* revert overflow fix, fix tauri_root_path

* revert env_logger downgrade

* fmt

* raise msrv to 1.71

* fmt

* delete .cargo/config.toml [skip ci]

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-08-27 18:42:30 -03:00