Upgrade rbx_dom_weak, rbx_reflection, and rbx_xml

This commit is contained in:
Lucien Greathouse
2019-05-12 12:57:24 -07:00
parent 3ea432ef2d
commit 27e2612fc9
16 changed files with 52 additions and 48 deletions

View File

@@ -30,15 +30,14 @@ log = "0.4"
maplit = "1.0.1"
notify = "4.0"
rbx_binary = "0.4.0"
rbx_dom_weak = "1.3.0"
rbx_xml = "0.6.0"
rbx_reflection = "2.0.374"
rbx_dom_weak = "1.6.0"
rbx_xml = "0.7.0"
rbx_reflection = "3.0.384"
regex = "1.0"
reqwest = "0.9.5"
rlua = "0.16"
ritz = "0.1.0"
serde = "1.0"
serde_derive = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
uuid = { version = "0.7", features = ["v4", "serde"] }

View File

@@ -100,7 +100,7 @@ pub fn build(options: &BuildOptions) -> Result<(), BuildError> {
// descendants.
let root_id = tree.get_root_id();
rbx_xml::encode(&tree, &[root_id], &mut file)?;
rbx_xml::to_writer_default(&mut file, &tree, &[root_id])?;
},
OutputKind::Rbxlx => {
// Place files don't contain an entry for the DataModel, but our
@@ -108,7 +108,7 @@ pub fn build(options: &BuildOptions) -> Result<(), BuildError> {
let root_id = tree.get_root_id();
let top_level_ids = tree.get_instance(root_id).unwrap().get_children_ids();
rbx_xml::encode(&tree, top_level_ids, &mut file)?;
rbx_xml::to_writer_default(&mut file, &tree, top_level_ids)?;
},
OutputKind::Rbxm => {
let root_id = tree.get_root_id();

View File

@@ -80,10 +80,10 @@ pub fn upload(options: &UploadOptions) -> Result<(), UploadError> {
match options.kind {
Some("place") | None => {
let top_level_ids = tree.get_instance(root_id).unwrap().get_children_ids();
rbx_xml::encode(&tree, top_level_ids, &mut contents)?;
rbx_xml::to_writer_default(&mut contents, &tree, top_level_ids)?;
},
Some("model") => {
rbx_xml::encode(&tree, &[root_id], &mut contents)?;
rbx_xml::to_writer_default(&mut contents, &tree, &[root_id])?;
},
Some(invalid) => return Err(UploadError::InvalidKind(invalid.to_owned())),
}

View File

@@ -8,7 +8,7 @@ use std::{
};
use failure::Fail;
use serde_derive::{Serialize, Deserialize};
use serde::{Serialize, Deserialize};
use crate::project::{Project, ProjectNode};

View File

@@ -3,7 +3,7 @@ use std::{
collections::{HashMap, HashSet},
};
use serde_derive::Serialize;
use serde::Serialize;
use log::warn;
#[derive(Debug, Serialize)]

View File

@@ -10,7 +10,7 @@
//!
//! ```
//! # use std::path::PathBuf;
//! # use serde_derive::{Serialize, Deserialize};
//! # use serde::{Serialize, Deserialize};
//!
//! #[derive(Serialize, Deserialize)]
//! struct Mine {

View File

@@ -9,8 +9,7 @@ use std::{
use log::warn;
use failure::Fail;
use rbx_dom_weak::{UnresolvedRbxValue, RbxValue};
use serde_derive::{Serialize, Deserialize};
use serde::{Serialize, Serializer};
use serde::{Serialize, Serializer, Deserialize};
static DEFAULT_PLACE: &'static str = include_str!("../assets/place.project.json");

View File

@@ -7,7 +7,7 @@ use std::{
};
use rlua::Lua;
use serde_derive::{Serialize, Deserialize};
use serde::{Serialize, Deserialize};
use log::{info, trace, error};
use rbx_dom_weak::{RbxTree, RbxId};

View File

@@ -14,7 +14,7 @@ use failure::Fail;
use log::info;
use maplit::hashmap;
use rbx_dom_weak::{RbxTree, RbxValue, RbxInstanceProperties, UnresolvedRbxValue};
use serde_derive::{Serialize, Deserialize};
use serde::{Serialize, Deserialize};
use rbx_reflection::{try_resolve_value, ValueResolveError};
use crate::{
@@ -653,20 +653,13 @@ fn snapshot_xml_model_file<'source>(
.file_stem().expect("Could not extract file stem")
.to_str().expect("Could not convert path to UTF-8");
let mut temp_tree = RbxTree::new(RbxInstanceProperties {
name: "Temp".to_owned(),
class_name: "Folder".to_owned(),
properties: HashMap::new(),
});
let root_id = temp_tree.get_root_id();
rbx_xml::decode(&mut temp_tree, root_id, file.contents.as_slice())
let temp_tree = rbx_xml::from_reader_default(file.contents.as_slice())
.map_err(|inner| SnapshotError::XmlModelDecodeError {
inner,
path: file.path.clone(),
})?;
let root_instance = temp_tree.get_instance(root_id).unwrap();
let root_instance = temp_tree.get_instance(temp_tree.get_root_id()).unwrap();
let children = root_instance.get_children_ids();
match children.len() {

View File

@@ -1,4 +1,4 @@
use serde_derive::{Serialize, Deserialize};
use serde::{Serialize, Deserialize};
use uuid::Uuid;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]

View File

@@ -11,7 +11,7 @@ use std::{
};
use rbx_dom_weak::{RbxTree, RbxId, RbxInstanceProperties, RbxValue};
use serde_derive::{Serialize, Deserialize};
use serde::{Serialize, Deserialize};
use crate::{
path_map::PathMap,

View File

@@ -21,7 +21,7 @@ use hyper::{
Request,
Response,
};
use serde_derive::{Serialize, Deserialize};
use serde::{Serialize, Deserialize};
use rbx_dom_weak::{RbxId, RbxInstance};
use crate::{

View File

@@ -20,7 +20,7 @@ use std::{
};
use log::error;
use serde_derive::{Serialize, Deserialize};
use serde::{Serialize, Deserialize};
use rbx_dom_weak::{RbxId, RbxTree};
use librojo::{