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

Use an in-tree Gradle plugin instead of an external Gradle Plugin to make version-specific changes easier #1485

Merged
merged 39 commits into from
Nov 22, 2024

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.
  • Reduce the unnecessary complexity that would come with wanting to design "DSLs" for every aspect of neodev.
  • Make further experiments easier to develop and deliver.
  • Thanks to NFRT, the asset folder from various launchers is reused.
  • Fully Gradle-free runs for both IntelliJ and Eclipse.
  • Many refinements of the build process have already been made in this PR, and will continue to be made in the future.

Future developments that I have in mind:

  • Production installer tests and end-to-end tests in GitHub Actions (E2E both with MDG and NG mod development workspaces).
  • Unification of the userdev & neodev run configs for MC 1.21.4.
  • Split sources for MC 1.21.4.
  • Optimization of binpatches.
  • Speed improvements for the NeoForge build process.
  • includeBuild for NeoForge.

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.
  • More documentation of the build process.

@neoforged-pr-publishing
Copy link

neoforged-pr-publishing bot commented Aug 24, 2024

  • Publish PR to GitHub Packages

Last commit published: a71e50cabe457910873f013348ee534032b5ff85.

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', 'testframework')
            includeModule('net.neoforged', 'neoforge')
        }
    }
}

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.77-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 Show resolved Hide resolved
build.gradle Outdated Show resolved Hide resolved
@neoforged-automation
Copy link

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

@shartte shartte changed the title Replace NG use by a custom neodev plugin built on top of NFRT and MDG Use an in-tree Gradle plugin instead of an external Gradle Plugin to make version-specific changes easier Nov 17, 2024
@sciwhiz12 sciwhiz12 added enhancement New (or improvement to existing) feature or request ci/build Related to continuous integration/build system 1.21.3 Targeted at Minecraft 1.21.3 labels Nov 18, 2024
@Technici4n Technici4n marked this pull request as ready for review November 19, 2024 08:10
@neoforged-automation
Copy link

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

projects/neoforge/build.gradle Show resolved Hide resolved
projects/neoforge/build.gradle Outdated Show resolved Hide resolved
testframework/build.gradle Show resolved Hide resolved
tests/build.gradle Outdated Show resolved Hide resolved
gradle.properties Outdated Show resolved Hide resolved
@Shadows-of-Fire
Copy link
Contributor

Eclipse support appears to be fully functional from what checks I can run. Import works, launch configs (client/server) both operate.

I'm not sure if there's supposed to be launch groups getting generated instead of pure application launch configs, but the application configs are working.

@Technici4n
Copy link
Member Author

Thanks for checking! Indeed, application configs should work. There is no Gradle prepare task anymore.

@Technici4n Technici4n merged commit 16b2d4d into 1.21.x Nov 22, 2024
6 checks passed
@Technici4n Technici4n deleted the features/moddevgradle branch November 22, 2024 17:27
@neoforged-releases
Copy link

🚀 This PR has been released as NeoForge version 21.3.38-beta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.21.3 Targeted at Minecraft 1.21.3 ci/build Related to continuous integration/build system enhancement New (or improvement to existing) feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants