pub fn bundle_project(settings: Settings) -> crate::Result<Vec<PathBuf>> {
  let mut paths = Vec::new();
  let package_types = settings.package_types()?;
  for package_type in &package_types {
    let mut bundle_paths = match package_type {
      PackageType::OsxBundle => {
        if package_types.clone().iter().any(|&t| t == PackageType::Dmg) {
          vec![]
        } else {
          osx_bundle::bundle_project(&settings)?
        }
      }
      PackageType::IosBundle => ios_bundle::bundle_project(&settings)?,
      #[cfg(target_os = "windows")]
      PackageType::WindowsMsi => msi_bundle::bundle_project(&settings)?,
      PackageType::Deb => deb_bundle::bundle_project(&settings)?,
      PackageType::Rpm => rpm_bundle::bundle_project(&settings)?,
      PackageType::AppImage => appimage_bundle::bundle_project(&settings)?,
      PackageType::Dmg => dmg_bundle::bundle_project(&settings)?,
    };
    paths.append(&mut bundle_paths);
  }

  settings.copy_resources(settings.project_out_directory())?;
  settings.copy_binaries(settings.project_out_directory())?;

  #[cfg(windows)]
  {
    if get_tauri_config().is_ok() {
      let exempt_output = Command::new("CheckNetIsolation")
        .args(&vec!["LoopbackExempt", "-s"])
        .output()
        .expect("failed to read LoopbackExempt -s");

      if !exempt_output.status.success() {
        panic!("Failed to execute CheckNetIsolation LoopbackExempt -s");
      }

      let output_str = String::from_utf8_lossy(&exempt_output.stdout).to_lowercase();
      if !output_str.contains("win32webviewhost_cw5n1h2txyewy") {
        println!("Running Loopback command");
        runas::Command::new("powershell")
          .args(&[
            "CheckNetIsolation LoopbackExempt -a -n=\"Microsoft.Win32WebViewHost_cw5n1h2txyewy\"",
          ])
          .force_prompt(true)
          .status()
          .expect("failed to run Loopback command");
      }
    }
  }

  print_finished(&paths)?;

  Ok(paths)
}
/// Bundles the project.
/// Returns the list of paths where the bundles can be found.
Bundles the project.
Returns the list of paths where the bundles can be found.
Bundles the project . Returns the list of paths where the bundles can be found .
pub fn bundle_project(settings: Settings) -> crate::Result<Vec<PathBuf>> {
  let mut paths = Vec::new();
  let package_types = settings.package_types()?;
  for package_type in &package_types {
    let mut bundle_paths = match package_type {
      PackageType::OsxBundle => {
        if package_types.clone().iter().any(|&t| t == PackageType::Dmg) {
          vec![]
        } else {
          osx_bundle::bundle_project(&settings)?
        }
      }
      PackageType::IosBundle => ios_bundle::bundle_project(&settings)?,
      #[cfg(target_os = "windows")]
      PackageType::WindowsMsi => msi_bundle::bundle_project(&settings)?,
      PackageType::Deb => deb_bundle::bundle_project(&settings)?,
      PackageType::Rpm => rpm_bundle::bundle_project(&settings)?,
      PackageType::AppImage => appimage_bundle::bundle_project(&settings)?,
      PackageType::Dmg => dmg_bundle::bundle_project(&settings)?,
    };
    paths.append(&mut bundle_paths);
  }
  settings.copy_resources(settings.project_out_directory())?;
  settings.copy_binaries(settings.project_out_directory())?;
  #[cfg(windows)]
  {
    if get_tauri_config().is_ok() {
      let exempt_output = Command::new("CheckNetIsolation")
        .args(&vec!["LoopbackExempt", "-s"])
        .output()
        .expect("failed to read LoopbackExempt -s");
      if !exempt_output.status.success() {
        panic!("Failed to execute CheckNetIsolation LoopbackExempt -s");
      }
      let output_str = String::from_utf8_lossy(&exempt_output.stdout).to_lowercase();
      if !output_str.contains("win32webviewhost_cw5n1h2txyewy") {
        println!("Running Loopback command");
        runas::Command::new("powershell")
          .args(&[
            "CheckNetIsolation LoopbackExempt -a -n=\"Microsoft.Win32WebViewHost_cw5n1h2txyewy\"",
          ])
          .force_prompt(true)
          .status()
          .expect("failed to run Loopback command");
      }
    }
  }
  print_finished(&paths)?;
  Ok(paths)
}
pub fn bundle_project ( settings : Settings ) -> crate :: Result < Vec < PathBuf > > { let mut paths = Vec :: new ( ) ; let package_types = settings . package_types ( ) ? ; for package_type in & package_types { let mut bundle_paths = match package_type { PackageType :: OsxBundle => { if package_types . clone ( ) . iter ( ) . any ( | & t | t == PackageType :: Dmg ) { vec ! [ ] } else { osx_bundle :: bundle_project ( & settings ) ? } } PackageType :: IosBundle => ios_bundle :: bundle_project ( & settings ) ? , # [ cfg ( target_os " " ) ] PackageType :: WindowsMsi => msi_bundle :: bundle_project ( & settings ) ? , PackageType :: Deb => deb_bundle :: bundle_project ( & settings ) ? , PackageType :: Rpm => rpm_bundle :: bundle_project ( & settings ) ? , PackageType :: AppImage => appimage_bundle :: bundle_project ( & settings ) ? , PackageType :: Dmg => dmg_bundle :: bundle_project ( & settings ) ? , } ; paths . append ( & mut bundle_paths ) ; } settings . copy_resources ( settings . project_out_directory ( ) ) ? ; settings . copy_binaries ( settings . project_out_directory ( ) ) ? ; # [ cfg ( windows ) ] { if get_tauri_config ( ) . is_ok ( ) { let exempt_output = Command :: new ( " " ) . args ( & vec ! [ " " " " ] ) . output ( ) . expect ( " " ) ; if ! exempt_output . status . success ( ) { panic ! ( " " ) ; } let output_str = String :: from_utf8_lossy ( & exempt_output . stdout ) . to_lowercase ( ) ; if ! output_str . contains ( " " ) { println ! ( " " ) ; runas :: Command :: new ( " " ) . args ( & [ " \" \" " , ] ) . force_prompt ( true ) . status ( ) . expect ( " " ) ; } } } print_finished ( & paths ) ? ; Ok ( paths ) }
Bundles the project.
Bundles the project .
settings
Settings
settings
Settings