Add better support for April Fools snapshots#4
Merged
sciwhiz12 merged 3 commits intoneoforged:mainfrom Apr 2, 2025
Merged
Conversation
This acts as an addition/subtraction combo that is only used if the versions field is not set. Useful for April Fools snapshots. Add settings.gradle for Gradle JDK resolution. Fixes case when user does not have the necessary JDK downloaded (like me not having J21 for 24w14a) and tries to import with Gradle. Fix bug calculating target version if it is omitted Change initial commit generation to only copy gradle/wrapper instead of gradle to account for a potential future use of libs.versions.toml by excluding it Fix parsing of --cfg parameter when provided URI uses the file scheme Update Gradle to 8.7
Last commit published: c733a8320efe6e252ef25ff0b1e892c1c53797ab. PR PublishingThe artifacts published by this PR:Repository DeclarationIn order to use the artifacts published by the PR, add the following repository to your buildscript: repositories {
maven {
name 'Maven for PR #4' // https://github.com/neoforged/snowblower/pull/4
url 'https://prmaven.neoforged.net/snowblower/pr4'
content {
includeModule('net.neoforged', 'snowblower')
}
}
} |
sciwhiz12
reviewed
Apr 12, 2024
|
@SizableShrimp, this pull request has conflicts, please resolve them for this PR to move forward. |
sciwhiz12
approved these changes
Apr 2, 2025
Member
|
For testing, here is a version of that sample |
|
🚀 This PR has been released as snowblower version |
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.
The biggest addition is adding 2 new fields to
BranchSpecto make it easier to define April Fools snapshots from a config json. The demo branch_config.json file in the repository is not really useful, as it assumes that all April Fools versions should be diffed from each other. This makes no sense since each snapshot is forked from the snapshot cycle for that year.Instead, I propose adding 2 fields:
includeVersionsandexcludeVersionsincludeVersionsbasically has the sole purpose of opting in to specific "special" versions as categorized by SRGUtils, but it's primarily meant for use w/ April Fools snapshots. It doesn't actually add any extra versions, but I'm not sure how to better name it to reflect this.excludeVersionslets you exclude specific versions from the list of versions, rather than having to define all versions you want use. This allows us to have April Fools snapshots with the full diff history of all snapshots/versions before it, while accounting for the fact that the April Fools snapshot may have been forked from an earlier snapshot in the dev cycle than the snapshot released right before the April Fools one.Besides the main addition, I also fixed/added some miscellaneous things:
settings.gradlefile with the foojay resolver convention plugin for JDK resolution. This just makes it easier to import into an IDE if anyone does that for better inspection (like I did while testing my Snowblower changes). In this rare case, the JDK was bumped to 21 in the latest snapshot, and I didn't have it downloaded, so Gradle failed to import since the resolver plugin wasn't specified.gradle/wrapperinstead ofgradle, to account for the fact that this project might uselibs.versions.toml(or some other file ingradlebut notgradle/wrapper?) in the future, which shouldn't be included in the Snowblower jar nor the final output--cfgparameter on the CLI to actually supportfile:URIsHere's a demo on how to test with the 2024 April Fools snapshot using this config.json:
--output output --cfg https://gist.githubusercontent.com/SizableShrimp/ab8a7882a91978bbd8eb96f2a467f2bc/raw/b8e5f4ed5a61f71b51c66f7094468d111319aa41/config.json --branch april-fools/2024 --start-over-if-required24w12ato only have to decompile 2 MC versions:--output output --cfg https://gist.githubusercontent.com/SizableShrimp/ab8a7882a91978bbd8eb96f2a467f2bc/raw/b8e5f4ed5a61f71b51c66f7094468d111319aa41/config.json --branch april-fools/2024 --start-over-if-required --start-ver 24w12aAssuming that we do go ahead with this idea, I would suggest we maintain a
config.jsonURL somewhere. Every time a new April Fools snapshot comes out, we can add on to thisconfig.json. Then, we can change the TeamCity configuration to specify this config json in every run. We would have a template (or whatever the TC equivalent is) that lets us do one-off builds running the standard Snowblower template and has a parameter to specify the branch name. This template thing would be run after having added the relevant configuration for that branch to theconfig.json. The branch name would follow some consistent format for each April Fools snapshot. I proposeapril-fools/XXXXwhereXXXXis the year.We could also retroactively do this for every older April Fools snapshot that has mojmaps just for fun to be able to poke at the code whenever.