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

Publishing extended Gradle Module Metadata for Tooling #959

Merged
merged 8 commits into from
Jun 11, 2024

Conversation

shartte
Copy link
Contributor

@shartte shartte commented May 13, 2024

Summary of Changes

  • Move the task to generate the changelog from rootProject to the neoforge project. We were accessing it across project
    boundaries to publish its results, which is discouraged by Gradle.
  • Enable generation of Gradle module metadata.

Configuration / Variant Overview

Configuration/Variant Description Capability
apiElements Publication disabled, since this includes Minecraft code. Implicit
runtimeElements Publication disabled, since this includes Minecraft code. Implicit
modDevBundle The userdev jar. Depends on NeoForm data and tools. net.neoforged:neoforge-moddev-bundle
modDevConfig The userdev JSON config file. net.neoforged:neoforge-moddev-config
installerJar The installer. net.neoforged:neoforge-installer
universalJar Compiled NeoForge code (without Minecraft). Implicit
changelog The changelog in TXT format. Implicit
modDevApiElements All additional dependencies for compiling a mod against NeoForge. net.neoforged:neoforge-dependencies
modDevRuntimeElements All additional runtime dependencies for running a mod with NeoForge. net.neoforged:neoforge-dependencies
modDevModulePath Contains the subset of modDevRuntimeElements that needs to be on the Java module-path. net.neoforged:neoforge-moddev-module-path
modDevTestFixtures Contains the JUnit plugin for easier testing of mods against Minecraft code. net.neoforged:neoforge-moddev-test-fixtures

Consuming Variants

Example Buildscript to pull all variants and store them locally: build.zip

modDevBundle

File: neoforge-21.0.0-alpha.1.21-rc1.20240610.223412-userdev.jar

Capability: net.neoforged:neoforge-moddev-bundle

Attributes

Attribute Value
org.gradle.category data
org.gradle.dependency.bundling external

Dependencies

  • net.neoforged:neoform

modDevConfig

File: neoforge-21.0.0-alpha.1.21-rc1.20240610.223412-moddev-config.json

Capability: net.neoforged:neoforge-moddev-config

Attributes

Attribute Value
org.gradle.category data
org.gradle.dependency.bundling external

installerJar

File: neoforge-21.0.0-alpha.1.21-rc1.20240610.223412-installer.jar

Capability: net.neoforged:neoforge-installer

Attributes

Attribute Value
org.gradle.category library
org.gradle.dependency.bundling embedded
org.gradle.jvm.version 8
org.gradle.usage java-runtime

universalJar

File: neoforge-21.0.0-alpha.1.21-rc1.20240610.223412-universal.jar

Attributes

Attribute Value
org.gradle.category library
org.gradle.dependency.bundling external
org.gradle.jvm.version 17
org.gradle.libraryelements jar
org.gradle.usage java-runtime

modDevApiElements

Capability: net.neoforged:neoforge-dependencies

Attributes

Attribute Value
org.gradle.category library
org.gradle.dependency.bundling external
org.gradle.usage java-api

Dependencies

  • net.neoforged:neoform (Capabilities: net.neoforged:neoform-dependencies)
  • io.github.llamalad7:mixinextras-neoforge
  • net.neoforged:neoform
  • net.neoforged.fancymodloader:loader
  • net.neoforged.fancymodloader:earlydisplay
  • cpw.mods:securejarhandler
  • org.ow2.asm:asm
  • org.ow2.asm:asm-commons
  • org.ow2.asm:asm-tree
  • org.ow2.asm:asm-util
  • org.ow2.asm:asm-analysis
  • net.neoforged:accesstransformers
  • net.neoforged:bus
  • net.neoforged:coremods
  • cpw.mods:modlauncher
  • net.minecraftforge:unsafe
  • net.neoforged:mergetool
  • com.electronwill.night-config:core
  • com.electronwill.night-config:toml
  • org.apache.maven:maven-artifact
  • net.jodah:typetools
  • net.minecrell:terminalconsoleappender
  • net.fabricmc:sponge-mixin
  • org.openjdk.nashorn:nashorn-core
  • net.neoforged:JarJarSelector
  • org.apache.commons:commons-lang3
  • net.neoforged:JarJarMetadata
  • org.apache.logging.log4j:log4j-api
  • org.apache.logging.log4j:log4j-core
  • cpw.mods:bootstraplauncher
  • net.neoforged:JarJarFileSystems

modDevRuntimeElements

Capability: net.neoforged:neoforge-dependencies

Attributes

Attribute Value
org.gradle.category library
org.gradle.dependency.bundling external
org.gradle.usage java-runtime

Dependencies

  • net.neoforged:neoform (Capabilities: net.neoforged:neoform-dependencies)
  • net.neoforged:neoform
  • net.neoforged.fancymodloader:loader
  • net.neoforged.fancymodloader:earlydisplay
  • cpw.mods:securejarhandler
  • org.ow2.asm:asm
  • org.ow2.asm:asm-commons
  • org.ow2.asm:asm-tree
  • org.ow2.asm:asm-util
  • org.ow2.asm:asm-analysis
  • net.neoforged:accesstransformers
  • net.neoforged:bus
  • net.neoforged:coremods
  • cpw.mods:modlauncher
  • net.minecraftforge:unsafe
  • net.neoforged:mergetool
  • com.electronwill.night-config:core
  • com.electronwill.night-config:toml
  • org.apache.maven:maven-artifact
  • net.jodah:typetools
  • net.minecrell:terminalconsoleappender
  • net.fabricmc:sponge-mixin
  • org.openjdk.nashorn:nashorn-core
  • net.neoforged:JarJarSelector
  • org.apache.commons:commons-lang3
  • net.neoforged:JarJarMetadata
  • org.apache.logging.log4j:log4j-api
  • org.apache.logging.log4j:log4j-core
  • cpw.mods:bootstraplauncher
  • net.neoforged:JarJarFileSystems

modDevModulePath

Capability: net.neoforged:neoforge-moddev-module-path

Attributes

Attribute Value
org.gradle.category library
org.gradle.dependency.bundling external

Dependencies

  • cpw.mods:securejarhandler
  • org.ow2.asm:asm
  • org.ow2.asm:asm-commons
  • org.ow2.asm:asm-tree
  • org.ow2.asm:asm-util
  • org.ow2.asm:asm-analysis
  • cpw.mods:bootstraplauncher
  • net.neoforged:JarJarFileSystems

modDevTestFixtures

Capability: net.neoforged:neoforge-moddev-test-fixtures

Attributes

Attribute Value
org.gradle.category library
org.gradle.dependency.bundling external
org.gradle.usage java-runtime

Dependencies

  • net.neoforged.fancymodloader:junit-fml

sourcesElements

File: neoforge-21.0.0-alpha.1.21-rc1.20240610.223412-sources.jar

Attributes

Attribute Value
org.gradle.category documentation
org.gradle.dependency.bundling external
org.gradle.docstype sources
org.gradle.usage java-runtime

@shartte shartte marked this pull request as draft May 13, 2024 09:09
@neoforged-pr-publishing
Copy link

neoforged-pr-publishing bot commented May 13, 2024

  • Publish PR to GitHub Packages

Last commit published: 75c0a375aff569ac1d2b5b12c5074797d5945016.

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 #959' // https://github.com/neoforged/NeoForge/pull/959
        url 'https://prmaven.neoforged.net/NeoForge/pr959'
        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-pr959.
On Powershell you will need to remove the -L flag from the curl invocation.

mkdir NeoForge-pr959
cd NeoForge-pr959
curl -L https://prmaven.neoforged.net/NeoForge/pr959/net/neoforged/neoforge/21.0.0-alpha.1.21-rc1.20240610.223412/mdk-pr959.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.

projects/neoforge/build.gradle Outdated Show resolved Hide resolved
projects/neoforge/build.gradle Show resolved Hide resolved
@shartte shartte force-pushed the features/gradle-metadata branch from 0159a46 to 913506c Compare May 26, 2024 17:55
@Technici4n Technici4n force-pushed the features/gradle-metadata branch from 913506c to fc8c8d0 Compare May 27, 2024 17:27
@shartte shartte force-pushed the features/gradle-metadata branch from 636279f to a67306f Compare June 10, 2024 19:07
@shartte shartte changed the base branch from 1.20.x to port/1.21 June 10, 2024 19:07
@shartte shartte marked this pull request as ready for review June 10, 2024 21:19
@Technici4n Technici4n added the last call Planned to be resolved by the end of the week, awaiting any last-minute comments label Jun 10, 2024
@Matyrobbrt Matyrobbrt added enhancement New (or improvement to existing) feature or request 1.21 Targeted at Minecraft 1.21 labels Jun 11, 2024
@shartte shartte merged commit 89b1791 into port/1.21 Jun 11, 2024
4 checks passed
@shartte shartte deleted the features/gradle-metadata branch June 11, 2024 18:45
embeddedt pushed a commit to embeddedt/NeoForge that referenced this pull request Dec 15, 2024
embeddedt added a commit to embeddedt/NeoForge that referenced this pull request Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.21 Targeted at Minecraft 1.21 enhancement New (or improvement to existing) feature or request last call Planned to be resolved by the end of the week, awaiting any last-minute comments
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants