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

Replace NG use by a custom neodev plugin built on top of NFRT and MDG #1485

Draft
wants to merge 12 commits into
base: 1.21.x
Choose a base branch
from

Conversation

Technici4n
Copy link
Member

@Technici4n Technici4n commented Aug 24, 2024

This PR replaces our use of NG by a custom plugin that is based on NFRT and MDG, and lives in the buildSrc/ folder.

The main advantages are as follows:

  • Make continued development of the plugin, and by extension of a lot of our toolchain, easier, by integrating it into the same repository as NeoForge itself.
    • Large changes to the Gradle setup do not require us to start a new major version of the plugin that modders are using.
  • Reduce the unnecessary complexity that would come with wanting to design "DSLs" for every aspect of neodev.
  • Make further experiments (binpatch changes, split sources, includeBuild for NeoForge, etc...) easier to develop and deliver.
  • Thanks to NFRT, the asset folder from various launchers is reused.

TODO:

  • Eclipse support
  • Junit runs and our own junit tests
  • Server installer
  • A lot more testing!
  • Big pass(es) of cleanup to simplify even more.
    • Decide how to manage versions.
    • Other cleanup.
  • Integrate related MDG changes (Rework Runs and Unit Testing to be reusable from NeoDev ModDevGradle#141), and decide on a policy to keep them reasonably stable.
  • Update DiffPatch to io.codechicken variant.

@neoforged-pr-publishing
Copy link

neoforged-pr-publishing bot commented Aug 24, 2024

  • Publish PR to GitHub Packages

Last commit published: 14807ec48523497209e756f609225f9527a0c1c7.

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 #1485' // https://github.com/neoforged/NeoForge/pull/1485
        url 'https://prmaven.neoforged.net/NeoForge/pr1485'
        content {
            includeModule('net.neoforged', 'neoforge')
            includeModule('net.neoforged', 'testframework')
        }
    }
}

MDK installation

In order to setup a MDK using the latest PR version, run the following commands in a terminal.
The script works on both *nix and Windows as long as you have the JDK bin folder on the path.
The script will clone the MDK in a folder named NeoForge-pr1485.
On Powershell you will need to remove the -L flag from the curl invocation.

mkdir NeoForge-pr1485
cd NeoForge-pr1485
curl -L https://prmaven.neoforged.net/NeoForge/pr1485/net/neoforged/neoforge/21.3.30-beta-pr-1485-features-moddevgradle/mdk-pr1485.zip -o mdk.zip
jar xf mdk.zip
rm mdk.zip || del mdk.zip

To test a production environment, you can download the installer from here.

@neoforged-automation
Copy link

@Technici4n, this pull request has conflicts, please resolve them for this PR to move forward.

build.gradle Outdated
Comment on lines 42 to 43
// Remove src/ sources from the root project. They are used in the neoforge subproject.
sourceSets {
main {
java {
srcDirs = []
}
resources {
srcDirs = []
}
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Was this previously done in NG?

Copy link
Member Author

Choose a reason for hiding this comment

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

Looks like it wasn't necessary because the java plugin wasn't getting applied to the root project? I'm not sure why I had to apply java, I think it's for the neodev plugin. We shouldn't need the neodev plugin for the root project though.

build.gradle Outdated
@@ -3,6 +3,7 @@ import java.util.regex.Pattern

plugins {
id 'net.neoforged.gradleutils' version '3.0.0'
id 'net.neoforged.neodev'
Copy link
Member Author

Choose a reason for hiding this comment

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

Should probably be apply false?

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

Successfully merging this pull request may close these issues.

2 participants