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() {
#[allow(unused_mut)]
let mut context = tauri::generate_context!();
println!("{}", tauri::__TAURI_BUNDLE_TYPE);
tauri::Builder::default()
.plugin(tauri_plugin_updater::Builder::new().build())
.setup(|app| {

@ -119,8 +119,11 @@ fn target_to_platforms(
update_platform: Option<String>,
signature: String,
) -> HashMap<String, PlatformUpdate> {
let mut platforms = HashMap::new();
if let Some(platform) = update_platform {
println!("TARGET: {}", platform.clone());
platforms.insert(
platform,
PlatformUpdate {
@ -201,24 +204,60 @@ fn bundle_path(root_dir: &Path, _version: &str, v1compatible: bool) -> PathBuf {
}
#[cfg(windows)]
fn bundle_paths(
fn test_cases(
root_dir: &Path,
version: &str,
v1compatible: bool,
) -> Vec<(BundleTarget, PathBuf)> {
target: String
) -> Vec<(BundleTarget, PathBuf, Option<String>, Vec<i32>)> {
vec![
(
BundleTarget::Nsis,
root_dir.join(format!(
"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,
root_dir.join(format!(
"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