firstdarkdev / modpublisher

A dual publishing Gradle Plugin to publish mods to Modrinth, Curseforge and GitHub in one go
MIT License
19 stars 3 forks source link

Feature: Define supported Java versions for CurseForge uploads #4

Closed iChun closed 8 months ago

iChun commented 10 months ago

As per title:

CurseForge allows marking supported Java versions in mod files but there lacks an ability to tag uploaded files with that information. Hoping to have a method added for that.

Thanks!

hypherionmc commented 10 months ago

Hey there

In theory it should be possible to just add the java versions as a game version (Like Java 8, Java 17) as curse just handles them as game versions.

The only place I see this being a problem is with Modrinth.

So I can either add a separate method to add java versions, which will only apply it to curse, or, I need to filter out any version that starts with Java on Modrinth.

Maybe having a dedicated method for this should be fine. I've been wanting to implement some auto detection features like Cursegradle and Minotaur has. Just haven't bothered yet cause no one asked for it lol

hypherionmc commented 10 months ago

Implemented with 2.0.3.

// Add supported java versions. Currently only used by CurseForge
setJavaVersions("Java 8", "Java 11")
MattSturgeon commented 8 months ago

It'd be great if setJavaVersion could also accept org.gradle.api.JavaVersions.

That way we can reference project.java.targetCompatibility or project.java.toolchain.languageVersion.

JavaVersion can be converted to the current string format using "Java ${it.getMajorVersion()}".

hypherionmc commented 8 months ago

Damn discord webhooks being faster than my email lol.

Great idea. Will look at adding support for it