You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: cli/tauri-bundler/README.md
+56-68
Original file line number
Diff line number
Diff line change
@@ -1,31 +1,14 @@
1
-
# Cargo Tauri Bundle
1
+
# Tauri Bundler
2
2
3
-
Wrap Rust executables in OS-specific app bundles
3
+
Wrap Rust executables in OS-specific app bundles.
4
4
5
5
## About
6
6
7
-
`cargo tauri-bundle` is a tool used to generate installers or app bundles for GUI
8
-
executables built with `cargo`. It can create `.app` bundles for Mac OS X and
9
-
iOS, `.deb` packages for Linux, and `.msi` installers for Windows (note however
10
-
that iOS and Windows support is still experimental). Support for creating
11
-
`.rpm` packages (for Linux) and `.apk` packages (for Android) is still pending.
7
+
This is a fork of the awesome [cargo-bundle](https://github.com/burtonageo/cargo-bundle), turned into a library used by the [Tauri CLI](../core).
12
8
13
-
To install `cargo tauri-bundle`, run `cargo install cargo-tauri-bundle`. This will add the most recent version of `cargo-bundle`
14
-
published to [crates.io](https://crates.io/crates/cargo-bundle) as a subcommand to your default `cargo` installation.
9
+
## Configuration
15
10
16
-
To start using `cargo tauri-bundle`, add a `[package.metadata.bundle]` section to your project's `Cargo.toml` file. This
17
-
section describes various attributes of the generated bundle, such as its name, icon, description, copyright, as well
18
-
as any packaging scripts you need to generate extra data. The full manifest format is described below.
19
-
20
-
To build a bundle for the OS you're on, simply run `cargo tauri-bundle` in your
21
-
project's directory (where the `Cargo.toml` is placed). If you would like to
22
-
bundle a release build, you must add the `--release` flag to your call. To
23
-
cross-compile and bundle an application for another OS, add an appropriate
24
-
`--target` flag, just as you would for `cargo build`.
25
-
26
-
## Bundle manifest format
27
-
28
-
There are several fields in the `[package.metadata.bundle]` section.
11
+
Tauri automatically loads configurations from the `tauri.conf.json > tauri > bundle` object, but this library doesn't rely on it and can be used by non-Tauri apps.
29
12
30
13
### General settings
31
14
@@ -39,22 +22,20 @@ These settings apply to bundles for all (or most) OSes.
39
22
bundle's `CFBundleIdentifier` value; for Windows, this is hashed to create
40
23
an application GUID.
41
24
*`icon`: [OPTIONAL] The icons used for your application. This should be an array of file paths or globs (with images
42
-
in various sizes/formats); `cargo-bundle` will automatically convert between image formats as necessary for
25
+
in various sizes/formats); `tauri-bundler` will automatically convert between image formats as necessary for
43
26
different platforms. Supported formats include ICNS, ICO, PNG, and anything else that can be decoded by the
44
27
[`image`](https://crates.io/crates/image) crate. Icons intended for high-resolution (e.g. Retina) displays
45
28
should have a filename with `@2x` just before the extension (see example below).
46
29
*`version`: [OPTIONAL] The version of the application. If this is not present, then it will use the `version`
47
30
value from your `Cargo.toml` file.
48
31
*`resources`: [OPTIONAL] List of files or directories which will be copied to the resources section of the
49
32
bundle. Globs are supported.
50
-
*`script`: [OPTIONAL] This is a reserved field; at the moment it is not used for anything, but may be used to
51
-
run scripts while packaging the bundle (e.g. download files, compress and encrypt, etc.).
52
33
*`copyright`: [OPTIONAL] This contains a copyright string associated with your application.
53
34
*`category`: [OPTIONAL] What kind of application this is. This can
54
35
be a human-readable string (e.g. `"Puzzle game"`), or a Mac OS X
55
36
LSApplicationCategoryType value
56
37
(e.g. `"public.app-category.puzzle-games"`), or a GNOME desktop
57
-
file category name (e.g. `"LogicGame"`), and `cargo-bundle` will
38
+
file category name (e.g. `"LogicGame"`), and `tauri-bundler` will
58
39
automatically convert as needed for different platforms.
59
40
*`short_description`: [OPTIONAL] A short, one-line description of the application. If this is not present, then it
60
41
will use the `description` value from your `Cargo.toml` file.
@@ -64,72 +45,79 @@ These settings apply to bundles for all (or most) OSes.
64
45
65
46
These settings are used only when bundling `deb` packages.
66
47
67
-
*`deb_depends`: A list of strings indicating other packages (e.g. shared
48
+
*`depends`: A list of strings indicating other packages (e.g. shared
68
49
libraries) that this package depends on to be installed. If present, this
69
50
forms the `Depends:` field of the `deb` package control file.
51
+
*`use_bootstrapper`: Enables the bootstrapper script, which allows access to the environment variables.
70
52
71
53
### Mac OS X-specific settings
72
54
73
-
These settings are used only when bundling `osx` packages.
55
+
These settings are used only when bundling `app` and `dmg` packages.
74
56
75
-
*`osx_frameworks`: A list of strings indicating any Mac OS X frameworks that
57
+
*`frameworks`: A list of strings indicating any Mac OS X frameworks that
76
58
need to be bundled with the app. Each string can either be the name of a
77
59
framework (without the `.framework` extension, e.g. `"SDL2"`), in which case
78
-
`cargo-bundle` will search for that framework in the standard install
60
+
`tauri-bundler` will search for that framework in the standard install
79
61
locations (`~/Library/Frameworks/`, `/Library/Frameworks/`, and
80
62
`/Network/Library/Frameworks/`), or a path to a specific framework bundle
81
63
(e.g. `./data/frameworks/SDL2.framework`). Note that this setting just makes
82
-
`cargo-bundle` copy the specified frameworks into the OS X app bundle (under
64
+
`tauri-bundler` copy the specified frameworks into the OS X app bundle (under
83
65
`Foobar.app/Contents/Frameworks/`); you are still responsible for (1)
84
66
arranging for the compiled binary to link against those frameworks (e.g. by
85
67
emitting lines like `cargo:rustc-link-lib=framework=SDL2` from your
86
68
`build.rs` script), and (2) embedding the correct rpath in your binary
87
69
(e.g. by running `install_name_tool -add_rpath
88
70
"@executable_path/../Frameworks" path/to/binary` after compiling).
89
-
*`osx_minimum_system_version`: A version string indicating the minimum Mac OS
71
+
*`minimum_system_version`: A version string indicating the minimum Mac OS
90
72
X version that the bundled app supports (e.g. `"10.11"`). If you are using
91
73
this config field, you may also want have your `build.rs` script emit
92
74
`cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET=10.11` (or whatever version number
93
75
you want) to ensure that the compiled binary has the same minimum version.
*`license`: Path to the license file for the DMG bundle.
77
+
*`exception_domain`: The exception domain to use on the macOS .app bundle. Allows communication to the outside world e.g. a web server you're shipping.
78
+
*`use_bootstrapper`: Enables the bootstrapper script, which allows access to the environment variables.
79
+
80
+
### Example `tauri.conf.json`:
81
+
82
+
```json
83
+
{
84
+
"package": {
85
+
"productName": "Your Awesome App",
86
+
"version": "0.1.0"
87
+
},
88
+
"tauri": {
89
+
"bundle": {
90
+
"active": true,
91
+
"identifier": "com.my.app",
92
+
"shortDescription": "",
93
+
"longDescription": "",
94
+
"copyright": "Copyright (c) You 2021. All rights reserved.",
0 commit comments