* fix(android): avoid rebuilds if nothing changed
Unconditionally overwriting files where the build reruns if they changed
leads to rebuilds every time.
Only overwrite a file if its content is different to not rebuild in such
a case.
* use write_if_changed utils
* use existing function
---------
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
* feat(ios): add a new cli option to dev to use project archs
Add a new option to instruct cargo-mobile2 to use architectures configured in the project for building
* update cargo-mobile2, add change file
* fix change file [skip ci]
---------
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
* skip pack in publish, use check fetch
* remove script
* remove apt, exists in main pipeline
* CLI doesn't need separate check
* no assets for tauri-cli
* fix(utils): fix resources map becomes directory
closes#10187
Fixes the behavior of mapped resources generating extra directory, for example:
`"../resources/user.json": "resources/user.json"` generates this resource `resources/user.json/user.json`
where it should generate `resources/user.json`
This PR includes a refactor of the Iterator implementation which splits it into more scoped functions and relis on recursing instead of a loop which makes the code a lot more readable and easier to maintain.
* clippy
* cover more cases
* clippy
* fix glob into directory, not resolving target correctly
* return error when resource origin path doesn't exist
* fix resources example build
* Update .changes/resources-map-becoming-dirs.md
---------
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
* refactor(core): serialize response once closes#5641
This change impacts both the custom protocol and the postMessage based IPC implementations. Basically it changes the whole IPC mechanism to work on raw JSON strings so we do not need to serialize a serde_json::Value after serializing to it from a user-provided type.
i benchmarked this with a 150MB file response (returning Vec<u8> instead of tauri::ipc::Response since the latter does not serialize at all) and it went from 29s to 23s (custom protocol) and from 54s to 48s (post message) on macOS.
* fix mobile & lint
* clippy
immediately after merging #10588 I noticed that the variable name might be a bit ambigious and could cause confusion on other pl atforms other than Windows
* refactor(core): return 200 on any IPC call, closes#10286
By default the webview prints a `Failed to load resource: the server responded with a status of 400 (Bad Request) ipc://localhost` error message when a command returns an error, which is confusing to users.
This changes the IPC to return status 200 on any call, with a header to indicate whether the result was ok or not. This removes the console error, which would only log the actual error result if it isn't caught by the user.
* add change file
* apply code review changes
The IPC fallback system kicks in when the custom protocol implementation cannot be used (e.g. CORS issues).
The fallback uses the postMessage mechanism, which by default uses channels to send large responses. If the custom protocol implementation cannot be used, we should not use channels, but eval the response directly.