-
-
Notifications
You must be signed in to change notification settings - Fork 5
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 better support for April Fools snapshots #4
base: main
Are you sure you want to change the base?
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: d85c7b73af8943a66953180decf31fe6f17b16e8. 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')
}
}
} |
List<MinecraftVersion> versions, | ||
List<MinecraftVersion> includeVersions, | ||
List<MinecraftVersion> excludeVersions |
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.
We really should work on adding proper @Nullable
annotations everywhere, but alas that would mean also adding @NotNull
annotations because JetBrains' annotations have no non-null-by-default annotation.
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.
Not even sure what is nullable vs. not in the project. Do you want me to go through and try to add that to everything? I think notnull is a bit excessive if we document everything explicitly nullable.
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.
Just use of @Nullable
is fine imo, @NotNull
is noise and would be littered on virtually everything
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.
I think, for the sake of keeping this PR's scope limited, @Nullable
should be added to these components, so we can gradually start marking things as @Nullable
(with the intention that anything that isn't annotated should be taken as @NotNull
, at least by developers/reviewers).
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.
Yeah that's fine. We don't need to attempt a full-scale @Nullable
rollout for this PR, just for the components it adds/changes
The biggest addition is adding 2 new fields to
BranchSpec
to 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:
includeVersions
andexcludeVersions
includeVersions
basically 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.excludeVersions
lets 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.gradle
file 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/wrapper
instead ofgradle
, to account for the fact that this project might uselibs.versions.toml
(or some other file ingradle
but notgradle/wrapper
?) in the future, which shouldn't be included in the Snowblower jar nor the final output--cfg
parameter 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-required
24w12a
to 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 24w12a
Assuming that we do go ahead with this idea, I would suggest we maintain a
config.json
URL 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/XXXX
whereXXXX
is 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.