chore: establish development baseline

This commit is contained in:
2026-06-28 01:27:09 +08:00
commit dd53e3054e
131 changed files with 19327 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
[package]
name = "bat-assetbundle"
version.workspace = true
edition.workspace = true
authors.workspace = true
license.workspace = true
[dependencies]
anyhow.workspace = true
thiserror.workspace = true
serde.workspace = true
serde_json.workspace = true
tracing.workspace = true
# Unity AssetBundle 解析需要的依赖
byteorder = "1.5"
lz4 = "1.28"
# LZMA 解压缩
lzma-rs = "0.3"
[dev-dependencies]
hex = "0.4"
+26
View File
@@ -0,0 +1,26 @@
//! AssetBundle 错误类型定义
use thiserror::Error;
/// AssetBundle 错误类型
#[derive(Error, Debug)]
pub enum AssetBundleError {
/// IO 错误
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
/// 解析错误
#[error("Parse error: {0}")]
Parse(String),
/// 不支持的格式
#[error("Unsupported format: {0}")]
UnsupportedFormat(String),
/// 其他错误
#[error(transparent)]
Other(#[from] anyhow::Error),
}
/// AssetBundle Result 类型
pub type Result<T> = std::result::Result<T, AssetBundleError>;
+17
View File
@@ -0,0 +1,17 @@
//! # BAT AssetBundle
//!
//! Unity AssetBundle 解析器核心
//!
//! 提供插件化的 AssetBundle 解析框架
#![warn(missing_docs)]
#![warn(clippy::all)]
pub mod error;
pub mod parser;
pub mod types;
pub use error::{AssetBundleError, Result};
/// AssetBundle 解析器版本号
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
+7
View File
@@ -0,0 +1,7 @@
//! 解析器模块占位
/// AssetBundle 解析器接口(待实现)
pub trait Parser {
/// 解析器名称
fn name(&self) -> &str;
}
+7
View File
@@ -0,0 +1,7 @@
//! AssetBundle 类型定义占位
/// Asset 类型(待实现)
pub enum AssetType {
/// 文本资源
TextAsset,
}