tauri/examples/tauri-dynamic-lib
Amr Bashir e1e85dc2a5
chore: fix ci and cleanup leftovers (#6925)
* chore: fix ci and cleanup leftovers

1. removed leftover feature flags
2. remove zip/extract apis which are not used anymore
3. removed leftoever scopes
4. removed leftover allowlist and updater options
5. updated the example api

* remove leftover updater structs

* move updater under bundle and remove uneeded options

* fix cli on linux

* remove create_proxy

* clippy

* more clippy

* clippppy

* readd path api

* fix api example

* remove window allowlist

* remove window from allowlist config

* remove `all` allowlist option

* remove file_move

* lint

* fix windows build

* remvoe unused deps

* remvoe allowlist config option, move protocol to `security > asset_protocol`

* fix diffing features

* fmt and test

* fix scope alias

* change files

* android lint

* simplify allow_file impl

* Revert "simplify allow_file impl"

This reverts commit b8882f2fd0.

* expose scopes

* remove unused error variants

* protocol-asset on docs.rs

* ignore reqwest on udeps

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2023-05-13 13:48:28 +03:00
..
src-app1 feat: update MSRV to 1.65 (#6883) 2023-05-06 17:16:52 -03:00
src-tauri chore: fix ci and cleanup leftovers (#6925) 2023-05-13 13:48:28 +03:00
README.md docs(examples): add missing Readme and clarify existing (#3327) 2022-02-04 17:56:57 -03:00

Readme

This is an example of compiling tauri as a dynamic shared library and running it from another app.

  • src-tauri is an example of a library containing code to launch a tauri webview window.
  • src-app1 is a small example of calling tauri from a dynamic shared library through FFI.

Note that bundling of resources via tauri.conf.json may not work in some cases due to the nature of the build. So you have to be aware of copying any files needed to the correct paths for html / js etc.

Rust libraries

Typically there are 3 types of libraries rust can generate

  • rlib - rust static libraries
  • dylib - rust shared libraries
  • cdylib - dynamic shared libraries that can be used to interop with other languages.

Typically cdylib libraries are used for interop with C / C++ Projects but this can also include other languages. The src-tauri example uses the cdylib crate type

Building / Running

# First build the library
cd src-tauri
cargo build
cd ..

# Next build the app
cd src-app1
cargo build

# Next run the app
cargo run