Document project structure; split Archive and SerializedFile into their own libraries#88
Merged
Merged
Conversation
For consistency with the other command implementations - it didn't make much sense that some commands were implemented directly inside UnityDataTool and others as separate libraries.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates repository documentation for the v2.0 release and refactors the CLI so the archive and serialized-file commands follow the repo’s established “one feature = one library” pattern (matching Analyzer, TextDumper, etc.). The CLI (UnityDataTool) becomes primarily command wiring, with the moved implementations living in new Archive and SerializedFile class libraries.
Changes:
- Reworked
README.mdand updatedAGENTS.mdto document the layered project structure and dependencies (including a Mermaid diagram). - Extracted
archiveinto a newArchivelibrary andserialized-fileinto a newSerializedFilelibrary; updated the CLI to call into these tools. - Renamed command handler methods to more explicit verbs (
List*,Print*,Extract*) without intended behavior changes.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| UnityDataTools.sln | Adds the new Archive and SerializedFile projects to the solution. |
| UnityDataTool/UnityDataTool.csproj | Moves dependencies from the CLI into feature libraries via new project references. |
| UnityDataTool/Program.cs | Updates CLI wiring to call ArchiveTool / SerializedFileTool and removes the CLI-level OutputFormat. |
| UnityDataTool.Tests/WebBundleSupportTests.cs | Updates test compilation by importing the new UnityDataTools.Archive namespace. |
| Archive/Archive.csproj | Introduces the new Archive library project (including System.IO.Packaging). |
| Archive/ArchiveTool.cs | Hosts the extracted archive command implementation and output format enum. |
| Archive/WebBundleHelper.cs | Updates namespace and ties listing output formatting to ArchiveTool.OutputFormat. |
| Archive/README.md | Adds library README pointing to the command documentation. |
| SerializedFile/SerializedFile.csproj | Introduces the new SerializedFile library project. |
| SerializedFile/SerializedFileTool.cs | Hosts the extracted serialized-file command implementation and output format enum. |
| SerializedFile/README.md | Adds library README pointing to the command documentation. |
| README.md | Rewrites the “Repository content” section with a layered overview and dependency diagram. |
| AGENTS.md | Updates the component hierarchy to reflect the new feature libraries. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * UnityFileSystem: a .NET class library, with source and binaries, that wraps the native | ||
| `UnityFileSystemApi` to mount Unity Archives and read SerializedFiles. | ||
| * UnityBinaryFormat: C# parsers and helpers for reading data out of Unity Archives and SerializedFiles. | ||
| * UnityDataModels: shared C# models for the reading JSON format files produced by the build (Addressables BuildLayout.json, Content Directory ContentLayout.json). |
Comment on lines
+3
to
+9
| <PropertyGroup> | ||
| <OutputType>Library</OutputType> | ||
| <TargetFramework>net9.0</TargetFramework> | ||
| <ApplicationIcon /> | ||
| <StartupObject /> | ||
| <LangVersion>latest</LangVersion> | ||
| </PropertyGroup> |
Comment on lines
+3
to
+9
| <PropertyGroup> | ||
| <OutputType>Library</OutputType> | ||
| <TargetFramework>net9.0</TargetFramework> | ||
| <ApplicationIcon /> | ||
| <StartupObject /> | ||
| <LangVersion>latest</LangVersion> | ||
| </PropertyGroup> |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is a documentation and refactoring change for the v2.0 release; there is no
associated issue.
The
README.md"Repository content" section was reworked to actually explain thesolution's design, with a Mermaid diagram of how the projects layer (base libraries →
feature libraries → CLI) and prose describing each. While documenting this it became
clear that the
archiveandserialized-filecommands were implemented directly insidethe
UnityDataToolCLI assembly, whereas every other feature (analyze,dump,find-refs) lives in its own class library. That inconsistency was awkward to documentand out of step with the rest of the repo, so those commands were extracted into their
own libraries to match the established one-library-per-feature pattern.
Changes
Documentation
README.md: added a Mermaid dependencydiagram, grouped the projects into command-line tool / feature libraries / base
libraries, and added a short "Tests and test data" subsection.
AGENTS.mdto match.Restructure
archivecommand into a new Archive library (ArchiveTool+WebBundleHelper) and theserialized-filecommand into a new SerializedFilelibrary (
SerializedFileTool). Both are peers ofTextDumper, depending only onUnityBinaryFormatandUnityFileSystem.<Name>Toolclass, a nestedOutputFormatenum (mirroringTextDumperTool.DumpFormat), and a small folderREADME.mdpointing at the correspondingDocumentation/command-*.md.Program.csis now purely CLI wiring; theOutputFormatenum and theSystem.IO.Packaging/UnityBinaryFormatreferences that only existed for thosecommands moved out of the CLI project accordingly.
API naming
List*forconsole listings of a collection,
Print*for a single record/summary,Extract*forwriting files (e.g.
HandleList→ListContent,HandleHeader→PrintHeader,HandleExtract→ExtractContent). No behavior change.Testing
dotnet test— full suite green (725 passed, 10 skipped, 0 failed) and a clean Releasebuild with no warnings. The command tests exercise
archiveandserialized-fileend-to-end through
Program.Main, so they cover the moved code and renamed API; no testlogic changed.