-
Notifications
You must be signed in to change notification settings - Fork 70
[#68] Generalize AssetBundle to Archive in analyze schema and code #89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
f52bbad
Support ContentArchive in build_report_archive_contents
SkowronskiAndrew b0ddd4b
[#68] Generalize AssetBundle to Archive in analyze schema and code
SkowronskiAndrew 4c78876
[#68] Fix incorrect archive-mapping example in BuildReport comment
SkowronskiAndrew File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,8 +16,8 @@ public class SerializedFileSQLiteWriter : IDisposable | |
| { | ||
| private HashSet<int> m_TypeSet = new(); | ||
|
|
||
| private int m_CurrentAssetBundleId = -1; | ||
| private int m_NextAssetBundleId = 0; | ||
| private int m_CurrentArchiveId = -1; | ||
| private int m_NextArchiveId = 0; | ||
|
|
||
| private bool m_SkipReferences; | ||
| private bool m_SkipCrc; | ||
|
|
@@ -69,7 +69,7 @@ public class SerializedFileSQLiteWriter : IDisposable | |
| private AddReference m_AddReferenceCommand = new AddReference(); | ||
| private AddPropertyName m_AddPropertyNameCommand = new AddPropertyName(); | ||
| private AddPropertyType m_AddPropertyTypeCommand = new AddPropertyType(); | ||
| private AddAssetBundle m_AddAssetBundleCommand = new AddAssetBundle(); | ||
| private AddArchive m_AddArchiveCommand = new AddArchive(); | ||
| private AddSerializedFile m_AddSerializedFileCommand = new AddSerializedFile(); | ||
| private AddObject m_AddObjectCommand = new AddObject(); | ||
| private AddType m_AddTypeCommand = new AddType(); | ||
|
|
@@ -107,7 +107,7 @@ private void CreateSQLiteCommands() | |
| m_AddReferenceCommand.CreateCommand(m_Database); | ||
| m_AddPropertyNameCommand.CreateCommand(m_Database); | ||
| m_AddPropertyTypeCommand.CreateCommand(m_Database); | ||
| m_AddAssetBundleCommand.CreateCommand(m_Database); | ||
| m_AddArchiveCommand.CreateCommand(m_Database); | ||
| m_AddSerializedFileCommand.CreateCommand(m_Database); | ||
| m_AddObjectCommand.CreateCommand(m_Database); | ||
| m_AddTypeCommand.CreateCommand(m_Database); | ||
|
|
@@ -116,28 +116,28 @@ private void CreateSQLiteCommands() | |
| m_LastId = m_Database.CreateCommand(); | ||
| m_LastId.CommandText = "SELECT last_insert_rowid()"; | ||
| } | ||
| public void BeginAssetBundle(string name, long size) | ||
| public void BeginArchive(string name, long size) | ||
| { | ||
| if (m_CurrentAssetBundleId != -1) | ||
| if (m_CurrentArchiveId != -1) | ||
| { | ||
| throw new InvalidOperationException("SQLWriter.BeginAssetBundle called twice"); | ||
| throw new InvalidOperationException("SQLWriter.BeginArchive called twice"); | ||
| } | ||
|
|
||
| m_CurrentAssetBundleId = m_NextAssetBundleId++; | ||
| m_AddAssetBundleCommand.SetValue("id", m_CurrentAssetBundleId); | ||
| m_AddAssetBundleCommand.SetValue("name", name); | ||
| m_AddAssetBundleCommand.SetValue("file_size", size); | ||
| m_AddAssetBundleCommand.ExecuteNonQuery(); | ||
| m_CurrentArchiveId = m_NextArchiveId++; | ||
| m_AddArchiveCommand.SetValue("id", m_CurrentArchiveId); | ||
| m_AddArchiveCommand.SetValue("name", name); | ||
| m_AddArchiveCommand.SetValue("file_size", size); | ||
| m_AddArchiveCommand.ExecuteNonQuery(); | ||
| } | ||
|
|
||
| public void EndAssetBundle() | ||
| public void EndArchive() | ||
| { | ||
| if (m_CurrentAssetBundleId == -1) | ||
| if (m_CurrentArchiveId == -1) | ||
| { | ||
| throw new InvalidOperationException("SQLWriter.EndAssetBundle called before SQLWriter.BeginAssetBundle"); | ||
| throw new InvalidOperationException("SQLWriter.EndArchive called before SQLWriter.BeginArchive"); | ||
| } | ||
|
|
||
| m_CurrentAssetBundleId = -1; | ||
| m_CurrentArchiveId = -1; | ||
| } | ||
|
|
||
| public void WriteSerializedFile(string relativePath, string fullPath, string containingFolder) | ||
|
|
@@ -214,7 +214,7 @@ public void WriteSerializedFile(string relativePath, string fullPath, string con | |
|
|
||
| Context ctx = new() | ||
| { | ||
| AssetBundleId = m_CurrentAssetBundleId, | ||
| ArchiveId = m_CurrentArchiveId, | ||
| SerializedFileId = serializedFileId, | ||
| SceneId = sceneId, | ||
| ObjectIdProvider = m_ObjectIdProvider, | ||
|
|
@@ -228,7 +228,7 @@ public void WriteSerializedFile(string relativePath, string fullPath, string con | |
| { | ||
| m_AddSerializedFileCommand.SetTransaction(transaction); | ||
| m_AddSerializedFileCommand.SetValue("id", serializedFileId); | ||
| m_AddSerializedFileCommand.SetValue("asset_bundle", m_CurrentAssetBundleId == -1 ? "" : m_CurrentAssetBundleId); | ||
| m_AddSerializedFileCommand.SetValue("archive", m_CurrentArchiveId == -1 ? "" : m_CurrentArchiveId); | ||
| m_AddSerializedFileCommand.SetValue("name", relativePath); | ||
|
Comment on lines
229
to
232
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See comment below |
||
| m_AddSerializedFileCommand.ExecuteNonQuery(); | ||
|
|
||
|
|
@@ -387,7 +387,7 @@ public void Dispose() | |
| } | ||
|
|
||
| // Serialized file dispose calls | ||
| m_AddAssetBundleCommand.Dispose(); | ||
| m_AddArchiveCommand.Dispose(); | ||
| m_AddSerializedFileCommand.Dispose(); | ||
| m_AddReferenceCommand.Dispose(); | ||
| m_AddPropertyNameCommand.Dispose(); | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment below