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

Parchment Prototype #83

Merged
merged 4 commits into from
Dec 30, 2023
Merged

Parchment Prototype #83

merged 4 commits into from
Dec 30, 2023

Conversation

shartte
Copy link
Contributor

@shartte shartte commented Dec 20, 2023

Apply Parchment Mappings

To get human-readable parameter names in decompiled Minecraft source-code, as well as Javadocs, crowed-sourced data
from the Parchment project can be applied to the Minecraft source-code before it is recompiled.

This is currently only supported when applying the NeoGradle userdev Plugin.

The most basic configuration is using the following properties in gradle.properties:

neogradle.subsystems.parchment.minecraftVersion=1.20.2
neogradle.subsystems.parchment.mappingsVersion=2023.12.10

The subsystem also has Gradle DSL and supports more parameters explained in the following Gradle snippet.

subsystems {
  parchment {
    # The Minecraft version for which the Parchment mappings were created.
    # This does not necessarily need to match the Minecraft version your mod targets
    # Defaults to the value of Gradle property neogradle.subsystems.parchment.minecraftVersion
    minecraftVersion = "1.20.2"
    
    # The version of Parchment mappings to apply.
    # See https://parchmentmc.org/docs/getting-started for a list.
    # Defaults to the value of Gradle property neogradle.subsystems.parchment.mappingsVersion
    mappingsVersion = "2023.12.10"
    
    # Overrides the full Maven coordinate of the Parchment artifact to use
    # This is computed from the minecraftVersion and mappingsVersion properties by default.
    # If you set this property explicitly, minecraftVersion and mappingsVersion will be ignored.
    # The built-in default value can also be overriden using the Gradle property neogradle.subsystems.parchment.parchmentArtifact
    # parchmentArtifact = "org.parchmentmc.data:parchment-$minecraftVersion:$mappingsVersion:checked@zip"
    
    # Overrides the full Maven coordinate of the tool used to apply the Parchment mappings
    # See https://github.com/neoforged/JavaSourceTransformer
    # The built-in default value can also be overriden using the Gradle property neogradle.subsystems.parchment.toolArtifact
    # toolArtifact = "net.neoforged.jst:jst-cli-bundle:1.0.29"
    
    # Set this to false if you don't want the https://maven.parchmentmc.org/ repository to be added automatically when
    # applying Parchment mappings is enabled
    # The built-in default value can also be overriden using the Gradle property neogradle.subsystems.parchment.addRepository
    # addRepository = true
    
    # Can be used to explicitly disable this subsystem. By default, it will be enabled automatically as soon
    # as parchmentArtifact or minecraftVersion and mappingsVersion are set.
    # The built-in default value can also be overriden using the Gradle property neogradle.subsystems.parchment.enabled
    # enabled = true
  }
}

@shartte shartte marked this pull request as ready for review December 30, 2023 15:30
@marchermans
Copy link
Contributor

Would it be possible to the NamingChannel and Mapping versioning system, instead of a subsystem handling?

Also any idea how we should handle platform in the future?

@neoforged-pr-publishing
Copy link

neoforged-pr-publishing bot commented Dec 30, 2023

  • Publish PR to GitHub Packages

Last commit published: e16f0f8c71204df8bc39c11a6a321f19495edbbb.

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 #83' // https://github.com/neoforged/NeoGradle/pull/83
        url 'https://prmaven.neoforged.net/NeoGradle/pr83'
        content {
            includeModule('net.neoforged.gradle', 'common')
            includeModule('net.neoforged.gradle.common', 'net.neoforged.gradle.common.gradle.plugin')
            includeModule('net.neoforged.gradle', 'dsl-common')
            includeModule('net.neoforged.gradle', 'dsl-mixin')
            includeModule('net.neoforged.gradle', 'dsl-neoform')
            includeModule('net.neoforged.gradle', 'dsl-platform')
            includeModule('net.neoforged.gradle', 'dsl-userdev')
            includeModule('net.neoforged.gradle', 'dsl-vanilla')
            includeModule('net.neoforged.gradle', 'mixin')
            includeModule('net.neoforged.gradle.mixin', 'net.neoforged.gradle.mixin.gradle.plugin')
            includeModule('net.neoforged.gradle', 'neoform')
            includeModule('net.neoforged.gradle.neoform', 'net.neoforged.gradle.neoform.gradle.plugin')
            includeModule('net.neoforged.gradle', 'platform')
            includeModule('net.neoforged.gradle.platform', 'net.neoforged.gradle.platform.gradle.plugin')
            includeModule('net.neoforged.gradle', 'userdev')
            includeModule('net.neoforged.gradle.userdev', 'net.neoforged.gradle.userdev.gradle.plugin')
            includeModule('net.neoforged.gradle', 'utils')
            includeModule('net.neoforged.gradle', 'vanilla')
            includeModule('net.neoforged.gradle.vanilla', 'net.neoforged.gradle.vanilla.gradle.plugin')
        }
    }
}

@marchermans marchermans merged commit a848ee5 into neoforged:NG_7.0 Dec 30, 2023
3 checks passed
@shartte shartte deleted the parchment branch December 30, 2023 18:51
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.

3 participants