refactor(build): enhance build_cleaner.py with .gitignore support and auto-discovery

- Added support for .gitignore patterns to the build_cleaner script, allowing it to respect ignored files during maintenance tasks.
- Implemented auto-discovery of CMake libraries marked for auto-maintenance, improving the automation of source list updates.
- Introduced functions for extracting includes and symbols from source files to suggest missing headers based on usage.
- Updated README to reflect new features and usage instructions.

Benefits:
- Streamlines the build process by automating maintenance tasks and ensuring proper header management.
- Enhances code organization and maintainability by integrating with existing project structures.
This commit is contained in:
scawful
2025-10-13 12:18:10 -04:00
parent 02e9d3ba77
commit 8b0fd46580
14 changed files with 670 additions and 217 deletions

View File

@@ -8,7 +8,7 @@
#include "app/core/timing.h"
#include "app/core/window.h"
#include "app/editor/editor_manager.h"
#include "app/gui/app/background_renderer.h"
#include "app/gui/core/background_renderer.h"
#include "app/gfx/resource/arena.h" // Add include for Arena
#include "app/gfx/backend/sdl2_renderer.h" // Add include for new renderer
#include "app/gui/core/theme_manager.h"

View File

@@ -111,10 +111,6 @@ if(WIN32 OR (UNIX AND NOT APPLE))
target_include_directories(yaze_core_lib PUBLIC ${CMAKE_SOURCE_DIR}/src/lib/nativefiledialog-extended/src/include)
endif()
target_sources(yaze_core_lib PRIVATE
${CMAKE_SOURCE_DIR}/src/cli/service/testing/test_workflow_generator.cc
)
if(YAZE_WITH_GRPC)
target_include_directories(yaze_core_lib PRIVATE
${CMAKE_SOURCE_DIR}/third_party/json/include)

View File

@@ -1,13 +1,6 @@
set(
YAZE_APP_EDITOR_SRC
app/editor/agent/agent_chat_history_codec.cc
app/editor/agent/agent_chat_history_popup.cc
app/editor/agent/agent_chat_widget.cc
app/editor/agent/agent_collaboration_coordinator.cc
app/editor/agent/agent_editor.cc
app/editor/agent/agent_ui_theme.cc
app/editor/agent/automation_bridge.cc
app/editor/agent/network_collaboration_coordinator.cc
app/editor/code/assembly_editor.cc
app/editor/code/memory_editor.cc
app/editor/code/project_file_editor.cc
@@ -24,8 +17,6 @@ set(
app/editor/graphics/gfx_group_editor.cc
app/editor/graphics/graphics_editor.cc
app/editor/graphics/screen_editor.cc
app/editor/palette/palette_editor.cc
app/editor/palette/palette_group_card.cc
app/editor/message/message_data.cc
app/editor/message/message_editor.cc
app/editor/message/message_preview.cc
@@ -36,6 +27,9 @@ set(
app/editor/overworld/overworld_entity_renderer.cc
app/editor/overworld/scratch_space.cc
app/editor/overworld/tile16_editor.cc
app/editor/palette/palette_editor.cc
app/editor/palette/palette_group_card.cc
app/editor/palette/palette_utility.cc
app/editor/sprite/sprite_editor.cc
app/editor/system/command_manager.cc
app/editor/system/command_palette.cc

View File

@@ -30,7 +30,7 @@
#include "app/emu/emulator.h"
#include "app/gfx/resource/arena.h"
#include "app/gfx/debug/performance/performance_profiler.h"
#include "app/gui/app/background_renderer.h"
#include "app/gui/core/background_renderer.h"
#include "app/gui/core/icons.h"
#include "app/gui/core/input.h"
#include "app/gui/core/style.h"

View File

@@ -75,7 +75,6 @@ message(STATUS " - GFX Tier: gfx_backend configured")
set(GFX_RESOURCE_SRC
app/gfx/resource/arena.cc
app/gfx/resource/memory_pool.cc
app/gfx/render/background_buffer.cc
)
add_library(yaze_gfx_resource STATIC ${GFX_RESOURCE_SRC})
configure_gfx_library(yaze_gfx_resource)
@@ -121,6 +120,7 @@ message(STATUS " - GFX Tier: gfx_util configured")
# ==============================================================================
set(GFX_RENDER_SRC
app/gfx/render/atlas_renderer.cc
app/gfx/render/background_buffer.cc
app/gfx/render/texture_atlas.cc
app/gfx/render/tilemap.cc
)
@@ -174,4 +174,4 @@ if(PNG_FOUND)
target_link_libraries(yaze_gfx INTERFACE ${PNG_LIBRARIES})
endif()
message(STATUS "✓ yaze_gfx library configured with tiered architecture")
message(STATUS "✓ yaze_gfx library configured with tiered architecture")

View File

@@ -1,4 +1,4 @@
#include "app/gui/app/background_renderer.h"
#include "app/gui/core/background_renderer.h"
#include <algorithm>
#include <cmath>

View File

@@ -4,7 +4,7 @@
#include "util/file_util.h"
#include "app/gui/core/theme_manager.h"
#include "app/gui/app/background_renderer.h"
#include "app/gui/core/background_renderer.h"
#include "app/platform/font_loader.h"
#include "app/gui/core/color.h"
#include "app/gui/core/icons.h"

View File

@@ -9,6 +9,7 @@
# 1. Define Source Groups for each sub-library
set(GUI_CORE_SRC
app/gui/core/background_renderer.cc
app/gui/core/color.cc
app/gui/core/input.cc
app/gui/core/layout_helpers.cc
@@ -47,7 +48,6 @@ set(GUI_AUTOMATION_SRC
set(GUI_APP_SRC
app/gui/app/agent_chat_widget.cc
app/gui/app/background_renderer.cc
app/gui/app/collaboration_panel.cc
app/gui/app/editor_card_manager.cc
app/gui/app/editor_layout.cc

View File

@@ -1,63 +1,73 @@
set(YAZE_AGENT_SOURCES
# Core infrastructure
cli/service/command_registry.cc
cli/service/agent/proposal_executor.cc
cli/flags.cc
cli/handlers/agent.cc
cli/handlers/agent/common.cc
cli/handlers/agent/conversation_test.cc
cli/handlers/agent/general_commands.cc
cli/handlers/agent/simple_chat_command.cc
cli/handlers/agent/test_commands.cc
cli/handlers/agent/test_common.cc
cli/handlers/agent/todo_commands.cc
cli/service/agent/conversational_agent_service.cc
cli/service/agent/simple_chat_session.cc
cli/service/agent/enhanced_tui.cc
cli/service/agent/tool_dispatcher.cc
# Advanced features
cli/service/agent/learned_knowledge_service.cc
cli/service/agent/todo_manager.cc
cli/handlers/command_handlers.cc
cli/handlers/game/dialogue_commands.cc
cli/handlers/game/dungeon.cc
cli/handlers/game/dungeon_commands.cc
cli/handlers/game/message.cc
cli/handlers/game/message_commands.cc
cli/handlers/game/music_commands.cc
cli/handlers/game/overworld.cc
cli/handlers/game/overworld_commands.cc
cli/handlers/game/overworld_inspect.cc
cli/handlers/graphics/gfx.cc
cli/handlers/graphics/hex_commands.cc
cli/handlers/graphics/palette.cc
cli/handlers/graphics/palette_commands.cc
cli/handlers/graphics/sprite_commands.cc
cli/handlers/net/net_commands.cc
cli/handlers/rom/mock_rom.cc
cli/handlers/rom/project_commands.cc
cli/handlers/rom/rom_commands.cc
cli/handlers/tools/gui_commands.cc
cli/handlers/tools/resource_commands.cc
cli/service/agent/advanced_routing.cc
cli/service/agent/agent_pretraining.cc
cli/service/agent/conversational_agent_service.cc
cli/service/agent/enhanced_tui.cc
cli/service/agent/learned_knowledge_service.cc
cli/service/agent/prompt_manager.cc
cli/service/agent/proposal_executor.cc
cli/service/agent/simple_chat_session.cc
cli/service/agent/todo_manager.cc
cli/service/agent/tool_dispatcher.cc
cli/service/agent/vim_mode.cc
cli/service/ai/ai_service.cc
cli/service/ai/ai_action_parser.cc
cli/service/ai/vision_action_refiner.cc
cli/service/ai/ai_gui_controller.cc
cli/service/ai/ai_service.cc
cli/service/ai/ollama_ai_service.cc
cli/service/ai/prompt_builder.cc
cli/service/ai/service_factory.cc
cli/service/ai/vision_action_refiner.cc
cli/service/command_registry.cc
cli/service/gui/gui_action_generator.cc
cli/service/gui/gui_automation_client.cc
cli/service/net/z3ed_network_client.cc
cli/handlers/net/net_commands.cc
cli/service/planning/policy_evaluator.cc
cli/service/planning/proposal_registry.cc
cli/service/planning/tile16_proposal_generator.cc
cli/service/resources/resource_catalog.cc
cli/service/resources/resource_context_builder.cc
cli/service/resources/command_context.cc
cli/service/resources/command_handler.cc
cli/handlers/agent.cc
cli/handlers/command_handlers.cc
cli/handlers/agent/simple_chat_command.cc
cli/handlers/agent/general_commands.cc
cli/handlers/agent/test_commands.cc
cli/handlers/agent/conversation_test.cc
cli/handlers/agent/common.cc
cli/handlers/game/overworld_inspect.cc
cli/handlers/game/message.cc
cli/handlers/rom/mock_rom.cc
# CommandHandler-based implementations
cli/handlers/tools/resource_commands.cc
cli/handlers/game/dungeon_commands.cc
cli/handlers/game/overworld_commands.cc
cli/handlers/tools/gui_commands.cc
cli/handlers/graphics/hex_commands.cc
cli/handlers/game/dialogue_commands.cc
cli/handlers/game/music_commands.cc
cli/handlers/graphics/palette_commands.cc
cli/handlers/game/message_commands.cc
cli/handlers/graphics/sprite_commands.cc
# ROM commands
cli/handlers/rom/rom_commands.cc
cli/handlers/rom/project_commands.cc
cli/flags.cc
cli/service/resources/resource_catalog.cc
cli/service/resources/resource_context_builder.cc
cli/service/rom/rom_sandbox_manager.cc
cli/service/testing/test_suite_loader.cc
cli/service/testing/test_suite_reporter.cc
cli/service/testing/test_suite_writer.cc
cli/service/testing/test_workflow_generator.cc
# Advanced features
# CommandHandler-based implementations
# ROM commands
)
# gRPC-dependent sources (only added when gRPC is enabled)

View File

@@ -10,6 +10,7 @@ set(
zelda3/music/tracker.cc
zelda3/overworld/overworld.cc
zelda3/overworld/overworld_map.cc
zelda3/palette_constants.cc
zelda3/screen/dungeon_map.cc
zelda3/screen/inventory.cc
zelda3/screen/title_screen.cc