mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-28 21:45:00 +03:00
This commit is contained in:
parent
0180dcc812
commit
95726ebb61
6
.changes/validate-bundle-identifier.md
Normal file
6
.changes/validate-bundle-identifier.md
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
"cli.rs": patch
|
||||
"cli.js": patch
|
||||
---
|
||||
|
||||
Prevent building when the bundle identifier is the default `com.tauri.dev`.
|
@ -19,8 +19,7 @@ exclude = [
|
||||
"examples/api/src-tauri",
|
||||
"examples/updater/src-tauri",
|
||||
"examples/resources/src-tauri",
|
||||
"examples/sidecar/src-tauri",
|
||||
"examples/isolation/src-tauri"
|
||||
"examples/sidecar/src-tauri"
|
||||
]
|
||||
|
||||
# default to small, optimized workspace release binaries
|
||||
|
@ -21,7 +21,7 @@
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"targets": "all",
|
||||
"identifier": "com.tauri.isolation",
|
||||
"identifier": "com.tauri.dev",
|
||||
"icon": [
|
||||
"../.icons/32x32.png",
|
||||
"../.icons/128x128.png",
|
||||
|
@ -11,7 +11,7 @@
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"targets": "all",
|
||||
"identifier": "com.tauri.dev",
|
||||
"identifier": "com.tauri.resources",
|
||||
"icon": [
|
||||
"../../.icons/32x32.png",
|
||||
"../../.icons/128x128.png",
|
||||
|
@ -11,7 +11,7 @@
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"targets": "all",
|
||||
"identifier": "com.tauri.dev",
|
||||
"identifier": "com.tauri.sidecar",
|
||||
"icon": [
|
||||
"../../.icons/32x32.png",
|
||||
"../../.icons/128x128.png",
|
||||
|
@ -10,7 +10,7 @@
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"targets": "all",
|
||||
"identifier": "com.tauri.dev",
|
||||
"identifier": "com.tauri.updater",
|
||||
"icon": [
|
||||
"../../.icons/32x32.png",
|
||||
"../../.icons/128x128.png",
|
||||
|
@ -39,6 +39,10 @@ describe('[CLI] cli.js template', () => {
|
||||
const manifestFile = readFileSync(manifestPath).toString()
|
||||
writeFileSync(manifestPath, `workspace = { }\n${manifestFile}`)
|
||||
|
||||
const configPath = resolve(tauriFixturePath, 'tauri.conf.json')
|
||||
const config = readFileSync(configPath).toString()
|
||||
writeFileSync(configPath, config.replace('com.tauri.dev', 'com.tauri.test'))
|
||||
|
||||
await cli.run(['build', '--verbose']).catch(err => {
|
||||
console.error(err)
|
||||
throw err
|
||||
|
@ -70,6 +70,11 @@ pub fn command(options: Options) -> Result<()> {
|
||||
let config_guard = config.lock().unwrap();
|
||||
let config_ = config_guard.as_ref().unwrap();
|
||||
|
||||
if config_.tauri.bundle.identifier == "com.tauri.dev" {
|
||||
logger.error("You must change the bundle identifier in `tauri.conf.json > tauri > bundle > identifier`. The default value `com.tauri.dev` is not allowed as it must be unique across applications.");
|
||||
std::process::exit(1);
|
||||
}
|
||||
|
||||
if let Some(before_build) = &config_.build.before_build_command {
|
||||
if !before_build.is_empty() {
|
||||
logger.log(format!("Running `{}`", before_build));
|
||||
|
Loading…
Reference in New Issue
Block a user