-
-
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
Legacy plugin for 1.17 to 1.20.1 #118
base: main
Are you sure you want to change the base?
Conversation
Last commit published: 72efbd34f1d2de32da59c63ee9b4bcdf27aaec56. 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 #118' // https://github.com/neoforged/ModDevGradle/pull/118
url 'https://prmaven.neoforged.net/ModDevGradle/pr118'
content {
includeModule('net.neoforged', 'moddev-gradle')
includeModule('net.neoforged.moddev', 'net.neoforged.moddev.gradle.plugin')
includeModule('net.neoforged.moddev.repositories', 'net.neoforged.moddev.repositories.gradle.plugin')
includeModule('net.neoforged.moddev.legacy', 'net.neoforged.moddev.legacy.gradle.plugin')
}
}
} |
@shartte, this pull request has conflicts, please resolve them for this PR to move forward. |
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 too bad. However, it is clear that this can only work as long as keep the toolchain essentially the same. When we will remove the legacy CP, this legacy plugin will go out of the window. This is also why I don't see this ever supporting 1.16. This raises the question of whether the plugin should exist in the same branch or not.
@@ -1,6 +1,6 @@ | |||
distributionBase=GRADLE_USER_HOME | |||
distributionPath=wrapper/dists | |||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip | |||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip |
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.
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip | |
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-all.zip |
We are writing a plugin, I want the sources.
repositories { | ||
mavenLocal() | ||
maven { | ||
name 'cursemaven' | ||
url 'https://cursemaven.com' | ||
content { | ||
includeGroup "curse.maven" | ||
} | ||
} | ||
} |
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.
Remove unused mavens. (Before merging)
|
||
dependencies { | ||
modCompileOnly('mezz.jei:jei-1.20.1-forge:15.17.0.76') { | ||
transitive = false |
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.
Why?
dependencies { | ||
modCompileOnly('mezz.jei:jei-1.20.1-forge:15.17.0.76') { | ||
transitive = false | ||
} | ||
modRuntimeOnly('curse.maven:mekanism-268560:5662583') | ||
modImplementation('curse.maven:applied-energistics-2-223794:5641282') | ||
} |
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.
Do we really want to have these deps in repo? 😅
import javax.inject.Inject; | ||
import java.util.List; | ||
|
||
public abstract class MixinExtension { |
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 should move all extensions to a root extension. For example neoForgeLegacy
.
@@ -244,7 +257,7 @@ public static ModFoldersProvider getIdeaModFoldersProvider(Project project, | |||
folders = getModFoldersForGradle(project, modsProvider, includeUnitTests); | |||
} | |||
|
|||
var modFoldersProvider = project.getObjects().newInstance(ModFoldersProvider.class); | |||
var modFoldersProvider = project.getObjects().newInstance(ModFoldersProvider.class, project); |
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.
Unnecessary.
@@ -395,24 +408,29 @@ record AssetProperties(String assetIndex, String assetsRoot) { | |||
|
|||
abstract class ModFoldersProvider implements CommandLineArgumentProvider { | |||
@Inject | |||
public ModFoldersProvider() { | |||
public ModFoldersProvider(Project project) { | |||
getClassesArgument().set(project.provider(() -> { |
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.
You don't need the ugly provider call. You can use getModFolders().map(...)
.
|
||
public record UserDevConfig(String mcp, String sources, String universal, List<String> libraries, List<String> modules, | ||
Map<String, UserDevRunType> runs) implements Serializable { | ||
public static UserDevConfig from(File userDevFile) { | ||
// For backwards compatibility reasons we also support loading this from the userdev jar |
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 don't like this at all, it's such a hack.
@@ -0,0 +1,8 @@ | |||
|
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 working (yet)?
RunUtils.escapeJvmArg(RunUtils.getEclipseModFoldersProvider(project, run.getMods(), false).getArgument()) | ||
) | ||
.args(RunUtils.escapeJvmArg(RunUtils.getArgFileParameter(prepareTask.getProgramArgsFile().get()))) | ||
.envVar(run.getEnvironment().get()) | ||
.envVar(RunUtils.replaceModClassesEnv(run, () -> RunUtils.getEclipseModFoldersProvider(project, run.getMods(), false))) |
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 to mention that this sets both MOD_CLASSES
and --fml.modFolders
.
Adds a separate
net.neoforged.moddev.legacy
plugin that lives in a different sourceset and can be used to develop for Minecraft and Forge 1.17 to 1.20.1.