Skip to content

Commit 8b166e9

Browse files
amrbashirFabianLarslucasfernog
authored
refactor!: consistent environment variables (#7949)
Co-authored-by: Fabian-Lars <fabianlars@fabianlars.de> Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
1 parent c9a9246 commit 8b166e9

File tree

24 files changed

+130
-104
lines changed

24 files changed

+130
-104
lines changed

.changes/cli-env-vars.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'tauri-cli': 'major:breaking'
3+
'@tauri-apps/cli': 'major:breaking'
4+
---
5+
6+
Changed a number of environment variables used by tauri CLI for consistency and clarity:
7+
8+
- `TAURI_PRIVATE_KEY` -> `TAURI_SIGNING_PRIVATE_KEY`
9+
- `TAURI_KEY_PASSWORD` -> `TAURI_SIGNING_PRIVATE_KEY_PASSWORD`
10+
- `TAURI_SKIP_DEVSERVER_CHECK` -> `TAURI_CLI_NO_DEV_SERVER_WAIT`
11+
- `TAURI_DEV_SERVER_PORT` -> `TAURI_CLI_PORT`
12+
- `TAURI_PATH_DEPTH` -> `TAURI_CLI_CONFIG_DEPTH`
13+
- `TAURI_FIPS_COMPLIANT` -> `TAURI_BUNDLER_WIX_FIPS_COMPLIANT`
14+
- `TAURI_DEV_WATCHER_IGNORE_FILE` -> `TAURI_CLI_WATCHER_IGNORE_FILENAME`
15+
- `TAURI_TRAY` -> `TAURI_LINUX_AYATANA_APPINDICATOR`
16+
- `TAURI_APPLE_DEVELOPMENT_TEAM` -> `APPLE_DEVELOPMENT_TEAM`

.changes/cli-no-dev-server-wait.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'tauri-cli': 'minor:feat'
3+
'@tauri-apps/cli': 'minor:feat'
4+
---
5+
6+
Add `--no-dev-server-wait` option to skip waiting for the dev server to start when using `tauri dev`.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'tauri-cli': 'major:breaking'
3+
'@tauri-apps/cli': 'major:breaking'
4+
---
5+
6+
Removed checking for a new version of the CLI.

.changes/tauri-env-vars.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'tauri-runtime-wry': 'major:breaking'
3+
---
4+
5+
Check if automation is enabled with the `TAURI_WEBVIEW_AUTOMATION` environment variable instead of `TAURI_AUTOMATION`.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'tauri': 'major:breaking'
3+
---
4+
5+
Changed `TAURI_AUTOMATION` to `TAURI_WEBVIEW_AUTOMATION`

core/tauri-config-schema/schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1762,7 +1762,7 @@
17621762
"type": "object",
17631763
"properties": {
17641764
"developmentTeam": {
1765-
"description": "The development team. This value is required for iOS development because code signing is enforced. The `TAURI_APPLE_DEVELOPMENT_TEAM` environment variable can be set to overwrite it.",
1765+
"description": "The development team. This value is required for iOS development because code signing is enforced. The `APPLE_DEVELOPMENT_TEAM` environment variable can be set to overwrite it.",
17661766
"type": [
17671767
"string",
17681768
"null"

core/tauri-runtime-wry/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2697,7 +2697,7 @@ fn create_webview<T: UserEvent, F: Fn(RawWindow) + Send + 'static>(
26972697

26982698
let mut web_context = web_context_store.lock().expect("poisoned WebContext store");
26992699
let is_first_context = web_context.is_empty();
2700-
let automation_enabled = std::env::var("TAURI_AUTOMATION").as_deref() == Ok("true");
2700+
let automation_enabled = std::env::var("TAURI_WEBVIEW_AUTOMATION").as_deref() == Ok("true");
27012701
let web_context_key = // force a unique WebContext when automation is false;
27022702
// the context must be stored on the HashMap because it must outlive the WebView on macOS
27032703
if automation_enabled {

core/tauri-utils/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1582,7 +1582,7 @@ pub struct TrayIconConfig {
15821582
#[serde(rename_all = "camelCase", deny_unknown_fields)]
15831583
pub struct IosConfig {
15841584
/// The development team. This value is required for iOS development because code signing is enforced.
1585-
/// The `TAURI_APPLE_DEVELOPMENT_TEAM` environment variable can be set to overwrite it.
1585+
/// The `APPLE_DEVELOPMENT_TEAM` environment variable can be set to overwrite it.
15861586
#[serde(alias = "development-team")]
15871587
pub development_team: Option<String>,
15881588
}

tooling/bundler/src/bundle/linux/templates/appimage

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set -euxo pipefail
88
export ARCH={{arch}}
99
APPIMAGE_BUNDLE_XDG_OPEN=${APPIMAGE_BUNDLE_XDG_OPEN-0}
1010
APPIMAGE_BUNDLE_GSTREAMER=${APPIMAGE_BUNDLE_GSTREAMER-0}
11-
TRAY_LIBRARY_PATH=${TRAY_LIBRARY_PATH-0}
11+
TAURI_TRAY_LIBRARY_PATH=${TAURI_TRAY_LIBRARY_PATH-0}
1212

1313
if [ "$ARCH" == "i686" ]; then
1414
linuxdeploy_arch="i386"
@@ -28,15 +28,15 @@ if [[ "$APPIMAGE_BUNDLE_XDG_OPEN" != "0" ]] && [[ -f "/usr/bin/xdg-open" ]]; the
2828
cp /usr/bin/xdg-open usr/bin
2929
fi
3030

31-
if [[ "$TRAY_LIBRARY_PATH" != "0" ]]; then
32-
echo "Copying appindicator library ${TRAY_LIBRARY_PATH}"
33-
cp ${TRAY_LIBRARY_PATH} usr/lib
31+
if [[ "$TAURI_TRAY_LIBRARY_PATH" != "0" ]]; then
32+
echo "Copying appindicator library ${TAURI_TRAY_LIBRARY_PATH}"
33+
cp ${TAURI_TRAY_LIBRARY_PATH} usr/lib
3434
# It looks like we're practicing good hygiene by adding the ABI version.
3535
# But for compatibility we'll symlink this file to what we did before.
3636
# Specifically this prevents breaking libappindicator-sys v0.7.1 and v0.7.2.
37-
if [[ "$TRAY_LIBRARY_PATH" == *.so.1 ]]; then
38-
readonly soname=$(basename "$TRAY_LIBRARY_PATH")
39-
readonly old_name=$(basename "$TRAY_LIBRARY_PATH" .1)
37+
if [[ "$TAURI_TRAY_LIBRARY_PATH" == *.so.1 ]]; then
38+
readonly soname=$(basename "$TAURI_TRAY_LIBRARY_PATH")
39+
readonly old_name=$(basename "$TAURI_TRAY_LIBRARY_PATH" .1)
4040
echo "Adding compatibility symlink ${old_name} -> ${soname}"
4141
ln -s ${soname} usr/lib/${old_name}
4242
fi

tooling/cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jsonrpsee-ws-client = { version = "0.16", default-features = false }
4848
thiserror = "1"
4949
sublime_fuzzy = "0.7"
5050
clap_complete = "4"
51-
clap = { version = "4.0", features = [ "derive" ] }
51+
clap = { version = "4.0", features = [ "derive", "env" ] }
5252
anyhow = "1.0"
5353
tauri-bundler = { version = "2.0.0-alpha.9", default-features = false, path = "../bundler" }
5454
colored = "2.0"

0 commit comments

Comments
 (0)