QuiltMC / quilt-mappings

Quilt's Mappings for Minecraft
Creative Commons Zero v1.0 Universal
96 stars 76 forks source link

gradle cleanup #645

Closed supersaiyansubtlety closed 1 day ago

supersaiyansubtlety commented 2 months ago

Ready!

Tasks

Summary

renames MappingsPlugin/mappings-logic -> QuiltMappingsPlugin/quilt-mappings renames MappingssExtension/mappings -> QuiltMappingsExtension/quiltMappings splits QuiltMappingsPlugin into:

all implement MappingsProjectPlugin and are applied by QuiltMappingsPlugin

eliminates FileConstants:

adds several extensions that expose objects created by their plugins extensions are accessed via plugin instances which ensures extension have been created

no use of tasks.named(...) to access custom tasks:

ensures all custom tasks have a group eliminates MappingsTask and DefaultMappingsTask (some MappingsTask methods are replaced with helper methods in more specific task interfaces and plugins)

moves Constants.MINECRAFT_VERSION to libs.versions.toml and passes it to QuiltMappingsExtension moves Constants.MAPPINGS_VERSION to direct project.version assignment in build.gradle and passes it to QuiltMappingsExtension moves dictionary file url to libs.versions.toml and downloads it with an ivy repository hack eliminates downloadDictionaryFile and passes the dictionary file to mappingLint in build.gradle saves unpickVersion in a QuiltMappingsEntension field and passes it to the constructors of tasks that require it (it's required at configuration time for some tasks so it can't be a property)

extracts a bunch of magic strings to interfaces in constants package moves all task names to their classes and renames all TASK_NAME fields <ACTUAL_NAME>_TASK_NAME adds javadocs to all task names that link the plugin that registers them adds javadocs to each plugin with any configurEaches listing what they do (these can be annoying to track down) adds javadocs to each class that's configureEached and to all their subclasses, linking the plugin that does the configuring (these can be really annoying to track down)

moves almost all outputs to build/* moves combineUnpickDefinitions's output to build/mappings/ eliminates custom clean task logic (everything is in build/ and gets cleaned)

names AbstractArchiveTask outputs using its name composition methods adds ArtifactFileProducingTask which mimics AbstractArchiveTask name composition (implemented by CompressTinyTask) eliminates explicit classifiers for published artifacts in build.gralde

mapped providers are the solution to every problem

moves unpick.json to unpick/ and unpick definitions to unpick/definitions/ moves enimga_profile.json and simple_type_field_names.json5 to enigma/

eliminates decompileClasspath configuration -> passes downloadMinecraftLibraries.librariesDir.fileTree replaces CheckStuffExists/Matches tasks with mapped providers

populates unpickCli configuration using included build :unpick-holders splits enigmaRuntime configuration into enigmaSwing and enigmaServer, populates them using :unpick-holders

replaces de.undercouch.gradle.tasks.download.DownloadAction usage with DownloadUtil methods (which use org.apache.commons.io.FileUtils::copyURLToFile) eliminates de.undercouch:gradle-download-task dependency

adds generateDiff task (Windows users may have to put diff on their PATH)

Future

supersaiyansubtlety commented 2 months ago

Early reviewers beware: I will probably be rewriting history so any review progress on github may be lost. Ready -ish

github-actions[bot] commented 1 month ago

🚨 Target branch is already set to 24w39a

github-actions[bot] commented 1 month ago

🚀 Target branch has been updated to 24w40a

github-actions[bot] commented 1 month ago

🚨 Please fix merge conflicts before this can be merged

supersaiyansubtlety commented 1 month ago

Note: Rather than marking this PR as ready for review, when it's ready I'll be closing it and creating a new one. That will clean up the messy history here on GitHub caused by rewriting history. Never mind, it cleaned itself up, I underestimated GitHub.

github-actions[bot] commented 1 month ago

🚀 Target branch has been updated to 1.21.2-pre1

github-actions[bot] commented 1 month ago

🚀 Target branch has been updated to 1.21.2-pre2

github-actions[bot] commented 1 month ago

🚨 Please fix merge conflicts before this can be merged

github-actions[bot] commented 1 month ago

🚀 Target branch has been updated to 1.21.2-pre3

github-actions[bot] commented 1 month ago

🚨 Please fix merge conflicts before this can be merged

github-actions[bot] commented 1 month ago

🚀 Target branch has been updated to 1.21.2-pre5

github-actions[bot] commented 1 month ago

🚨 Please fix merge conflicts before this can be merged

github-actions[bot] commented 1 month ago

🚀 Target branch has been updated to 1.21.2-rc1

github-actions[bot] commented 1 month ago

🚨 Please fix merge conflicts before this can be merged

github-actions[bot] commented 1 month ago

🚀 Target branch has been updated to 1.21.2

github-actions[bot] commented 1 month ago

🚨 Please fix merge conflicts before this can be merged

github-actions[bot] commented 1 month ago

🚀 Target branch has been updated to 1.21.3

github-actions[bot] commented 1 month ago

🚨 Please fix merge conflicts before this can be merged

supersaiyansubtlety commented 4 weeks ago

resolved Forgot one question:

These properties should be versions in the catalog, but gson and netty already have different, unused versions in the catalog:

Which versions of gson and netty do we want?

supersaiyansubtlety commented 4 weeks ago

Re: Configuration cache

I tried running some tasks with --configuration-cache and got:

Configuration cache state could not be cached: field pendingMap of org.gradle.api.internal.DefaultNamedDomainObjectCollection$UnfilteredIndex bean found in field delegate of org.gradle.api.internal.DefaultNamedDomainObjectCollection$FilteredIndex bean found in field index of org.gradle.api.internal.tasks.DefaultTaskCollection bean found in field delegate of org.gradle.api.internal.tasks.DefaultRealizableTaskCollection bean found in input property $1 of task :buildMappingsTiny of type quilt.internal.task.build.BuildMappingsTinyTask: error writing value of type 'java.util.LinkedHashMap' java.util.ConcurrentModificationException (no error message)

That's for buildMappingsTiny, I got a similar error mentioning error writing value of type 'java.util.LinkedHashMap' for findDuplicateMappingFiles.

idk how to fix these because idk where the LinkedHashMap comes from.

configuration caching will have to go in a followup PR If it turns out it wouldn't take too many changes to fix config caching I'm ok with including it in this PR, otherwise it'll have to go in a followup PR.

github-actions[bot] commented 3 weeks ago

🚀 Target branch has been updated to 24w44a

github-actions[bot] commented 3 weeks ago

🚨 Please fix merge conflicts before this can be merged

github-actions[bot] commented 3 weeks ago

🚀 Target branch has been updated to 24w45a

github-actions[bot] commented 3 weeks ago

🚨 Please fix merge conflicts before this can be merged

ix0rai commented 2 weeks ago

is there anything that remains to be done on this now that #659 is merged?

supersaiyansubtlety commented 2 weeks ago

is there anything that remains to be done on this now that #659 is merged?

It's not waiting on any other PRs, but I need to merge changes and make sure tests work. done

There are also a few unresolved questions above. resolved

github-actions[bot] commented 1 week ago

🚀 Target branch has been updated to 24w46a

github-actions[bot] commented 1 week ago

🚨 Please fix merge conflicts before this can be merged

github-actions[bot] commented 1 week ago

🚀 Target branch has been updated to 1.21.4-pre1

github-actions[bot] commented 1 week ago

🚨 Please fix merge conflicts before this can be merged