Skip to content

Generalize use of AssetBundle to Archive in analyze schema and elsewhere #68

Description

@SkowronskiAndrew

Some places in UnityDataTool, including the analyze schema use "AssetBundle" when the functionality is actually general to any use of the Unity Archive file format.

Primarily the name of this table is misleading when we are analyzing content directory builds:

CREATE TABLE IF NOT EXISTS asset_bundles
(
    id INTEGER,
    name TEXT,
    file_size INTEGER,
    PRIMARY KEY (id)
);

Unity uses archive files also for player builds and "content archives". Having very clear terminology will help everyone understand the file formats, especially as we introduce new build functionality that doesn't involve AsssetBundles.

Changing the core Analyze schema could have an impact on some existing tools (they may have to do some search and replace to fix table names in queries). I think its still in the best interest of everyone to keep the schema improving.

This will be included along with a clear bump in the version (e.g. 1.3.X -> 2.0) so that this doesn't suddenly appear in a point bug fix release. And the PR (and eventual v2.0 release notes) should document the exact schema change to aid people in migration (e.g. doing a search and replace in existing queries)

And the mapping of any renamed database content should be clearly listed in the release notes.

Further places to update:

  • Code related to the asset_bundles table
    • class UnityDataTools.Analyzer.SQLite.Commands.SerializedFile.AddAssetBundle becomes AddArchive
    • SerializedFileSQLiteWriter.BeginAssetBundle / EndAssetBundle
  • Method names in ArchiveTool.cs e.g. ExtractAssetBundle() -> ExtractArchive()
  • Archive tracking when we analyze a buildreport file.
    • build_report_archive_contents fields renamed (assetbundle -> archive, assetbundle_content -> archive_content)
    • FileListAssetBundleHelper should be renamed FileListArchiveHelper, and fix internal use of AssetBundle to generalized to Archive. (I've already made small fix to properly analyze archive content from content directory builds and confirmed this works, so its just a question of the naming in the code that currently is written as if it only works for AssetBundles. It remains true that player builds do not track the content of their data.unity3d file, although we may fix that some day)

Places that won't be updated:

  • AssetBundleHandler.cs - this is specific to the AssetBundle object, not the archive file wrapper on an AssetBundle
  • AssetBundle.sql including assetbundle_assets and assetbundle_asset_view are already named properly because they are specific to assetbundles.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions