Skip to content

Commit

Permalink
Merge pull request #20 from soulsmods/rename-fstools
Browse files Browse the repository at this point in the history
Add fstools prefix to all crates, move under subfolder
  • Loading branch information
garyttierney authored Mar 10, 2024
2 parents f8de80e + fbd0837 commit 7bedc7b
Show file tree
Hide file tree
Showing 56 changed files with 400 additions and 432 deletions.
626 changes: 285 additions & 341 deletions Cargo.lock

Large diffs are not rendered by default.

28 changes: 17 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
[package]
name = "fstools"
edition = "2021"
edition.workspace = true
version.workspace = true
license.workspace = true

[dependencies]
format = { path = "format" }
souls_vfs = { path = "vfs" }
fstools_formats.workspace = true
fstools_vfs.workspace = true

[dev-dependencies]
insta = "1"
Expand All @@ -17,18 +19,22 @@ harness = false

[workspace]
resolver = "2"
default-members = ["cli", "viewer"]
default-members = ["crates/cli", "crates/viewer"]
members = [
"format",
"cli",
"viewer",
"vfs",
"util",
"crates/formats",
"crates/cli",
"crates/viewer",
"crates/vfs",
]

[workspace.package]
version = "0.1.0"
license = "MIT AND Apache-2.0"
edition = "2021"

[workspace.dependencies.thiserror]
version = "1"
[workspace.dependencies]
fstools_formats = { path = "crates/formats", version = "0.1.0" }
fstools_vfs = { path = "crates/vfs", version = "0.1.0" }
memmap2 = "0.7"
rayon = "1"
thiserror = "1"
16 changes: 6 additions & 10 deletions cli/Cargo.toml → crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
[package]
name = "cli"
name = "fstools_cli"
version.workspace = true
license.workspace = true
edition = "2021"
edition.workspace = true

[dependencies]
clap = { version = "4", features = ["derive"] }
format = { path = "../format" }
indicatif = { version = "0.17", features = ["rayon"] }
rayon = "1"
souls_vfs = { path = "../vfs" }
util = { path = "../util" }

[dependencies.memmap2]
version = "0.7"

fstools_formats.workspace = true
fstools_vfs.workspace = true
memmap2.workspace = true
rayon.workspace = true

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use std::{fs, io::Read, path::PathBuf};

use clap::Parser;
use fstools_vfs::{FileKeyProvider, Vfs};
use indicatif::{ParallelProgressIterator, ProgressStyle};
use rayon::iter::{IntoParallelRefIterator, ParallelIterator};
use souls_vfs::{FileKeyProvider, Vfs};

#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::{
};

use clap::Parser;
use format::{bnd4::BND4, dcx::DcxHeader};
use fstools_formats::{bnd4::BND4, dcx::DcxHeader};

#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
Expand Down
File renamed without changes.
19 changes: 8 additions & 11 deletions format/Cargo.toml → crates/formats/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
[package]
name = "format"
name = "fstools_formats"
version.workspace = true
license.workspace = true
edition = "2021"
edition.workspace = true
build = "build.rs"

[features]
default = []
strict-padding = []

[dependencies]
aes = "0.8"
bytemuck = "1"
byteorder = "1"
aes = "0.8"
rayon = "1"
rug = "1.24"
flate2 = "1.0"
oodle-sys = "0.1"
rayon.workspace = true
rsa = "0.9"
rug = "1.24"
zerocopy = { version = "0.7.32", features = ["derive"] }
flate2 = "1.0"

[dependencies.thiserror]
workspace = true
thiserror.workspace = true

[dependencies.oodle-sys]
version = "0.1"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions crates/vfs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "fstools_vfs"
version.workspace = true
license.workspace = true
edition.workspace = true

[dependencies]
aes = "0.8"
encoding_rs = "0.8"
fstools_formats.workspace = true
memmap2.workspace = true
thiserror.workspace = true
2 changes: 1 addition & 1 deletion vfs/src/bnd.rs → crates/vfs/src/bnd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::{
io::{self, Cursor, Read},
};

use format::{
use fstools_formats::{
bnd4::BND4,
dcx::{DcxError, DcxHeader},
};
Expand Down
2 changes: 1 addition & 1 deletion vfs/src/key_provider.rs → crates/vfs/src/key_provider.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{fs, path::PathBuf};

use format::bhd::BhdKey;
use fstools_formats::bhd::BhdKey;

// TODO: replace Option with Result
pub trait ArchiveKeyProvider {
Expand Down
2 changes: 1 addition & 1 deletion vfs/src/lib.rs → crates/vfs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use aes::{
cipher::{generic_array::GenericArray, BlockDecrypt, BlockSizeUser, KeyInit},
Aes128,
};
use format::bhd::Bhd;
use fstools_formats::bhd::Bhd;
use memmap2::MmapOptions;
use thiserror::Error;

Expand Down
File renamed without changes.
File renamed without changes.
13 changes: 5 additions & 8 deletions viewer/Cargo.toml → crates/viewer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "viewer"
edition = "2021"
name = "fstools_viewer"
edition.workspace = true
version.workspace = true
license.workspace = true

Expand All @@ -10,11 +10,8 @@ license.workspace = true
clap = { version = "4", features = ["derive"] }
byteorder = "1"
bevy = { version = "0.13", features = ["dds"] }
format = { path = "../format" }
souls_vfs = { path = "../vfs" }
util = { path = "../util" }
bevy_panorbit_camera = "0.14"
bevy-inspector-egui = "0.23"

[dependencies.thiserror]
workspace = true
fstools_formats.workspace = true
fstools_vfs.workspace = true
thiserror.workspace = true
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use bevy::{
},
};
use byteorder::LE;
use format::flver::{
use fstools_formats::flver::{
face_set::FaceSetIndices,
mesh::Mesh as FlverMesh,
reader::{VertexAttributeSemantic, FLVER},
Expand Down Expand Up @@ -102,7 +102,7 @@ fn load_mesh(flver: &Flver, flver_mesh: &FlverMesh<LE>) -> Mesh {
let layout_members = flver.vertex_attributes(layout);

for member in layout_members {
use format::flver::reader::VertexAttributeSemantic::*;
use fstools_formats::flver::reader::VertexAttributeSemantic::*;

let semantic = VertexAttributeSemantic::from(member.semantic_id.get());
let Some(accessor) = flver.vertex_attribute_accessor(buffer, member) else {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use bevy::{
},
utils::BoxedFuture,
};
use format::tpf::TPF;
use souls_vfs::undo_container_compression;
use fstools_formats::tpf::TPF;
use fstools_vfs::undo_container_compression;
use thiserror::Error;

use crate::formats::TpfPlugin;
Expand Down
2 changes: 1 addition & 1 deletion viewer/src/main.rs → crates/viewer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use bevy::prelude::*;
use bevy_inspector_egui::quick::WorldInspectorPlugin;
use bevy_panorbit_camera::{PanOrbitCamera, PanOrbitCameraPlugin};
use clap::Parser;
use souls_vfs::{FileKeyProvider, Vfs};
use fstools_vfs::{FileKeyProvider, Vfs};
use vfs::VfsAssetRepositoryPlugin;

use crate::{flver::asset::FlverAsset, formats::FormatsPlugins};
Expand Down
2 changes: 1 addition & 1 deletion viewer/src/vfs/mod.rs → crates/viewer/src/vfs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use bevy::{
asset::io::{AssetSource, AssetSourceId},
prelude::*,
};
use souls_vfs::Vfs;
use fstools_vfs::Vfs;

use self::reader::VfsAssetRepository;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use bevy::{
prelude::{Deref, DerefMut, Resource},
tasks::futures_lite::{io::Cursor, AsyncRead},
};
use souls_vfs::{Vfs, VfsEntryReader as VfsEntryReaderImpl, VfsOpenError};
use fstools_vfs::{Vfs, VfsEntryReader as VfsEntryReaderImpl, VfsOpenError};

#[derive(Clone, Deref, DerefMut, Resource)]
pub struct VfsAssetRepository(pub(crate) Arc<Vfs>);
Expand Down
52 changes: 52 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[graph]
targets = [
"x86_64-unknown-linux-gnu",
"x86_64-apple-darwin",
"x86_64-pc-windows-msvc",
"x86_64-pc-windows-gnu",
]
all-features = true

[advisories]
version = 2
ignore = [
{ id = "RUSTSEC-2023-0071", reason = "we're decrypting public data with publicly available keys" }
]

[licenses]
version = 2
allow = [
"0BSD",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause",
"MIT",
"Unlicense",
"Zlib",
]

exceptions = [
{ name = "unicode-ident", allow = [
"Unicode-DFS-2016",
] },
{ name = "rug", allow = [
"LGPL-3.0"
] },
{ name = "gmp-mpfr-sys", allow = [
"LGPL-3.0"
] }
]

[bans]
multiple-versions = "warn"
wildcards = "deny"
# Certain crates that we don't want multiple versions of in the dependency tree
deny = [
{ name = "bevy", deny-multiple-versions = true },
]

[sources]
unknown-registry = "deny"
unknown-git = "deny"
allow-registry = ["https://github.com/rust-lang/crates.io-index"]
allow-git = []
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
pub mod formats {
pub use format::*;
pub use fstools_formats::*;
}

pub mod vfs {
pub use souls_vfs::*;
pub use fstools_vfs::*;
}

pub mod prelude {
Expand Down
2 changes: 1 addition & 1 deletion tests/dcx.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{collections::HashSet, error::Error, io::Read, path::PathBuf, sync::Arc};

use format::dcx::DcxError;
use fstools::{formats::dcx::DcxHeader, prelude::*};
use fstools_formats::dcx::DcxError;
use insta::assert_snapshot;
use libtest_mimic::{Arguments, Failed, Trial};

Expand Down
13 changes: 0 additions & 13 deletions util/Cargo.toml

This file was deleted.

1 change: 0 additions & 1 deletion util/src/lib.rs

This file was deleted.

22 changes: 0 additions & 22 deletions vfs/Cargo.toml

This file was deleted.

0 comments on commit 7bedc7b

Please sign in to comment.