Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into refactor/ios-cert-sync
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Aug 21, 2024
2 parents 1387c4a + 9bcff3c commit 155182b
Show file tree
Hide file tree
Showing 48 changed files with 311 additions and 77 deletions.
5 changes: 5 additions & 0 deletions .changes/fix-android-remove-current-script.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tauri-utils": patch:bug
---

Properly remove isolation script on Android.
6 changes: 6 additions & 0 deletions .changes/fix-cli-add-plugin-version.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'tauri-cli': 'patch:bug'
'@tauri-apps/cli': 'patch:bug'
---

Changed the `add` command to use a version requirement that matches the CLI's stable and prerelease numbers.
6 changes: 6 additions & 0 deletions .changes/inject-mobile-resources.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"tauri-cli": patch:feat
"@tauri-apps/cli": patch:feat
---

Inject configured resources on mobile apps.
4 changes: 4 additions & 0 deletions .changes/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
".changes/enhance-permission-error-message.md",
".changes/feat-remove-target-sdk.md",
".changes/fix-adb.md",
".changes/fix-cli-add-plugin-version.md",
".changes/fix-cli-dev-server-android.md",
".changes/fix-cli-panic-bun.md",
".changes/fix-colon-in-file-path.md",
Expand All @@ -46,6 +47,7 @@
".changes/get-window-async.md",
".changes/improve-cli-init.md",
".changes/infer-signing-identity.md",
".changes/inject-mobile-resources.md",
".changes/ios-custom-project-template.md",
".changes/ios-default-minversion.md",
".changes/ios-frameworks.md",
Expand All @@ -63,6 +65,8 @@
".changes/refactor-ipc-response.md",
".changes/remove-open-command.md",
".changes/remove-unsecure-configs.md",
".changes/resource-dir-android.md",
".changes/resource-dir-ios.md",
".changes/resources-map-becoming-dirs.md",
".changes/universal-bin-build-fails.md",
".changes/update-tao-wry.md",
Expand Down
5 changes: 5 additions & 0 deletions .changes/resource-dir-android.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tauri-utils": patch:bug
---

Implemented `resource_dir` on Android, which returns a URI that needs to be resolved using [AssetManager::open](https://developer.android.com/reference/android/content/res/AssetManager#open(java.lang.String,%20int)). This will be handled by the file system plugin.
5 changes: 5 additions & 0 deletions .changes/resource-dir-ios.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tauri-utils": patch:bug
---

Fix `resource_dir` on iOS.
5 changes: 5 additions & 0 deletions .github/workflows/covector-version-or-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ jobs:
git config --global user.name "${{ github.event.pusher.name }}"
git config --global user.email "${{ github.event.pusher.email }}"
- name: install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev
- name: covector version or publish (publish when no change files present)
uses: jbolda/covector/packages/action@covector-v0
id: covector
Expand Down
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions core/tauri-build/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## \[2.0.0-rc.5]

### Dependencies

- Upgraded to `[email protected]`
- Upgraded to `[email protected]`

## \[2.0.0-rc.4]

### Bug Fixes
Expand Down
6 changes: 3 additions & 3 deletions core/tauri-build/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tauri-build"
version = "2.0.0-rc.4"
version = "2.0.0-rc.5"
description = "build time code to pair with https://crates.io/crates/tauri"
exclude = [ "CHANGELOG.md", "/target" ]
readme = "README.md"
Expand Down Expand Up @@ -28,8 +28,8 @@ rustdoc-args = [ "--cfg", "docsrs" ]
[dependencies]
anyhow = "1"
quote = { version = "1", optional = true }
tauri-codegen = { version = "2.0.0-rc.4", path = "../tauri-codegen", optional = true }
tauri-utils = { version = "2.0.0-rc.4", path = "../tauri-utils", features = [ "build", "resources" ] }
tauri-codegen = { version = "2.0.0-rc.5", path = "../tauri-codegen", optional = true }
tauri-utils = { version = "2.0.0-rc.5", path = "../tauri-utils", features = [ "build", "resources" ] }
cargo_toml = "0.17"
serde = "1"
serde_json = "1"
Expand Down
6 changes: 6 additions & 0 deletions core/tauri-codegen/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## \[2.0.0-rc.5]

### Dependencies

- Upgraded to `[email protected]`

## \[2.0.0-rc.4]

### Dependencies
Expand Down
4 changes: 2 additions & 2 deletions core/tauri-codegen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tauri-codegen"
version = "2.0.0-rc.4"
version = "2.0.0-rc.5"
description = "code generation meant to be consumed inside of `tauri` through `tauri-build` or `tauri-macros`"
exclude = [ "CHANGELOG.md", "/target" ]
readme = "README.md"
Expand All @@ -20,7 +20,7 @@ quote = "1"
syn = "2"
serde = { version = "1", features = [ "derive" ] }
serde_json = "1"
tauri-utils = { version = "2.0.0-rc.4", path = "../tauri-utils", features = [ "build" ] }
tauri-utils = { version = "2.0.0-rc.5", path = "../tauri-utils", features = [ "build" ] }
thiserror = "1"
walkdir = "2"
brotli = { version = "6", optional = true, default-features = false, features = [ "std" ] }
Expand Down
7 changes: 7 additions & 0 deletions core/tauri-macros/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## \[2.0.0-rc.5]

### Dependencies

- Upgraded to `[email protected]`
- Upgraded to `[email protected]`

## \[2.0.0-rc.4]

### Dependencies
Expand Down
6 changes: 3 additions & 3 deletions core/tauri-macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tauri-macros"
version = "2.0.0-rc.4"
version = "2.0.0-rc.5"
description = "Macros for the tauri crate."
exclude = [ "CHANGELOG.md", "/target" ]
readme = "README.md"
Expand All @@ -20,8 +20,8 @@ proc-macro2 = { version = "1", features = [ "span-locations" ] }
quote = "1"
syn = { version = "2", features = [ "full" ] }
heck = "0.5"
tauri-codegen = { version = "2.0.0-rc.4", default-features = false, path = "../tauri-codegen" }
tauri-utils = { version = "2.0.0-rc.4", path = "../tauri-utils" }
tauri-codegen = { version = "2.0.0-rc.5", default-features = false, path = "../tauri-codegen" }
tauri-utils = { version = "2.0.0-rc.5", path = "../tauri-utils" }

[features]
custom-protocol = [ ]
Expand Down
6 changes: 6 additions & 0 deletions core/tauri-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## \[2.0.0-rc.5]

### Dependencies

- Upgraded to `[email protected]`

## \[2.0.0-rc.4]

### Dependencies
Expand Down
4 changes: 2 additions & 2 deletions core/tauri-plugin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tauri-plugin"
version = "2.0.0-rc.4"
version = "2.0.0-rc.5"
description = "Build script and runtime Tauri plugin definitions"
authors = { workspace = true }
homepage = { workspace = true }
Expand Down Expand Up @@ -30,7 +30,7 @@ runtime = [ ]
[dependencies]
anyhow = { version = "1", optional = true }
serde = { version = "1", optional = true }
tauri-utils = { version = "2.0.0-rc.4", default-features = false, features = [ "build" ], path = "../tauri-utils" }
tauri-utils = { version = "2.0.0-rc.5", default-features = false, features = [ "build" ], path = "../tauri-utils" }
serde_json = { version = "1", optional = true }
glob = { version = "0.3", optional = true }
toml = { version = "0.8", optional = true }
Expand Down
7 changes: 7 additions & 0 deletions core/tauri-runtime-wry/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## \[2.0.0-rc.5]

### Dependencies

- Upgraded to `[email protected]`
- Upgraded to `[email protected]`

## \[2.0.0-rc.4]

### Dependencies
Expand Down
6 changes: 3 additions & 3 deletions core/tauri-runtime-wry/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tauri-runtime-wry"
version = "2.0.0-rc.4"
version = "2.0.0-rc.5"
description = "Wry bindings to the Tauri runtime"
exclude = [ "CHANGELOG.md", "/target" ]
readme = "README.md"
Expand All @@ -19,8 +19,8 @@ rustdoc-args = [ "--cfg", "docsrs" ]
[dependencies]
wry = { version = "0.42", default-features = false, features = [ "drag-drop", "protocol", "os-webview" ] }
tao = { version = "0.29", default-features = false, features = [ "rwh_06" ] }
tauri-runtime = { version = "2.0.0-rc.4", path = "../tauri-runtime" }
tauri-utils = { version = "2.0.0-rc.4", path = "../tauri-utils" }
tauri-runtime = { version = "2.0.0-rc.5", path = "../tauri-runtime" }
tauri-utils = { version = "2.0.0-rc.5", path = "../tauri-utils" }
raw-window-handle = "0.6"
http = "1.1"
url = "2"
Expand Down
6 changes: 6 additions & 0 deletions core/tauri-runtime/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## \[2.0.0-rc.5]

### Dependencies

- Upgraded to `[email protected]`

## \[2.0.0-rc.4]

### Dependencies
Expand Down
4 changes: 2 additions & 2 deletions core/tauri-runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tauri-runtime"
version = "2.0.0-rc.4"
version = "2.0.0-rc.5"
description = "Runtime for Tauri applications"
exclude = [ "CHANGELOG.md", "/target" ]
readme = "README.md"
Expand Down Expand Up @@ -29,7 +29,7 @@ targets = [
serde = { version = "1.0", features = [ "derive" ] }
serde_json = "1.0"
thiserror = "1.0"
tauri-utils = { version = "2.0.0-rc.4", path = "../tauri-utils" }
tauri-utils = { version = "2.0.0-rc.5", path = "../tauri-utils" }
http = "1.1"
raw-window-handle = "0.6"
url = { version = "2" }
Expand Down
7 changes: 7 additions & 0 deletions core/tauri-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## \[2.0.0-rc.5]

### Bug Fixes

- [`da381e07f`](https://www.github.com/tauri-apps/tauri/commit/da381e07f3770988fe6d0859a02331b87cc6723f) ([#10696](https://www.github.com/tauri-apps/tauri/pull/10696) by [@lucasfernog](https://www.github.com/tauri-apps/tauri/../../lucasfernog)) Implemented `resource_dir` on Android, which returns a URI that needs to be resolved using [AssetManager::open](https://developer.android.com/reference/android/content/res/AssetManager#open\(java.lang.String,%20int\)). This will be handled by the file system plugin.
- [`da381e07f`](https://www.github.com/tauri-apps/tauri/commit/da381e07f3770988fe6d0859a02331b87cc6723f) ([#10696](https://www.github.com/tauri-apps/tauri/pull/10696) by [@lucasfernog](https://www.github.com/tauri-apps/tauri/../../lucasfernog)) Fix `resource_dir` on iOS.

## \[2.0.0-rc.4]

### New Features
Expand Down
2 changes: 1 addition & 1 deletion core/tauri-utils/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tauri-utils"
version = "2.0.0-rc.4"
version = "2.0.0-rc.5"
description = "Utilities for Tauri"
exclude = [ "CHANGELOG.md", "/target" ]
readme = "README.md"
Expand Down
4 changes: 2 additions & 2 deletions core/tauri-utils/src/pattern/isolation.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,6 @@
}

setTimeout(waitUntilReady, readyIntervalMs)

document.currentScript.remove()
})()

document.currentScript?.remove()
14 changes: 14 additions & 0 deletions core/tauri-utils/src/platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ use crate::{Env, PackageInfo};

mod starting_binary;

#[cfg(target_os = "android")]
pub const ANDROID_ASSET_PROTOCOL_URI_PREFIX: &str = "asset://localhost/";

/// Platform target.
#[derive(PartialEq, Eq, Copy, Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
Expand Down Expand Up @@ -256,7 +259,13 @@ fn is_cargo_output_directory(path: &Path) -> bool {
/// `${exe_dir}/../lib/${exe_name}`.
///
/// On MacOS, it's `${exe_dir}../Resources` (inside .app).
///
/// On iOS, it's `${exe_dir}/assets`.
///
/// Android uses a special URI prefix that is resolved by the Tauri file system plugin `asset://localhost/`
pub fn resource_dir(package_info: &PackageInfo, env: &Env) -> crate::Result<PathBuf> {
#[cfg(target_os = "android")]
return Ok(PathBuf::from(ANDROID_ASSET_PROTOCOL_URI_PREFIX));
let exe = current_exe()?;
resource_dir_from(exe, package_info, env)
}
Expand Down Expand Up @@ -320,6 +329,11 @@ fn resource_dir_from<P: AsRef<Path>>(
.map_err(Into::into);
}

#[cfg(target_os = "ios")]
{
res = exe_dir.join("assets").canonicalize().map_err(Into::into);
}

res
}

Expand Down
Loading

0 comments on commit 155182b

Please sign in to comment.