Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions obfuscation/fg7/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
plugins {
id 'java'
id 'idea'
id 'eclipse'
id 'maven-publish'
id 'net.minecraftforge.gradle' version '[7.0,8.0)'
id 'net.minecraftforge.renamer' version '1.0.1'
}

version = '0'

Choose a reason for hiding this comment

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

Suggested change
version = '0'
version = '0.0'

To match the mods.toml version

group = 'com.example'
base.archivesName = 'test'

Choose a reason for hiding this comment

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

Suggested change
base.archivesName = 'test'
base.archivesName = 'obfuscation'


java.toolchain.languageVersion = JavaLanguageVersion.of(21)

minecraft {
mappings channel: 'official', version: '1.21.10'
Comment on lines +14 to +17

Choose a reason for hiding this comment

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

1.20.1 please, to avoid noobs being confused thinking that modern versions need reobf

}

repositories {
maven minecraft.mavenizer
maven fg.forgeMaven
maven fg.minecraftLibsMaven
}

dependencies {
implementation minecraft.dependency('net.minecraftforge:forge:1.21.10-60.0.17')
}

renamer.classes(jar) {

Choose a reason for hiding this comment

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

Suggested change
renamer.classes(jar) {
renamer.classes(tasks.named('jar', Jar)) {

To avoid eager configuration of the Jar task

Choose a reason for hiding this comment

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

How does one register multiple reobf jar tasks for different inputs?

tasks.register('reobfJar', RenameJar) {
    // ?
}

Is renamer.classes(...) { ... } a helper for task registration or required for it to work? If the former and not much more verbose, I'd prefer knowing the standard Gradle way for registering the task.

// This is generated by mavenizer, this is `net.minecraft:mappings_{channel}:{minecraft}-{mcp}:map2srg@tsrg.gz`
// I intend to both publish these as public artifacts on the Forge maven, and expose a FG helper to make you not need to find the MCP version
// Parchment is official mappings, just with parameters, so you can use official.
mappings('net.minecraft:mappings_official:1.21.10-20251007.101210:map2srg@tsrg.gz')

Choose a reason for hiding this comment

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

Where can users find the MCP timestamp found in this artifact string?

}

publishing {
repositories {
maven { url = layout.projectDirectory.dir('repo').asFile.toURI() }
}

publications.register('mavenJava', MavenPublication) {
from components.java // Publish the normal jar
artifact renameJar // Publish the renamed jar in addition
}
}
9 changes: 9 additions & 0 deletions obfuscation/fg7/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
org.gradle.caching=true
org.gradle.parallel=true
org.gradle.configureondemand=true

org.gradle.configuration-cache=true
org.gradle.configuration-cache.parallel=true
org.gradle.configuration-cache.problems=warn

net.minecraftforge.gradle.merge-source-sets=true
Binary file added obfuscation/fg7/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions obfuscation/fg7/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
248 changes: 248 additions & 0 deletions obfuscation/fg7/gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading