Skip to content

Migrate preprocessor to StoneCutter standard syntax & fix IDE errors#14

Open
Little1Yuan wants to merge 1 commit into
RedxAx:26.1from
Little1Yuan:26.1
Open

Migrate preprocessor to StoneCutter standard syntax & fix IDE errors#14
Little1Yuan wants to merge 1 commit into
RedxAx:26.1from
Little1Yuan:26.1

Conversation

@Little1Yuan

Copy link
Copy Markdown

Changes:

Remove Groovy Java preprocessor from build.gradle (resources untouched) to stop generating duplicate files in versions/*/build/generated/java

Convert 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.2 to 0.9.6

Result:

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.

…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.
@Little1Yuan

Copy link
Copy Markdown
Author

Run Gradle work stonecutterSwitchToXxx to switch among versions or use IDEA plugin StoneCutter Dev to get better efficiency. Comments will be automatically processed by the work.

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.

1 participant