build: automate ActionScript version project injection#120
build: automate ActionScript version project injection#120
Conversation
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughCentralized version metadata via a new Changes
Sequence Diagram(s)sequenceDiagram
participant CMake as CMakeLists
participant Version as Version.cmake
participant Import as ImportToSWF.cmake
participant AS as ActionScript source
participant SWF as Output SWF
CMake->>Version: include Version.cmake (VER_MAJOR, VER_MINOR,\nVER_RELEASE_IDX, VER_SUFFIX, VERSION_METADATA_TARGETS)
CMake->>Import: invoke per-SWF import with -DSKYUI_* and\n-VERSION_METADATA_TARGETS
Import->>AS: for each source: compute CLASSPATH
alt CLASSPATH in VERSION_METADATA_TARGETS
Import->>AS: read file, inject/overwrite static vars:\nSKYUI_RELEASE_IDX, SKYUI_VERSION_MAJOR,\nSKYUI_VERSION_MINOR, SKYUI_VERSION_STRING
else
Import->>AS: copy file unchanged
end
Import->>SWF: assemble patched sources into SWF
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
Version.cmake (1)
7-25: All metadata targets resolve correctly. The audit confirms each entry matches exactly one file in the stripped-path convention with no lingeringSKYUI_*declarations. Consider adding a configure-time check to prevent future mismatches if additional targets are added.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Version.cmake` around lines 7 - 25, Add a configure-time validation in Version.cmake to verify each entry in the VERSION_METADATA_TARGETS list actually resolves to exactly one file using the stripped-path convention and contains no leftover SKYUI_* prefixes; specifically iterate over VERSION_METADATA_TARGETS, check file existence/matching (e.g., with file(GLOB ...) or if(EXISTS ...) resolution) and fail the configure with a clear error if any entry is missing, matches multiple files, or contains "SKYUI_" so future additions are validated at configure time.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@cmake/ImportToSWF.cmake`:
- Around line 190-205: For targets listed in VERSION_METADATA_TARGETS (found via
CLASSPATH -> _TARGET_INDEX) do not silently fallback to file(COPY_FILE) when the
class regex fails; instead, detect the failed match of _CONTENT and replace the
else branch (the file(COPY_FILE "${SRC}" "${DST}") path) with a failing build
message (e.g., message(FATAL_ERROR "...")) that includes the SOURCE (SRC), DEST
(DST) and CLASSPATH/_TARGET_INDEX context so the build stops and developers can
fix the class declaration or file formatting rather than producing a file
missing the SKYUI_* members; update the else branch handling around the class
injection code that produces _MODIFIED_CONTENT to call message(FATAL_ERROR ...)
with a clear error string.
---
Nitpick comments:
In `@Version.cmake`:
- Around line 7-25: Add a configure-time validation in Version.cmake to verify
each entry in the VERSION_METADATA_TARGETS list actually resolves to exactly one
file using the stripped-path convention and contains no leftover SKYUI_*
prefixes; specifically iterate over VERSION_METADATA_TARGETS, check file
existence/matching (e.g., with file(GLOB ...) or if(EXISTS ...) resolution) and
fail the configure with a clear error if any entry is missing, matches multiple
files, or contains "SKYUI_" so future additions are validated at configure time.
🪄 Autofix (Beta)
✅ Autofix completed
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: e2e03cb7-9ecf-4321-839b-045039286baf
📒 Files selected for processing (20)
CMakeLists.txtVersion.cmakecmake/ImportToSWF.cmakesource/actionscript/CraftingMenu/CraftingLists.assource/actionscript/CraftingMenu/CraftingMenu.assource/actionscript/FavoritesMenu/FavoritesMenu.assource/actionscript/HUDWidgets/WidgetLoader.assource/actionscript/ItemMenus/BarterMenu.assource/actionscript/ItemMenus/BottomBar.assource/actionscript/ItemMenus/ContainerMenu.assource/actionscript/ItemMenus/GiftMenu.assource/actionscript/ItemMenus/InventoryLists.assource/actionscript/ItemMenus/InventoryMenu.assource/actionscript/ItemMenus/ItemCard.assource/actionscript/ItemMenus/MagicMenu.assource/actionscript/MapMenu/Map/MapMenu.assource/actionscript/ModConfigPanel/ConfigPanel.assource/actionscript/ModConfigPanel/SkyUISplash.assource/actionscript/PauseMenu/Quest_Journal.assource/actionscript/TweenMenu/TweenMenu.as
💤 Files with no reviewable changes (17)
- source/actionscript/CraftingMenu/CraftingLists.as
- source/actionscript/ItemMenus/BarterMenu.as
- source/actionscript/ModConfigPanel/SkyUISplash.as
- source/actionscript/ItemMenus/ContainerMenu.as
- source/actionscript/HUDWidgets/WidgetLoader.as
- source/actionscript/ItemMenus/GiftMenu.as
- source/actionscript/FavoritesMenu/FavoritesMenu.as
- source/actionscript/TweenMenu/TweenMenu.as
- source/actionscript/ItemMenus/InventoryMenu.as
- source/actionscript/ModConfigPanel/ConfigPanel.as
- source/actionscript/ItemMenus/ItemCard.as
- source/actionscript/CraftingMenu/CraftingMenu.as
- source/actionscript/MapMenu/Map/MapMenu.as
- source/actionscript/ItemMenus/BottomBar.as
- source/actionscript/PauseMenu/Quest_Journal.as
- source/actionscript/ItemMenus/MagicMenu.as
- source/actionscript/ItemMenus/InventoryLists.as
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Fixes Applied SuccessfullyFixed 1 file(s) based on 1 unresolved review comment. Files modified:
Commit: The changes have been pushed to the Time taken: |
Fixed 1 file(s) based on 1 unresolved review comment. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
Summary by CodeRabbit