Skip to content

Conversation

@JunaMeinhold
Copy link
Member

@JunaMeinhold JunaMeinhold commented Dec 19, 2025

This pull request introduces several updates across the codebase, focusing on upgrading dependencies, refactoring generator code for improved maintainability, and enhancing the configuration and build process. The most significant changes include updating to newer package versions, refactoring generator patches to use a unified parsing result, and improving the function generation logic. Additionally, there are minor enhancements to project files and build output.

Dependency and Target Framework Upgrades

  • Updated HexaGen.Runtime package references to version 1.1.22 across all relevant projects for consistency and bug fixes. [1] [2] [3] [4] [5] [6] [7] [8]
  • Upgraded the Android target framework in ExampleAndroid.csproj from net8.0-android to net9.0-android and bumped AndroidX dependencies to newer versions. [1] [2]
  • Updated HexaGen package reference in Generator.csproj from HexaGen.Legacy to the latest HexaGen version, and bumped related dependencies.

Generator and Patching Refactor

  • Refactored all generator patch classes (ImGuiPrePatch, ImGuiDefinitionsPatch, ImGuizmoPrePatch, ImVectorPatch) to use a unified ParseResult object instead of directly using CppCompilation, simplifying the patching interface and improving extensibility. [1] [2] [3] [4] [5]
  • Updated function generation logic in ManualFunctionGenRuleSpan to improve parameter handling, including support for string mappings and the use of ParameterMapping. [1] [2]

Configuration and Build Improvements

  • Added additional preprocessor defines to config.base.json for improved feature support, and mapped new type aliases. [1] [2]
  • Enhanced build feedback in Program.cs by timing the generation process and displaying the duration in seconds. [1] [2]

Code Quality and Maintenance

  • Cleaned up and updated ImGuiCodeGenerator.cs imports, and commented out hardcoded environment variable settings for better portability. [1] [2]
  • Updated merge logic for metadata in post-patch and backend generation to use explicit merge options for function tables. [1] [2]

Project Structure

  • Added a new folder entry for generated functions in Hexa.NET.ImGuizmo.csproj to improve project organization.This pull request updates the HexaGen code generator to use the latest HexaGen APIs, modernizes several patch and generator classes to match new interfaces, and improves configuration and merging logic. The changes focus on upgrading dependencies, adapting to new HexaGen data models, and enhancing the flexibility and maintainability
    This pull request includes several important updates across the codebase, focusing on upgrading dependencies, improving code generation infrastructure, and making various code and configuration improvements. The main highlights are the migration to newer package versions (notably HexaGen and HexaGen.Runtime), refactoring of the code generation pipeline to support new APIs, and enhancements to the build and patching process.

Dependency and Framework Upgrades:

  • Updated the HexaGen package in Generator/Generator.csproj from HexaGen.Legacy to the latest HexaGen version, and upgraded HexaGen.Runtime to version 1.1.22 across all relevant projects. [1] [2] [3] [4] [5] [6] [7] [8] [9]
  • Updated Android target framework in ExampleAndroid.csproj to net9.0-android and bumped Xamarin.AndroidX dependencies. [1] [2]

Code Generation Pipeline Improvements:

  • Refactored generator and patch classes to use the new ParseResult API instead of the older CppCompilation, aligning with updated HexaGen APIs. [1] [2] [3] [4]
  • Updated function parameter generation logic in ManualFunctionGenRuleSpan to support new mapping and type handling, improving string and span parameter support. [1] [2]
  • Improved metadata merging by using the new MergeOptions object, specifically enabling function table merging in both ImGui and backend targets. [1] [2]

Build and Configuration Enhancements:

  • Added timing and duration logging to the code generation process in Program.cs for better build feedback. [1] [2]
  • Added new defines and type mappings to config.base.json to support additional ImGui features and types. [1] [2]
  • Added a generated functions folder to the ImGuizmo project for better organization of output files.

Code Cleanup and Modernization:

  • Removed unused or legacy using directives and updated namespaces to reflect new HexaGen structure. [1] [2]
  • Commented out unnecessary environment variable settings in the generator configuration.

These changes collectively modernize the codebase, improve compatibility with the latest tools and libraries, and enhance the maintainability and extensibility of the code generation pipeline. of the codebase.

Dependency and API Upgrades:

  • Updated the HexaGen dependency from HexaGen.Legacy to the latest HexaGen package in Generator.csproj to leverage new APIs and features.

Refactoring for New HexaGen APIs:

  • Replaced usage of CppAst and direct CppCompilation parameters with new HexaGen types like ParseResult and updated method signatures in generator and patch classes (ImGuiCodeGenerator, ImGuiDefinitionsPatch, ImGuizmoPrePatch, ImGuiPrePatch, ImVectorPatch, ManualFunctionGenRuleSpan). [1] [2] [3] [4] [5] [6] [7] [8]

Configuration and Build Improvements:

  • Moved C preprocessor Defines from hardcoded values in code to config.base.json, making build configuration more maintainable and visible. [1] [2]
  • Added new type mappings for ImTextureID and ImFileHandle in config.base.json for better type resolution.

Metadata Merging Enhancements:

  • Updated metadata merging logic to use the new MergeOptions object, enabling fine-grained control (such as merging function tables) in ImGuiPostPatch and ImGuiBackendsTarget. [1] [2]

These changes collectively modernize the codebase, improve maintainability, and align the generator with the latest HexaGen framework.

Migrated project from HexaGen.Legacy to HexaGen 1.1.22, updating all relevant using directives and code to use the new API structure. Refactored method signatures to accept ParseResult instead of CppCompilation, and updated metadata merging to use MergeOptions. Improved parameter handling in ManualFunctionGenRuleSpan to match new HexaGen conventions. Added new defines and type mappings in config.base.json. Commented out obsolete Visual Studio environment variable settings. General modernization and cleanup to align with the latest HexaGen library.
Updated HexaGen to 1.1.22.1. Moved IMGUI_USE_WCHAR32, IMGUI_ENABLE_FREETYPE, and CIMGUI_DEFINE_ENUMS_AND_STRUCTS defines from ImGuiCodeGenerator.cs to config.base.json for centralized configuration management.
- Bump ExampleAndroid to net9.0-android and update AndroidX packages
- Update HexaGen.Runtime to 1.1.22 across all projects
- Add Generated\Functions\ folder to Hexa.NET.ImGuizmo.csproj
- Minor formatting and whitespace adjustments
Updated HexaGen NuGet package to version 1.1.23. Added timing logic in Program.cs to measure and display the duration of the generation process in seconds, providing clearer feedback on execution time.
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