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

Add dependency overrides #214

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Matyrobbrt
Copy link
Member

@Matyrobbrt Matyrobbrt commented Nov 14, 2024

This implements a simple system that allows users to override dependency constraints using the fml config by adding an entry as follows:

dependencyOverrides.target = ["-dep1", "+dep2"]

Minus can be used to soften dependency constraints (version range becomes unbounded, type becomes optional, but the ordering stays the same) and plus can be used to add an ordering dependency (the target mod will load AFTER the dependency)
All overrides are marked in the log at WARN level for visibility.
Closes #52

@neoforged-pr-publishing
Copy link

neoforged-pr-publishing bot commented Nov 14, 2024

  • Publish PR to GitHub Packages

Last commit published: 3ca3e7b0d1197d9170803e119acd027d6dfb586f.

PR Publishing

The artifacts published by this PR:

Repository Declaration

In order to use the artifacts published by the PR, add the following repository to your buildscript:

repositories {
    maven {
        name 'Maven for PR #214' // https://github.com/neoforged/FancyModLoader/pull/214
        url 'https://prmaven.neoforged.net/FancyModLoader/pr214'
        content {
            includeModule('net.neoforged.fancymodloader', 'loader')
            includeModule('net.neoforged.fancymodloader', 'junit-fml')
            includeModule('net.neoforged.fancymodloader', 'tests')
            includeModule('net.neoforged.fancymodloader', 'earlydisplay')
        }
    }
}

@TelepathicGrunt
Copy link
Contributor

“dependencyOverries”
Typo in description btw. Just double check typo isn’t in the code too.

@Matyrobbrt Matyrobbrt added the enhancement New feature or request label Nov 15, 2024
@shartte
Copy link
Contributor

shartte commented Nov 15, 2024

Simple and you even added tests! <3

# Dependency overrides can be used to forcibly remove a dependency constraint from a mod or to force a mod to load AFTER another mod
# Using dependency overrides can cause issues. Use at your own risk.
# Example dependency override for the mod with the id 'targetMod': dependency constraints (incompatibility clauses or restrictive version ranges) against mod 'dep1' are removed, and the mod will now load after the mod 'dep2'
# dependencyOverrides.targetMod = ["-dep1", "+dep2"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to show the expanded syntax instead? idk

[dependencyOverrides]
targetMod = ["-dep1", "+dep2"]
targetMod2 = ["-dep3", "-dep4"]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh, I feel like this is clear enough. And besides, multi-line doesn't really work with comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add dependency override for player/pack maker to bypass limits set in mod's mods.toml file
4 participants