Skip to content
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

Autogenerate spec version for modpacks #4173

Merged

Conversation

HebaruSan
Copy link
Member

Motivation

#2971 updated the spec version for modpacks from v1.6 to v1.18 so the license could validly be set to Unlicense. In principle, anytime we add a new license or change anything else that might depend on the spec version, we need to bump the generated modpacks' spec version by hand. And in fact we've already missed this once, when the MPL-2.0 license was added in v1.30.

Now that we have a way to calculate spec versions automatically (see #4155), it makes sense to eliminate this as a manually maintained item.

Changes

  • SpecVersionTransformer.MinimumSpecVersion is moved to a new static class SpecVersionAnalyzer in Core
  • A new override of MinimumSpecVersion accepts a CkanModule parameter instead of JObject (converted with JObject.FromObject)
  • RegistryManager.GenerateModpack uses SpecVersionAnalyzer.MinimumSpecVersion to set the default spec version before it returns its module
  • EditModpack.ExportModpackButton_click uses SpecVersionAnalyzer.MinimumSpecVersion to set the spec version after the user finishes editing and before the modpack is saved to disk

@HebaruSan HebaruSan added Enhancement New features or functionality Easy This is easy to fix Core (ckan.dll) Issues affecting the core part of CKAN labels Sep 4, 2024
@HebaruSan HebaruSan merged commit fde0845 into KSP-CKAN:master Sep 4, 2024
3 checks passed
@HebaruSan HebaruSan deleted the feature/modpack-auto-spec-version branch September 4, 2024 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core (ckan.dll) Issues affecting the core part of CKAN Easy This is easy to fix Enhancement New features or functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant