Migrate preprocessor to StoneCutter standard syntax & fix IDE errors#14
Open
Little1Yuan wants to merge 1 commit into
Open
Migrate preprocessor to StoneCutter standard syntax & fix IDE errors#14Little1Yuan wants to merge 1 commit into
Little1Yuan wants to merge 1 commit into
Conversation
…ntax
- Remove Groovy-based preprocessing logic from build.gradle to eliminate
duplicate generated files in versions/*/build/generated/java, which
caused IDE errors (resources remain handled by existing text processing)
- Convert all legacy preprocessor directives to StoneCutter-compatible syntax:
- //#if MC >= xx → //? if >= xx {
- //#elseif MC >= xx → //? } elif >= xx {
(Applied via regex batch replacement with manual fixes for edge cases)
- Bump StoneCutter plugin from 0.9.2 to 0.9.6
With these changes, the StoneCutter Dev plugin can now correctly resolve
conditional code blocks. Switching the active version via the plugin's
tool window automatically comments out other versions' code, preventing
IDE red-underlines and ensuring a smooth development experience.
Author
|
Run Gradle work |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changes:
Remove Groovy Java preprocessor from
build.gradle(resources untouched) to stop generating duplicate files inversions/*/build/generated/javaConvert all legacy conditionals to StoneCutter syntax via regex + manual fixes
//#if MC >= xx->//? if >= xx {//#elseif MC >= xx->//? } elif >= xx {Bump StoneCutter from
0.9.2to0.9.6Result:
StoneCutter Dev plugin now works correctly – selecting a version automatically comments out others, eliminating IDE red errors.
Tested: Builds pass for 26.2; resource processing unchanged.