-
-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add findDuplicateMappingFiles
task
#617
Add findDuplicateMappingFiles
task
#617
Conversation
> Found classes mapped by multiple files! CLASS net/minecraft/unmapped/C_zjsuejaf is mapped by: C:\Users\super\Projects\Minecraft\Modding\Quilt\quilt-mappings\mappings\net\minecraft\datafixer\fix\AttributeIdFix.mapping C:\Users\super\Projects\Minecraft\Modding\Quilt\quilt-mappings\mappings\net\minecraft\datafixer\fix\AttributeModifierIdFix.mapping CLASS net/minecraft/unmapped/C_dxtlxcwy is mapped by: C:\Users\super\Projects\Minecraft\Modding\Quilt\quilt-mappings\mappings\net\minecraft\datafixer\fix\RemoveEmptyItemInSuspiciousBlockFix.mapping C:\Users\super\Projects\Minecraft\Modding\Quilt\quilt-mappings\mappings\net\minecraft\datafixer\fix\RemoveEmptyItemInBrushableBlockFix.mapping |
It would also be trivial to add checking for empty files, files that don't match the regex, and files that don't have the |
…k non-obfuscated classes; log similarly to MappingLintTask with a short exception message
Went ahead and added those checks. Found 1 class mapped by multiple files! CLASS net/minecraft/unmapped/C_xyxorzsk is mapped by: C:\Users\super\Projects\Minecraft\Modding\Quilt\quilt-mappings\mappings\net\minecraft\WorldVersion.mapping C:\Users\super\Projects\Minecraft\Modding\Quilt\quilt-mappings\mappings\net\minecraft\WorldVersion2.mapping2 Found 1 empty file! C:\Users\super\Projects\Minecraft\Modding\Quilt\quilt-mappings\mappings\net\minecraft\WorldVersionEMPTY.mapping3 Found 1 file not mapping a class! C:\Users\super\Projects\Minecraft\Modding\Quilt\quilt-mappings\mappings\net\minecraft\WorldVersionNO_CLASS.mapping Found 2 files without the mapping extension! C:\Users\super\Projects\Minecraft\Modding\Quilt\quilt-mappings\mappings\net\minecraft\WorldVersion2.mapping2 C:\Users\super\Projects\Minecraft\Modding\Quilt\quilt-mappings\mappings\net\minecraft\WorldVersionEMPTY.mapping3 FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':findDuplicateMappingFiles'. > Found 1 class mapped by multiple files, 1 empty file, 1 file not mapping a class, and 2 files without the mapping extension! See the log for details. |
private static final Pattern MINECRAFT_CLASS = Pattern.compile("^CLASS net/minecraft/(?:\\w+/)*\\w+(?= )");
private static final Pattern BLAZE_CLASS = Pattern.compile("^CLASS com/mojang/blaze3d/(?:\\w+/)*\\w+(?= )"); these could be generalized to private static final Pattern ANY_CLASS = Pattern.compile("^CLASS (?:\\w+/)+\\w+(?= )"); idk if we want to allow classes outside of |
Until a good reason comes, I think disallowing anything outside of those two root packages is a good idea. |
buildSrc/src/main/java/quilt/internal/tasks/lint/FindDuplicateMappingFilesTask.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fantastic work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we have the check
task depend on this like the MappingsLint
task?
Sure; instead of |
Oh! I missed that! Looks good! |
@ix0rai with this, do we want to enforce that all PRs are up to date before merging (like QSL)? it'll make merging multiple PRs in a row annoying, but will make sure that this is caught in a PR and not once 3 branches are merged at once |
I think we should, it's probably possible to automate checking them using actions and merge queue |
Adds
findDuplicateMappingFiles
gradle task that checks for mapping files that map the same class.Useful when merging/rebasing.
It just matches the first line of each file against
and if it finds any files with the same one it throws an exception listing them."^CLASS net/minecraft/unmapped/C_\\w+"
edit: it matches against this now:
Also makes
mappingLint
depend onfindDuplicateMappingFiles
.Edit: also removes current duplicate mapping files so the build run can complete.