Эх сурвалжийг харах

Update bundler crates. Fix errors related to updated versions of images and uuid. (#72) (#106)

kastenbutt 5 жил өмнө
parent
commit
ec2b9092ed

+ 14 - 16
cli/tauri-cli/Cargo.toml

@@ -9,37 +9,35 @@ description = "Wrap rust executables in OS-specific app bundles for Tauri"
 edition = "2018"
 
 [dependencies]
-ar = "0.3"
-cab = "0.1"
+ar = "0.8.0"
 chrono = "0.4"
 clap = "^2"
-dirs = "1.0"
+dirs = "2.0.2"
 error-chain = "0.12"
-glob = "0.2"
-icns = "^0.2"
-image = "0.12"
+glob = "0.3.0"
+icns = "0.3"
+image = "0.22.3"
 libflate = "0.1"
-md5 = "0.3"
+md5 = "0.7.0"
 msi = "0.2"
 
 serde = "1.0"
 serde_derive = "1.0"
-strsim = "0.7"
+strsim = "0.9.2"
 tar = "0.4"
 target_build_utils = "0.3"
-term = "0.4"
-toml = "0.4"
-uuid = { version = "0.5", features = ["v5"] }
+term = "0.6.1"
+toml = "0.5.5"
+uuid = { version = "0.8", features = ["v5"] }
 walkdir = "2"
 
 sha2 = "0.8"
-lazy_static = "1.3"
-handlebars = "1.1"
-reqwest = "0.9.19"
-hex = "0.3"
+lazy_static = "1.4"
+handlebars = "2.0"
+reqwest = "0.9.22"
+hex = "0.4"
 zip = "0.5"
 
 
 [dev-dependencies]
 tempfile = "3"
-winit = "0.11"

+ 5 - 3
cli/tauri-cli/src/bundle/deb_bundle.rs

@@ -23,7 +23,7 @@ use crate::{ResultExt, Settings};
 use ar;
 use icns;
 use image::png::{PNGDecoder, PNGEncoder};
-use image::{self, GenericImage, ImageDecoder};
+use image::{self, GenericImageView, ImageDecoder};
 use libflate::gzip;
 use md5;
 use std::collections::BTreeSet;
@@ -31,6 +31,7 @@ use std::ffi::OsStr;
 use std::fs::{self, File};
 use std::io::{self, Write};
 use std::path::{Path, PathBuf};
+use std::convert::TryInto;
 use tar;
 use walkdir::WalkDir;
 
@@ -230,8 +231,9 @@ fn generate_icon_files(settings: &Settings, data_dir: &PathBuf) -> crate::Result
     if icon_path.extension() != Some(OsStr::new("png")) {
       continue;
     }
-    let mut decoder = PNGDecoder::new(File::open(&icon_path)?);
-    let (width, height) = decoder.dimensions()?;
+    let mut decoder = PNGDecoder::new(File::open(&icon_path)?)?;
+    let width = decoder.dimensions().0.try_into().unwrap();
+    let height = decoder.dimensions().1.try_into().unwrap();
     let is_high_density = common::is_retina(&icon_path);
     if !sizes.contains(&(width, height, is_high_density)) {
       sizes.insert((width, height, is_high_density));

+ 5 - 3
cli/tauri-cli/src/bundle/ios_bundle.rs

@@ -12,12 +12,13 @@ use super::common;
 use crate::{ResultExt, Settings};
 use icns;
 use image::png::{PNGDecoder, PNGEncoder};
-use image::{self, GenericImage, ImageDecoder};
+use image::{self, GenericImageView, ImageDecoder};
 use std::collections::BTreeSet;
 use std::ffi::OsStr;
 use std::fs::{self, File};
 use std::io::Write;
 use std::path::{Path, PathBuf};
+use std::convert::TryInto;
 
 pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
   common::print_warning("iOS bundle support is still experimental.")?;
@@ -74,8 +75,9 @@ fn generate_icon_files(bundle_dir: &Path, settings: &Settings) -> crate::Result<
       if icon_path.extension() != Some(OsStr::new("png")) {
         continue;
       }
-      let mut decoder = PNGDecoder::new(File::open(&icon_path)?);
-      let (width, height) = decoder.dimensions()?;
+      let mut decoder = PNGDecoder::new(File::open(&icon_path)?)?;
+      let width = decoder.dimensions().0.try_into().unwrap();
+      let height = decoder.dimensions().1.try_into().unwrap();
       let is_retina = common::is_retina(&icon_path);
       if !sizes.contains(&(width, height, is_retina)) {
         sizes.insert((width, height, is_retina));

+ 1 - 1
cli/tauri-cli/src/bundle/osx_bundle.rs

@@ -22,7 +22,7 @@ use crate::{ResultExt, Settings};
 use chrono;
 use dirs;
 use icns;
-use image::{self, GenericImage};
+use image::{self, GenericImageView};
 use std::cmp::min;
 use std::ffi::OsStr;
 use std::fs::{self, File};

+ 4 - 4
cli/tauri-cli/src/bundle/wix.rs

@@ -124,8 +124,8 @@ fn extract_zip(data: &Vec<u8>, path: &Path) -> crate::Result<()> {
 
 // Generates the UUID for the Wix template.
 fn generate_package_guid(settings: &Settings) -> Uuid {
-  let namespace = Uuid::from_bytes(&UUID_NAMESPACE).unwrap();
-  Uuid::new_v5(&namespace, &settings.bundle_identifier())
+  let namespace = Uuid::from_bytes(UUID_NAMESPACE);
+  Uuid::new_v5(&namespace, settings.bundle_identifier().as_bytes())
 }
 
 // Specifically goes and gets Wix and verifies the download via Sha256
@@ -316,8 +316,8 @@ pub fn build_wix_app_installer(
   let manufacturer = settings.bundle_identifier().to_string();
   data.insert("manufacturer", manufacturer.as_str());
   let upgrade_code = Uuid::new_v5(
-    &uuid::NAMESPACE_DNS,
-    format!("{}.app.x64", &settings.binary_name()).as_str(),
+    &Uuid::NAMESPACE_DNS,
+    format!("{}.app.x64", &settings.binary_name()).as_bytes(),
   )
   .to_string();