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

Allow using a VersionFactory/Rich Version in for neoForge.version #161

Open
Tslat opened this issue Sep 22, 2024 · 2 comments
Open

Allow using a VersionFactory/Rich Version in for neoForge.version #161

Tslat opened this issue Sep 22, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@Tslat
Copy link

Tslat commented Sep 22, 2024

The build.gradle line for version in the neoForge block explicitly requires a string.

This is a problem for people who use version catalogues, because it doesn't allow resolution of the version artifact from the catalogue, and forces you to explicitly type the version again as a string

E.G.

neoForge {
  version = "21.1.57" // I have to explicitly type the version string here (or use gradle properties, etc..)
}

I want to be able to use the version I already defined in my version catalogue (as is gradle's recommendation)

neoforge {
  version = libs.versions.neoForge // Version catalogue VersionFactory, same as you'd use for a dependency
}
@Tslat Tslat changed the title Allow using a VersionFactory in for neoForge.version Allow using a VersionFactory/Rich Version in for neoForge.version Sep 22, 2024
@Matyrobbrt Matyrobbrt added the enhancement New feature or request label Sep 22, 2024
@Matyrobbrt
Copy link
Member

Note that you can use catalogs it by calling get() on the dependency (see https://docs.gradle.org/current/userguide/platforms.html#ex-using-a-version-declared-in-a-version-catalog)

neoForge {
    version = libs.neoforge.get()
}

@Tslat
Copy link
Author

Tslat commented Sep 22, 2024

Note that you can use catalogs it by calling get() on the dependency (see https://docs.gradle.org/current/userguide/platforms.html#ex-using-a-version-declared-in-a-version-catalog)

neoForge {
    version = libs.neoforge.get()
}

No this returns the required version, not the preferred version

Meaning you can't specify a lower required version than preferred version (which is a problem)

I.E. Using this rich version:
image
Causes MDG to use 21.1.44, not 21.1.57

and worse than that, it doesn't actually return 21.1.44, it returns [21.1.44,) as this is the string equivalent of that rich version notation, so you end up having to manually parse out the symbols yourself to make it even work

Here's what it looks like when you try that:

Caused by: java.net.URISyntaxException: Illegal character in path at index 60: https://maven.neoforged.net/releases/net/neoforged/neoforge/[21.1.44,)/neoforge-[21.1.44,)-userdev.jar

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

No branches or pull requests

2 participants