mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-08-16 11:20:28 +03:00
fix: use $CARGO_MANIFEST_DIR to fully specify include_dir paths in tauri-cli (#9310)
* Allow tauri-cli to work with Bazel. Signed-off-by: Scott Pledger <scottpledger2005@gmail.com> * change file --------- Signed-off-by: Scott Pledger <scottpledger2005@gmail.com>
This commit is contained in:
parent
5bd47b4467
commit
6703b7cbca
5
.changes/cli-include-dir-cargo-manifest-dir.md
Normal file
5
.changes/cli-include-dir-cargo-manifest-dir.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"tauri-cli": patch:enhance
|
||||||
|
---
|
||||||
|
|
||||||
|
Use `$CARGO_MANIFEST_DIR` when including templates at build-time.
|
@ -22,7 +22,7 @@ use clap::Parser;
|
|||||||
use handlebars::{to_json, Handlebars};
|
use handlebars::{to_json, Handlebars};
|
||||||
use include_dir::{include_dir, Dir};
|
use include_dir::{include_dir, Dir};
|
||||||
|
|
||||||
const TEMPLATE_DIR: Dir<'_> = include_dir!("templates/app");
|
const TEMPLATE_DIR: Dir<'_> = include_dir!("$CARGO_MANIFEST_DIR/templates/app");
|
||||||
const TAURI_CONF_TEMPLATE: &str = include_str!("../templates/tauri.conf.json");
|
const TAURI_CONF_TEMPLATE: &str = include_str!("../templates/tauri.conf.json");
|
||||||
|
|
||||||
#[derive(Debug, Parser)]
|
#[derive(Debug, Parser)]
|
||||||
|
@ -27,7 +27,7 @@ use std::{
|
|||||||
path::{Path, PathBuf},
|
path::{Path, PathBuf},
|
||||||
};
|
};
|
||||||
|
|
||||||
const TEMPLATE_DIR: Dir<'_> = include_dir!("templates/mobile/android");
|
const TEMPLATE_DIR: Dir<'_> = include_dir!("$CARGO_MANIFEST_DIR/templates/mobile/android");
|
||||||
|
|
||||||
pub fn gen(
|
pub fn gen(
|
||||||
config: &Config,
|
config: &Config,
|
||||||
|
@ -22,7 +22,7 @@ use std::{
|
|||||||
path::{Component, PathBuf},
|
path::{Component, PathBuf},
|
||||||
};
|
};
|
||||||
|
|
||||||
const TEMPLATE_DIR: Dir<'_> = include_dir!("templates/mobile/ios");
|
const TEMPLATE_DIR: Dir<'_> = include_dir!("$CARGO_MANIFEST_DIR/templates/mobile/ios");
|
||||||
|
|
||||||
// unprefixed app_root seems pretty dangerous!!
|
// unprefixed app_root seems pretty dangerous!!
|
||||||
// TODO: figure out what cargo-mobile meant by that
|
// TODO: figure out what cargo-mobile meant by that
|
||||||
|
@ -20,7 +20,7 @@ use std::{
|
|||||||
path::{Component, Path, PathBuf},
|
path::{Component, Path, PathBuf},
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const TEMPLATE_DIR: Dir<'_> = include_dir!("templates/plugin");
|
pub const TEMPLATE_DIR: Dir<'_> = include_dir!("$CARGO_MANIFEST_DIR/templates/plugin");
|
||||||
|
|
||||||
#[derive(Debug, Parser)]
|
#[derive(Debug, Parser)]
|
||||||
#[clap(about = "Initialize a Tauri plugin project on an existing directory")]
|
#[clap(about = "Initialize a Tauri plugin project on an existing directory")]
|
||||||
|
Loading…
Reference in New Issue
Block a user