Skip to content

Add manual build metadata generation outside of build process#4

Open
liortal53 wants to merge 1 commit into
developfrom
claude/test-build-metadata-option-fMR2V
Open

Add manual build metadata generation outside of build process#4
liortal53 wants to merge 1 commit into
developfrom
claude/test-build-metadata-option-fMR2V

Conversation

@liortal53

Copy link
Copy Markdown
Owner

Summary

Refactored the build metadata generation logic to support manual generation outside of the build pipeline, while maintaining existing build-time generation functionality.

Key Changes

  • Refactored BuildMetadataProcessor: Extracted the metadata generation logic into a reusable Generate(BuildTargetGroup, string) private method
  • Added public Generate() method: Allows manual generation of build metadata using the active build target and a new GUID, without requiring an active build
  • Created BuildMetadataMenu class: Added a new menu item "Tools/Build Metadata/Generate Now" to trigger manual metadata generation from the Unity Editor
  • Maintained backward compatibility: The OnPreprocessBuild callback continues to work as before, now delegating to the refactored Generate method

Implementation Details

  • The refactored Generate(BuildTargetGroup, string) method contains the core metadata generation logic previously in OnPreprocessBuild
  • The public Generate() method uses EditorUserBuildSettings.activeBuildTarget to determine the build target group when called manually
  • Each manual generation creates a new GUID, while build-time generation uses the actual build report's GUID
  • The menu item is placed under "Tools/Build Metadata/" with priority 100 for easy access

https://claude.ai/code/session_011TzyEUutt99bHwmp8xacp1

Extracts the core generation logic from OnPreprocessBuild into a static
Generate() overload that uses the active build target, then wires it up
to Tools > Build Metadata > Generate Now so the JSON can be refreshed and
tested independently without kicking off a full build.

https://claude.ai/code/session_011TzyEUutt99bHwmp8xacp1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants