Merge branch 'feature/fallback_targets' of github.com:kandrelczyk/plugins-workspace into feature/fallback_targets

pull/2624/head
Krzysztof Andrelczyk 3 months ago
commit 0630002c65

@ -9,6 +9,7 @@ use tauri_plugin_updater::UpdaterExt;
fn main() { fn main() {
#[allow(unused_mut)] #[allow(unused_mut)]
let mut context = tauri::generate_context!(); let mut context = tauri::generate_context!();
println!("{}", tauri::__TAURI_BUNDLE_TYPE);
tauri::Builder::default() tauri::Builder::default()
.plugin(tauri_plugin_updater::Builder::new().build()) .plugin(tauri_plugin_updater::Builder::new().build())
.setup(|app| { .setup(|app| {

@ -119,8 +119,11 @@ fn target_to_platforms(
update_platform: Option<String>, update_platform: Option<String>,
signature: String, signature: String,
) -> HashMap<String, PlatformUpdate> { ) -> HashMap<String, PlatformUpdate> {
let mut platforms = HashMap::new(); let mut platforms = HashMap::new();
if let Some(platform) = update_platform { if let Some(platform) = update_platform {
println!("TARGET: {}", platform.clone());
platforms.insert( platforms.insert(
platform, platform,
PlatformUpdate { PlatformUpdate {
@ -201,24 +204,60 @@ fn bundle_path(root_dir: &Path, _version: &str, v1compatible: bool) -> PathBuf {
} }
#[cfg(windows)] #[cfg(windows)]
fn bundle_paths( fn test_cases(
root_dir: &Path, root_dir: &Path,
version: &str, version: &str,
v1compatible: bool, target: String
) -> Vec<(BundleTarget, PathBuf)> { ) -> Vec<(BundleTarget, PathBuf, Option<String>, Vec<i32>)> {
vec![ vec![
( (
BundleTarget::Nsis, BundleTarget::Nsis,
root_dir.join(format!( root_dir.join(format!(
"target/debug/bundle/nsis/app-updater_{version}_x64-setup.exe" "target/debug/bundle/nsis/app-updater_{version}_x64-setup.exe"
)), )),
Some(target.clone()),
vec![UPDATED_EXIT_CODE]
),
(
BundleTarget::Nsis,
root_dir.join(format!(
"target/debug/bundle/nsis/app-updater_{version}_x64-setup.exe"
)),
Some(format!("{target}-{}", BundleTarget::Nsis.name())),
vec![UPDATED_EXIT_CODE]
),
(
BundleTarget::Nsis,
root_dir.join(format!(
"target/debug/bundle/nsis/app-updater_{version}_x64-setup.exe"
)),
None,
vec![ERROR_EXIT_CODE]
), ),
( (
BundleTarget::Msi, BundleTarget::Msi,
root_dir.join(format!( root_dir.join(format!(
"target/debug/bundle/msi/app-updater_{version}_x64_en-US.msi" "target/debug/bundle/msi/app-updater_{version}_x64_en-US.msi"
)), )),
Some(target.clone()),
vec![UPDATED_EXIT_CODE]
), ),
(
BundleTarget::Msi,
root_dir.join(format!(
"target/debug/bundle/msi/app-updater_{version}_x64_en-US.msi"
)),
Some(format!("{target}-{}", BundleTarget::Msi.name())),
vec![UPDATED_EXIT_CODE]
),
(
BundleTarget::Msi,
root_dir.join(format!(
"target/debug/bundle/msi/app-updater_{version}_x64_en-US.msi"
)),
None,
vec![ERROR_EXIT_CODE]
)
] ]
} }

Loading…
Cancel
Save