Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: MinecraftForge/ForgeGradle
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: FG_2.3
Choose a base ref
...
head repository: ReplayMod/ForgeGradle
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: FG_2.3
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.

Commits on May 24, 2019

  1. Copy the full SHA
    8781de8 View commit details
  2. Copy the full SHA
    da6f9e2 View commit details
  3. Copy the full SHA
    27378eb View commit details
  4. Copy the full SHA
    d5c1380 View commit details

Commits on Oct 27, 2019

  1. Stop shading ASM...

    Johni0702 committed Oct 27, 2019
    Copy the full SHA
    1e48fab View commit details
  2. Copy the full SHA
    2e95b7f View commit details

Commits on Mar 29, 2020

  1. Bundle and relocate all the things

    This is necessary because FG's patching approach is fairly brittle, so even a
    technically non-breaking upgrade to one of its deps (e.g. ASM 6.0 -> 6.1) can
    cause it to break.
    See ModCoderPack/MCInjector#4 for an example.
    Johni0702 committed Mar 29, 2020
    Copy the full SHA
    d1d9aaa View commit details

Commits on Mar 30, 2020

  1. Copy the full SHA
    b64de9c View commit details

Commits on May 22, 2020

  1. Copy the full SHA
    2817481 View commit details

Commits on Feb 1, 2021

  1. Fix MCP artifact download on Gradle 6.0+

    This gets FG running on 6.8.1 (most recent release as of writing).
    Johni0702 committed Feb 1, 2021
    Copy the full SHA
    c5ac9dd View commit details

Commits on Apr 22, 2021

  1. Copy the full SHA
    541e148 View commit details

Commits on Jun 3, 2021

  1. Copy the full SHA
    20449e0 View commit details
  2. Update to Gradle 7

    Johni0702 committed Jun 3, 2021
    Copy the full SHA
    7e27897 View commit details

Commits on Jun 4, 2021

  1. Copy the full SHA
    98892ae View commit details
  2. Re-package OpenJDK's pack200 lib

    See the NOTE file for an explanation.
    Johni0702 committed Jun 4, 2021
    Copy the full SHA
    339f49b View commit details
  3. Copy the full SHA
    78aded6 View commit details
  4. Get setupDevWorkspace working with Gradle 7

    Unfortunately `setupDecompWorkspace` is broken because the decompiled code looks
    different from what the patches are expecting. And I quite frankly cannot be
    bothered to debug the horribly fragile mess that is Forge's decomp-patch-recomp
    pipeline.
    Johni0702 committed Jun 4, 2021
    Copy the full SHA
    4a530cd View commit details
  5. Fix missing replacement data for asset index

    More of a workaround cause this whole ReplacementProvider bullshit is unfixable.
    Johni0702 committed Jun 4, 2021
    Copy the full SHA
    865cfbf View commit details
  6. Copy the full SHA
    af45ba7 View commit details
  7. Copy the full SHA
    34ab703 View commit details

Commits on Oct 10, 2021

  1. Skip setting source/target compatibility

    Setting either of these prevents the user from using the new toolchain feature.
    Johni0702 committed Oct 10, 2021
    Copy the full SHA
    717a9f4 View commit details
Showing with 23,195 additions and 235 deletions.
  1. +68 −128 build.gradle
  2. +21 −0 ensure-java-16
  3. BIN gradle/wrapper/gradle-wrapper.jar
  4. +1 −2 gradle/wrapper/gradle-wrapper.properties
  5. +58 −30 gradlew
  6. +19 −9 gradlew.bat
  7. +8 −0 jitpack.yml
  8. +7 −2 src/main/java/net/minecraftforge/gradle/common/BasePlugin.java
  9. +1 −1 src/main/java/net/minecraftforge/gradle/common/Constants.java
  10. +1 −1 src/main/java/net/minecraftforge/gradle/patcher/PatcherConstants.java
  11. +2 −2 src/main/java/net/minecraftforge/gradle/patcher/TaskGenBinPatches.java
  12. +12 −0 src/main/java/net/minecraftforge/gradle/tasks/CreateStartTask.java
  13. +4 −0 src/main/java/net/minecraftforge/gradle/tasks/DeobfuscateJar.java
  14. +4 −0 src/main/java/net/minecraftforge/gradle/tasks/DownloadAssetsTask.java
  15. +8 −3 src/main/java/net/minecraftforge/gradle/tasks/ExtractConfigTask.java
  16. +3 −3 src/main/java/net/minecraftforge/gradle/tasks/GenSrgs.java
  17. +2 −3 src/main/java/net/minecraftforge/gradle/tasks/JenkinsChangelog.java
  18. +2 −1 src/main/java/net/minecraftforge/gradle/tasks/SplitJarTask.java
  19. +4 −0 src/main/java/net/minecraftforge/gradle/tasks/fernflower/ApplyFernFlowerTask.java
  20. +2 −0 src/main/java/net/minecraftforge/gradle/user/TaskDepDummy.java
  21. +14 −0 src/main/java/net/minecraftforge/gradle/user/TaskExtractAnnotations.java
  22. +3 −0 src/main/java/net/minecraftforge/gradle/user/TaskRecompileMc.java
  23. +29 −0 src/main/java/net/minecraftforge/gradle/user/TaskSingleReobf.java
  24. +1 −1 src/main/java/net/minecraftforge/gradle/user/TaskSourceCopy.java
  25. +24 −33 src/main/java/net/minecraftforge/gradle/user/UserBasePlugin.java
  26. +1 −1 src/main/java/net/minecraftforge/gradle/user/UserVanillaBasePlugin.java
  27. +1 −1 src/main/java/net/minecraftforge/gradle/user/liteloader/LiteModTask.java
  28. +3 −0 src/main/java/net/minecraftforge/gradle/user/patcherUser/PatcherUserBasePlugin.java
  29. +7 −7 src/main/java/net/minecraftforge/gradle/user/patcherUser/TaskApplyBinPatches.java
  30. +1 −1 src/main/java/net/minecraftforge/gradle/user/patcherUser/forge/ForgeExtension.java
  31. +0 −3 src/main/java/net/minecraftforge/gradle/util/FileLogListenner.java
  32. +298 −0 src/main/java/net/minecraftforge/gradle/util/pack200/AdaptiveCoding.java
  33. +1,698 −0 src/main/java/net/minecraftforge/gradle/util/pack200/Attribute.java
  34. +2,761 −0 src/main/java/net/minecraftforge/gradle/util/pack200/BandStructure.java
  35. +618 −0 src/main/java/net/minecraftforge/gradle/util/pack200/ClassReader.java
  36. +317 −0 src/main/java/net/minecraftforge/gradle/util/pack200/ClassWriter.java
  37. +398 −0 src/main/java/net/minecraftforge/gradle/util/pack200/Code.java
  38. +906 −0 src/main/java/net/minecraftforge/gradle/util/pack200/Coding.java
  39. +1,489 −0 src/main/java/net/minecraftforge/gradle/util/pack200/CodingChooser.java
  40. +43 −0 src/main/java/net/minecraftforge/gradle/util/pack200/CodingMethod.java
  41. +1,658 −0 src/main/java/net/minecraftforge/gradle/util/pack200/ConstantPool.java
  42. +503 −0 src/main/java/net/minecraftforge/gradle/util/pack200/Constants.java
  43. +747 −0 src/main/java/net/minecraftforge/gradle/util/pack200/Driver.java
  44. +136 −0 src/main/java/net/minecraftforge/gradle/util/pack200/DriverResource.java
  45. +136 −0 src/main/java/net/minecraftforge/gradle/util/pack200/DriverResource_ja.java
  46. +136 −0 src/main/java/net/minecraftforge/gradle/util/pack200/DriverResource_zh_CN.java
  47. +174 −0 src/main/java/net/minecraftforge/gradle/util/pack200/FixedList.java
  48. +570 −0 src/main/java/net/minecraftforge/gradle/util/pack200/Fixups.java
  49. +818 −0 src/main/java/net/minecraftforge/gradle/util/pack200/Histogram.java
  50. +688 −0 src/main/java/net/minecraftforge/gradle/util/pack200/Instruction.java
  51. +8 −0 src/main/java/net/minecraftforge/gradle/util/pack200/NOTE
  52. +331 −0 src/main/java/net/minecraftforge/gradle/util/pack200/NativeUnpack.java
  53. +719 −0 src/main/java/net/minecraftforge/gradle/util/pack200/Pack200.java
  54. +1,376 −0 src/main/java/net/minecraftforge/gradle/util/pack200/Package.java
  55. +2,376 −0 src/main/java/net/minecraftforge/gradle/util/pack200/PackageReader.java
  56. +1,743 −0 src/main/java/net/minecraftforge/gradle/util/pack200/PackageWriter.java
  57. +610 −0 src/main/java/net/minecraftforge/gradle/util/pack200/PackerImpl.java
  58. +500 −0 src/main/java/net/minecraftforge/gradle/util/pack200/PopulationCoding.java
  59. +315 −0 src/main/java/net/minecraftforge/gradle/util/pack200/PropMap.java
  60. +125 −0 src/main/java/net/minecraftforge/gradle/util/pack200/TLGlobals.java
  61. +262 −0 src/main/java/net/minecraftforge/gradle/util/pack200/UnpackerImpl.java
  62. +320 −0 src/main/java/net/minecraftforge/gradle/util/pack200/Utils.java
  63. +101 −0 src/main/java/net/minecraftforge/gradle/util/pack200/package-info.java
  64. 0 src/{main → side}/java/net/minecraftforge/fml/relauncher/Side.java
  65. 0 src/{main → side}/java/net/minecraftforge/fml/relauncher/SideOnly.java
  66. +3 −3 src/test/java/net/minecraftforge/gradle/user/TestTaskExtractDepAts.java
  67. +1 −0 src/test/java/net/minecraftforge/gradle/user/patcherUser/TaskApplyBinPatchesTest.java
196 changes: 68 additions & 128 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation

buildscript {
repositories {
maven {
@@ -6,29 +8,31 @@ buildscript {
}
dependencies {
classpath "com.gradle.publish:plugin-publish-plugin:0.9.1"
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0'
}
}

apply plugin: 'java'
plugins {
id 'java'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '7.0.0'
}

apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'maven'
apply plugin: "com.gradle.plugin-publish"
apply plugin: 'license'

group = 'net.minecraftforge.gradle'
group = 'com.github.ReplayMod'
version = '2.3-SNAPSHOT'
//version = '2.2.1'
archivesBaseName = 'ForgeGradle'
targetCompatibility = '1.8'
sourceCompatibility = '1.8'
targetCompatibility = '16'
sourceCompatibility = '16'

repositories {
mavenLocal()
maven {
name = "forge"
url = "https://files.minecraftforge.net/maven"
url = "https://maven.minecraftforge.net"
}
maven {
// because Srg2Source needs an eclipse dependency.
@@ -50,16 +54,44 @@ repositories {
name = "mojang"
url = "https://libraries.minecraft.net/"
}

maven { url = "https://jitpack.io" } // updated MCInjector
}

// The Side and SideOnly classes are injected into MC, so they must be compiled to Java 8 so Forge does not blow up.
sourceSets {
side
}
tasks.named(sourceSets.side.compileJavaTaskName, JavaCompile.class).configure {
sourceCompatibility '1.8'
targetCompatibility '1.8'
}
jar {
from(sourceSets.side.output)
}
shadowJar {
from(sourceSets.side.output)
}

configurations {
// compile has been replaced with api, re-adding to keep the diff small
compile
api.extendsFrom(compile)
testCompile
testImplementation.extendsFrom(testCompile)

deployerJars
shade
compileOnly.extendsFrom shade
}

dependencies {
compile gradleApi()
shadow gradleApi()
testImplementation gradleApi()

shadow sourceSets.side.output

compile 'org.ow2.asm:asm:6.0'
compile 'org.ow2.asm:asm-tree:6.0'
compile 'org.ow2.asm:asm-commons:6.0'

// moved to the beginning to be the overrider
//compile 'org.ow2.asm:asm-debug-all:6.0'
@@ -76,19 +108,21 @@ dependencies {
compile 'com.github.tony19:named-regexp:0.2.3' // 1.7 Named regexp features
compile 'net.minecraftforge:forgeflower:1.0.342-SNAPSHOT' // Fernflower Forge edition

shade 'net.md-5:SpecialSource:1.8.2' // deobf and reobf
compile('net.md-5:SpecialSource:1.8.2'){
exclude group: 'org.ow2.asm'
} // deobf and reobf

// because curse
compile 'org.apache.httpcomponents:httpclient:4.3.3'
compile 'org.apache.httpcomponents:httpmime:4.3.3'

// mcp stuff
shade 'de.oceanlabs.mcp:RetroGuard:3.6.6'
shade('de.oceanlabs.mcp:mcinjector:3.4-SNAPSHOT'){
exclude group: 'org.ow2.asm', module: 'asm-debug-all'
compile 'de.oceanlabs.mcp:RetroGuard:3.6.6'
compile('com.github.ModCoderPack:MCInjector:c36f39f'){
exclude group: 'org.ow2.asm'
}
shade('net.minecraftforge.srg2source:Srg2Source:4.0-SNAPSHOT'){
exclude group: 'org.ow2.asm', module: 'asm-debug-all'
compile('net.minecraftforge.srg2source:Srg2Source:4.0-SNAPSHOT'){
exclude group: 'org.ow2.asm'
exclude group: 'org.eclipse.equinox', module: 'org.eclipse.equinox.common'
}

@@ -100,17 +134,16 @@ dependencies {

compileOnly "org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.3-2"
testCompile 'junit:junit:4.12'
}

task wrapper(type: Wrapper) {
gradleVersion = '2.14'
constraints {
compile('org.eclipse.jdt:org.eclipse.jdt.core:3.12.3') {
because 'Srg2Source depends on a snapshot version which the forge maven has stopped serving'
}
}
}

sourceSets {
main.compileClasspath += configurations.shade;
main.runtimeClasspath += configurations.shade;
test.compileClasspath += configurations.shade;
test.runtimeClasspath += configurations.shade;
wrapper {
gradleVersion = '7.0.2'
}

compileJava {
@@ -120,34 +153,12 @@ compileJava {
}

processResources {
from(sourceSets.main.resources.srcDirs) {
include 'forgegradle.version.txt'
filesMatching(["forgegradle.version.txt"]) {
expand 'version': project.version
}
from(sourceSets.main.resources.srcDirs) {
exclude 'forgegradle.version.txt'
}
}

jar {

configurations.shade.each { dep ->
/* I can use this again to find where dupes come from, so.. gunna just keep it here.
logger.lifecycle(dep.toString())
project.zipTree(dep).visit {
element ->
def path = element.relativePath.toString()
if (path.contains('org/eclipse/core') && path.endsWith('.class'))
println " $element.relativePath"
}
*/
from(project.zipTree(dep)){
exclude 'META-INF', 'META-INF/**', '.api_description', '.options', 'about.html', 'module-info.class', 'plugin.properties', 'plugin.xml', 'about_files/**'
duplicatesStrategy 'warn'
}
}

manifest {
attributes 'version':project.version
attributes 'javaCompliance': project.targetCompatibility
@@ -180,27 +191,6 @@ test {
exclude "**/ExtensionMcpMappingTest*"
}

license {
ext {
description = 'A Gradle plugin for the creation of Minecraft mods and MinecraftForge plugins.'
year = '2013-' + Calendar.getInstance().get(Calendar.YEAR)
fullname = 'Minecraft Forge'
}
header rootProject.file('HEADER')
include '**net/minecraftforge/gradle/**/*.java'
excludes ([
'**net/minecraftforge/gradle/util/ZipFileTree.java',
'**net/minecraftforge/gradle/util/json/version/*',
'**net/minecraftforge/gradle/util/patching/Base64.java',
'**net/minecraftforge/gradle/util/patching/ContextualPatch.java'
])
ignoreFailures false
strictCheck true
mapping {
java = 'SLASHSTAR_STYLE'
}
}

pluginBundle {
website = 'http://www.gradle.org/'
vcsUrl = 'https://github.com/MinecraftForge/ForgeGradle'
@@ -232,66 +222,16 @@ pluginBundle {
}
}

uploadArchives {
repositories.mavenDeployer {

dependsOn 'build'

if (project.hasProperty('forgeMavenPass'))
{
repository(url: "https://files.minecraftforge.net/maven/manage/upload") {
authentication(userName: "forge", password: project.getProperty('forgeMavenPass'))
}
}
else
{
// local repo folder. Might wanna juset use gradle install if you wanans end it to maven-local
repository(url: 'file://localhost/' + project.file('repo').getAbsolutePath())
}

task relocateShadowJar(type: ConfigureShadowRelocation) {
target = tasks.shadowJar
prefix = "fg_2_3"
}
tasks.shadowJar.dependsOn tasks.relocateShadowJar

pom {
groupId = project.group
version = project.version
artifactId = project.archivesBaseName
project {
name project.archivesBaseName
packaging 'jar'
description 'Gradle plugin for Forge'
url 'https://github.com/MinecraftForge/ForgeGradle'

scm {
url 'https://github.com/MinecraftForge/ForgeGradle'
connection 'scm:git:git://github.com/MinecraftForge/ForgeGradle.git'
developerConnection 'scm:git:git@github.com:MinecraftForge/ForgeGradle.git'
}

issueManagement {
system 'github'
url 'https://github.com/MinecraftForge/ForgeGradle/issues'
}

licenses {
license {
name 'Lesser GNU Public License, Version 2.1'
url 'https://www.gnu.org/licenses/lgpl-2.1.html'
distribution 'repo'
}
}

developers {
developer {
id 'AbrarSyed'
name 'Abrar Syed'
roles { role 'developer' }
}
developer {
id 'LexManos'
name 'Lex Manos'
roles { role 'developer' }
}
}
}
publishing {
publications {
shadow(MavenPublication) { publication ->
project.shadow.component(publication)
}
}
}
21 changes: 21 additions & 0 deletions ensure-java-16
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

# https://github.com/jitpack/jitpack.io/issues/4355#issuecomment-744678253

JV=`java -version 2>&1 >/dev/null | head -1`
echo $JV | sed -E 's/^.*version "([^".]*)\.[^"]*".*$/\1/'

if [ "$JV" != 16 ]; then
case "$1" in
install)
echo "installing sdkman..."
curl -s "https://get.sdkman.io" | bash
source ~/.sdkman/bin/sdkman-init.sh
sdk install java 16.0.1-open
;;
use)
echo "must source ~/.sdkman/bin/sdkman-init.sh"
exit 1
;;
esac
fi
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Sat Aug 20 15:56:50 PDT 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-bin.zip
Loading