diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..fe21d0769 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,28 @@ +name: Publish + +on: + push: + branches: [ 'FG_2.3' ] + paths-ignore: + - '.github/workflows/**' + - 'docs/**' + - 'README.md' + +permissions: + contents: read + +jobs: + build: + uses: MinecraftForge/SharedActions/.github/workflows/gradle.yml@v0 + with: + java: 17 + gradle_tasks: 'check publish' + secrets: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + PROMOTE_ARTIFACT_WEBHOOK: ${{ secrets.PROMOTE_ARTIFACT_WEBHOOK }} + PROMOTE_ARTIFACT_USERNAME: ${{ secrets.PROMOTE_ARTIFACT_USERNAME }} + PROMOTE_ARTIFACT_PASSWORD: ${{ secrets.PROMOTE_ARTIFACT_PASSWORD }} + MAVEN_USER: ${{ secrets.MAVEN_USER }} + MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} + GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }} + GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }} diff --git a/.gitignore b/.gitignore index 55562a46c..01c101514 100644 --- a/.gitignore +++ b/.gitignore @@ -1,21 +1,77 @@ -# gradle +### Java template +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* +replay_pid* + +### Intellij+all template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# CMake +cmake-build-*/ + +# File-based project format +*.iws + +# IntelliJ +.idea/ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +### Gradle template .gradle -build +**/build/ +!**/src/**/build/ + +# Ignore Gradle GUI config gradle-app.setting -# GMCP plugin -/minecraft +# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) +!gradle-wrapper.jar -# eclipse -.settings -.metadata -.classpath -.project -bin +# Avoid ignore Gradle wrappper properties +!gradle-wrapper.properties + +# Cache of project +.gradletasknamecache -# intellij -out -*.idea -*.iml +# Eclipse Gradle plugin generated files +# Eclipse Core +.project +# JDT-specific (Eclipse Java Development Tools) +.classpath -/repo/ +# Local Repository +repo/ diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index f37a0d021..000000000 --- a/Jenkinsfile +++ /dev/null @@ -1,87 +0,0 @@ -@Library('forge-shared-library')_ - -pipeline { - agent { - docker { - image 'gradlewrapper:latest' - args '-v gradlecache:/gradlecache' - } - } - environment { - GRADLE_ARGS = '-Dorg.gradle.daemon.idletimeout=5000 --stacktrace --info' - DISCORD_WEBHOOK = credentials('forge-discord-jenkins-webhook') - DISCORD_PREFIX = "Job: ForgeGradle Branch: ${BRANCH_NAME} Build: #${BUILD_NUMBER}" - JENKINS_HEAD = 'https://wiki.jenkins-ci.org/download/attachments/2916393/headshot.png' - } - - stages { - stage('fetch') { - steps { - checkout scm - } - } - stage('notify_start') { - when { - not { - changeRequest() - } - } - steps { - discordSend( - title: "${DISCORD_PREFIX} Started", - successful: true, - result: 'ABORTED', //White border - thumbnail: JENKINS_HEAD, - webhookURL: DISCORD_WEBHOOK - ) - } - } - stage('buildandtest') { - steps { - sh './gradlew ${GRADLE_ARGS} --refresh-dependencies --continue build' // test' - script { - env.MYVERSION = sh(returnStdout: true, script: './gradlew properties -q | grep "version:" | awk \'{print $2}\'').trim() - } - } - /* - post { - success { - writeChangelog(currentBuild, 'build/changelog.txt') - archiveArtifacts artifacts: 'build/changelog.txt', fingerprint: false - } - } - */ - } - stage('publish') { - when { - not { - changeRequest() - } - } - environment { - FORGE_MAVEN = credentials('forge-maven-forge-user') - } - steps { - sh './gradlew ${GRADLE_ARGS} uploadArchives -PforgeMavenUser=${FORGE_MAVEN_USR} -PforgeMavenPassword=${FORGE_MAVEN_PSW}' - } - } - } - post { - always { - script { - archiveArtifacts artifacts: 'build/libs/**/*.jar', fingerprint: true - - if (env.CHANGE_ID == null) { // This is unset for non-PRs - discordSend( - title: "${DISCORD_PREFIX} Finished ${currentBuild.currentResult}", - description: '```\n' + getChanges(currentBuild) + '\n```', - successful: currentBuild.resultIsBetterOrEqualTo("SUCCESS"), - result: currentBuild.currentResult, - thumbnail: JENKINS_HEAD, - webhookURL: DISCORD_WEBHOOK - ) - } - } - } - } -} diff --git a/HEADER b/LICENSE-header.txt similarity index 100% rename from HEADER rename to LICENSE-header.txt diff --git a/build.gradle b/build.gradle index 70b5164e9..ef5fcb5e2 100644 --- a/build.gradle +++ b/build.gradle @@ -1,432 +1,294 @@ -buildscript { - repositories { - maven { - url "https://plugins.gradle.org/m2/" - } - } - dependencies { - classpath "com.gradle.publish:plugin-publish-plugin:0.9.1" - classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0' - classpath 'org.ow2.asm:asm:6.2.1' - classpath 'org.ow2.asm:asm-tree:6.2.1' - } +import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar +import org.gradle.api.plugins.jvm.JvmTestSuite +import org.gradle.api.tasks.testing.logging.TestExceptionFormat + +plugins { + id 'java-gradle-plugin' + id 'jvm-test-suite' + id 'idea' + id 'eclipse' + id 'maven-publish' + id 'local.build.jdt-transformer' + id 'io.freefair.javadoc-links' + id 'net.minecraftforge.gradleutils' + alias libs.plugins.licenser + alias libs.plugins.gitversion + alias libs.plugins.changelog + alias libs.plugins.shadow } -apply plugin: 'java' -apply plugin: 'idea' -apply plugin: 'eclipse' -apply plugin: 'maven' -apply plugin: "com.gradle.plugin-publish" -apply plugin: 'license' - +description = 'Gradle plugin for Forge' group = 'net.minecraftforge.gradle' -version = '2.3-SNAPSHOT' -//version = '2.2.1' -archivesBaseName = 'ForgeGradle' -targetCompatibility = '1.8' -sourceCompatibility = '1.8' - -repositories { - mavenLocal() - maven { - name = "forge" - url = "https://files.minecraftforge.net/maven" - } - maven { - // because Srg2Source needs an eclipse dependency. - name = "eclipse" - url = "https://repo.eclipse.org/content/groups/eclipse/" - } - jcenter() // get as many deps from here as possible - mavenCentral() +version = gitversion.tagOffset + +java { + toolchain.languageVersion = JavaLanguageVersion.of(8) + withSourcesJar() + //withJavadocJar() +} + +gradleutils.pluginDevDefaults(configurations, libs.versions.gradle) - // because SS and its snapshot - maven { - name = "sonatype" - url = "https://oss.sonatype.org/content/repositories/snapshots/" +configurations { + dependencyScope('shade') + + named('implementation') { + extendsFrom shade } + resolvable('shadeClasspath') { + extendsFrom shade + } - // because of the GradleStart stuff - maven { - name = "mojang" - url = "https://libraries.minecraft.net/" + named('shadowRuntimeElements') { + withDependencies { + addAll(runtimeClasspath.allDependencies) + removeAll(shade.allDependencies) + } } -} -configurations { - deployerJars - shade - compileOnly.extendsFrom shade - all { + configureEach { resolutionStrategy { - force 'org.ow2.asm:asm-commons:6.0' - force 'org.ow2.asm:asm-tree:6.0' - force 'org.ow2.asm:asm:6.0' + force libs.asm.commons + force libs.asm.tree + force libs.asm } } } dependencies { - compile gradleApi() + compileOnly libs.gradle + compileOnly libs.groovy // moved to the beginning to be the overrider - //compile 'org.ow2.asm:asm-debug-all:6.0' - compile 'com.google.guava:guava:18.0' + //implementation libs.asm.debug + implementation libs.guava - compile 'net.sf.opencsv:opencsv:2.3' // reading CSVs.. also used by SpecialSource - compile 'com.cloudbees:diff4j:1.1' // for difing and patching - compile 'com.github.abrarsyed.jastyle:jAstyle:1.3' // formatting - compile 'net.sf.trove4j:trove4j:2.1.0' // because its awesome. + implementation libs.opencsv // reading CSVs.. also used by SpecialSource + implementation libs.diff4j // for difing and patching + implementation libs.jastyle // formatting + implementation libs.trove4j // because its awesome. - compile 'com.github.jponge:lzma-java:1.3' // replaces the LZMA binary - compile 'com.nothome:javaxdelta:2.0.1' // GDIFF implementation for BinPatches - compile 'com.google.code.gson:gson:2.2.4' // Used instead of Argo for buuilding changelog. - 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 + implementation libs.lzma // replaces the LZMA binary + implementation libs.xdelta // GDIFF implementation for BinPatches + implementation libs.gson // Used instead of Argo for buuilding changelog. + implementation libs.named.regexp // 1.7 Named regexp features + implementation libs.forgeflower // Fernflower Forge edition - shade 'net.md-5:SpecialSource:1.8.2' // deobf and reobf + shade libs.specialsource // deobf and reobf // because curse - compile 'org.apache.httpcomponents:httpclient:4.3.3' - compile 'org.apache.httpcomponents:httpmime:4.3.3' + implementation libs.httpclient + implementation libs.httpmime // mcp stuff - shade 'de.oceanlabs.mcp:RetroGuard:3.6.6' - shade('de.oceanlabs.mcp:mcinjector:3.4-SNAPSHOT'){ + shade libs.retroguard + shade(libs.mcinjector) { exclude group: 'org.ow2.asm' } - shade('net.minecraftforge:Srg2Source:5.0.+'){ + shade(libs.srg2source) { + exclude group: 'cpw.mods', module: 'modlauncher' exclude group: 'org.ow2.asm' exclude group: 'org.eclipse.equinox', module: 'org.eclipse.equinox.common' - exclude group: 'cpw.mods', module: 'modlauncher' - } - //Stuff used in the GradleStart classes - compileOnly 'com.mojang:authlib:1.5.16' - compileOnly('net.minecraft:launchwrapper:1.11'){ - exclude group: 'org.ow2.asm' + jdt.transform(it) } - - compileOnly 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.3-2' - testCompile 'junit:junit:4.12' -} - -task wrapper(type: Wrapper) { - gradleVersion = '2.14' -} - -sourceSets { - main.compileClasspath += configurations.shade; - main.runtimeClasspath += configurations.shade; - test.compileClasspath += configurations.shade; - test.runtimeClasspath += configurations.shade; -} - -compileJava { - options.deprecation = true - //options.compilerArgs += ["-Werror"] - //options.compilerArgs += ["-Werror", "-Xlint:unchecked"] -} - -processResources { - from(sourceSets.main.resources.srcDirs) { - include 'forgegradle.version.txt' - expand 'version': project.version - } - from(sourceSets.main.resources.srcDirs) { - exclude 'forgegradle.version.txt' + constraints { + shade('org.eclipse.jdt:org.eclipse.jdt.core') { + jdt.transform(it) + } } -} -import java.util.zip.* -import org.objectweb.asm.* -import org.objectweb.asm.tree.* + // Because Eclipse is dumb and decided to use dynamic versions with J8 incompatibility + shade libs.eclipse.core.resources + shade libs.eclipse.core.runtime + shade libs.eclipse.text + shade libs.eclipse.core.filesystem + shade libs.eclipse.equinox.common + shade libs.eclipse.core.contenttype + shade libs.eclipse.core.jobs + shade libs.eclipse.equinox.registry + shade libs.eclipse.osgi + shade libs.eclipse.core.commands -//TODO: Eclipse complains about unused messages. Find a way to make it shut up. -class PatchJDTClasses extends DefaultTask { - static def COMPILATION_UNIT_RESOLVER = 'org/eclipse/jdt/core/dom/CompilationUnitResolver' - static def RANGE_EXTRACTOR = 'net/minecraftforge/srg2source/ast/RangeExtractor' - def RESOLVE_METHOD = 'resolve([Ljava/lang/String;[Ljava/lang/String;[Ljava/lang/String;Lorg/eclipse/jdt/core/dom/FileASTRequestor;ILjava/util/Map;I)V' - def GET_CONTENTS = 'org/eclipse/jdt/internal/compiler/util/Util.getFileCharContent(Ljava/io/File;Ljava/lang/String;)[C' - def HOOK_DESC_RESOLVE = '(Ljava/lang/String;Ljava/lang/String;)[C' + //Stuff used in the GradleStart classes + compileOnly libs.authlib + compileOnly(libs.launchwrapper) { + exclude group: 'org.ow2.asm' + } - @Input def targets = [] as Set - @Input def libraries = [] as Set - @OutputFile File output + compileOnly libs.kotlin.gradle.plugin +} - void target(String value) { - targets.add(value) - } +testing { + suites.named('test', JvmTestSuite) { + useJUnit(libs.versions.junit) - void library(File value) { - libraries.add(value) - } + dependencies { + implementation libs.gradle.testkit + } - @TaskAction - void patchClass() { - def toProcess = targets.collect() - new ZipOutputStream(new FileOutputStream(output)).withCloseable{ zout -> - libraries.stream().filter{ !it.isDirectory() }.each { lib -> - new ZipFile(lib).withCloseable { zin -> - def remove = [] - toProcess.each{ target -> - def entry = zin.getEntry(target+'.class') - if (entry == null) - return - - def node = new ClassNode() - def reader = new ClassReader(zin.getInputStream(entry)) - reader.accept(node, 0) - - //CompilationUnitResolver allows batch compiling, the problem is it is hardcoded to read the contents from a File. - //So we patch this call to redirect to us, so we can get the contents from our InputSupplier - if (COMPILATION_UNIT_RESOLVER.equals(target)) { - logger.lifecycle('Transforming: ' + target + ' From: ' + lib) - def resolve = node.methods.find{ RESOLVE_METHOD.equals(it.name + it.desc) } - if (resolve == null) - throw new RuntimeException('Failed to patch ' + target + ': Could not find method ' + RESOLVE_METHOD) - for (int x = 0; x < resolve.instructions.size(); x++) { - def insn = resolve.instructions.get(x) - if (insn.type == AbstractInsnNode.METHOD_INSN) { - if (GET_CONTENTS.equals(insn.owner + '.' + insn.name + insn.desc)) { - if ( - resolve.instructions.get(x - 5).opcode == Opcodes.NEW && - resolve.instructions.get(x - 4).opcode == Opcodes.DUP && - resolve.instructions.get(x - 3).opcode == Opcodes.ALOAD && - resolve.instructions.get(x - 2).opcode == Opcodes.INVOKESPECIAL && - resolve.instructions.get(x - 1).opcode == Opcodes.ALOAD - ) { - resolve.instructions.set(resolve.instructions.get(x - 5), new InsnNode(Opcodes.NOP)); // NEW File - resolve.instructions.set(resolve.instructions.get(x - 4), new InsnNode(Opcodes.NOP)); // DUP - resolve.instructions.set(resolve.instructions.get(x - 2), new InsnNode(Opcodes.NOP)); // INVOKESTATIC - insn.owner = RANGE_EXTRACTOR - insn.desc = HOOK_DESC_RESOLVE - logger.lifecycle('Patched ' + node.name) - } else { - throw new IllegalStateException('Found Util.getFileCharContents call, with unexpected context') - } - } - } - } - } else if (RANGE_EXTRACTOR.equals(target)) { - logger.lifecycle('Tansforming: ' + target + ' From: ' + lib) - def marker = node.methods.find{ 'hasBeenASMPatched()Z'.equals(it.name + it.desc) } - if (marker == null) - throw new RuntimeException('Failed to patch ' + target + ': Could not find method hasBeenASMPatched()Z') - marker.instructions.clear() - marker.instructions.add(new InsnNode(Opcodes.ICONST_1)) - marker.instructions.add(new InsnNode(Opcodes.IRETURN)) - logger.lifecycle('Patched: ' + node.name) - } - - def writer = new ClassWriter(0) - node.accept(writer) - - remove.add(target) - def nentry = new ZipEntry(entry.name) - nentry.time = 0 - zout.putNextEntry(nentry) - zout.write(writer.toByteArray()) - zout.closeEntry() - } - toProcess.removeAll(remove) - } + targets.configureEach { + testTask.configure { + ignoreFailures = true + javaLauncher = javaToolchains.launcherFor { languageVersion = JavaLanguageVersion.of(8) } + testLogging { exceptionFormat = TestExceptionFormat.FULL } } - if (!toProcess.isEmpty()) - throw new IllegalStateException('Patching class failed: ' + toProcess) } } } -task patchJDT(type: PatchJDTClasses) { - target PatchJDTClasses.COMPILATION_UNIT_RESOLVER - target PatchJDTClasses.RANGE_EXTRACTOR - configurations.shade.resolvedConfiguration.resolvedArtifacts.stream().filter { dep -> - dep.name.equals('org.eclipse.jdt.core') || dep.name.equals('Srg2Source') - } - .forEach { dep -> library dep.file } - output file('build/patchJDT/patch_jdt.jar') +tasks.named('compileJava', JavaCompile) { + options.deprecation = true + //options.compilerArgs += ["-Werror"] + //options.compilerArgs += ["-Werror", "-Xlint:unchecked"] } -jar { - dependsOn('patchJDT') - - 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' - } - } +tasks.named('validatePlugins', ValidatePlugins) { + enabled = false +} - from(zipTree(patchJDT.output)){ - duplicatesStrategy 'include' - } +tasks.named('processResources', ProcessResources) { task -> + task.inputs.property('version', project.version) - manifest { - attributes 'version':project.version - attributes 'javaCompliance': project.targetCompatibility - attributes 'group':project.group - attributes 'Implementation-Version': project.version + getGitHash() + task.filesMatching('forgegradle.version.txt') { + expand 'version': task.inputs.properties.version } } -javadoc { - classpath += configurations.compileOnly - - // linked javadoc urls.. why not... - options.addStringOption 'link', 'https://gradle.org/docs/current/javadoc/' - options.addStringOption 'link', 'http://docs.guava-libraries.googlecode.com/git-history/v18.0/javadoc' - options.addStringOption 'link', 'http://asm.ow2.org/asm50/javadoc/user/' -} +tasks.named('jar', Jar) { + manifest { + attributes([ + 'group' : group, + 'version' : version, + 'javaCompliance' : java.targetCompatibility, + 'Implementation-Version': version + "-" + gitversion.info.hash + ]) + } -task javadocJar(type: Jar, dependsOn: javadoc) { - from javadoc - classifier = "javadoc" + archiveClassifier = 'slim' } -artifacts { - archives jar - //archives javadocJar +shadow { + // Marks the jar as being embedded, not shadowed. + // shadowed = relocated, embedded = no relocation. + bundlingAttribute = Bundling.EMBEDDED } -test { - if (project.hasProperty("filesmaven")) // disable this test when on the forge jenkins - exclude "**/ExtensionMcpMappingTest*" +tasks.named('shadowJar', ShadowJar) { + archiveClassifier = null + configurations = [project.configurations.shadeClasspath] + exclude '.api_description', '.options', 'about.html', 'module-info.class', 'plugin.properties', 'plugin.xml', 'about_files/**' } license { ext { description = 'A Gradle plugin for the creation of Minecraft mods and MinecraftForge plugins.' - year = '2013-' + Calendar.getInstance().get(Calendar.YEAR) + year = '2013-2019' fullname = 'Minecraft Forge' } - header rootProject.file('HEADER') + + header = rootProject.file('LICENSE-header.txt') + newLine = false include '**net/minecraftforge/gradle/**/*.java' - excludes ([ + 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' - description = 'Gradle plugin for all Minecraft mod development needs' - tags = ['forge', 'minecraft', 'minecraftforge', 'sponge', 'mcp'] +changelog { + from '2.3' +} + +gradlePlugin { + website = gitversion.url + vcsUrl = gitversion.url + '.git' plugins { - patcher { + configureEach { + description = 'Gradle plugin for all Minecraft mod development needs' + tags = ['forge', 'minecraft', 'minecraftforge', 'sponge', 'mcp'] + } + + register('patcher') { id = 'net.minecraftforge.gradle.patcher' - displayName = 'Minicraft Patcher Plugin' + displayName = 'Minecraft Patcher Plugin' + implementationClass = 'net.minecraftforge.gradle.patcher.PatcherPlugin' } - tweakerClient { + register('tweakerClient') { id = 'net.minecraftforge.gradle.tweaker-client' - displayName = 'Mincraft Client Tweaker Plugin' + displayName = 'Minecraft Client Tweaker Plugin' + implementationClass = 'net.minecraftforge.gradle.user.tweakers.ClientTweaker' } - tweakerServer { + register('tweakerServer') { id = 'net.minecraftforge.gradle.tweaker-server' - displayName = 'Mincraft Server Tweaker Plugin' + displayName = 'Minecraft Server Tweaker Plugin' + implementationClass = 'net.minecraftforge.gradle.user.tweakers.ServerTweaker' } - forge { + register('forge') { id = 'net.minecraftforge.gradle.forge' - displayName = 'MincraftForge Mod Development Plugin' + displayName = 'MinecraftForge Mod Development Plugin' + implementationClass = 'net.minecraftforge.gradle.user.patcherUser.forge.ForgePlugin' } - - launch4j { + register('launch4j') { id = 'net.minecraftforge.gradle.launch4j' displayName = 'Specialized Launch4J Gradle Plugin' + implementationClass = 'edu.sc.seis.launch4j.Launch4jPlugin' + } + register('liteloader') { + id = 'net.minecraftforge.gradle.liteloader' + displayName = 'LiteLoader Mod Development Plugin' + implementationClass = 'net.minecraftforge.gradle.user.liteloader.LiteloaderPlugin' } } } -uploadArchives { - repositories.mavenDeployer { +shadow { + // Skips the automatic addition of the shadow variant into the Java component. We do that ourselves. + // The reason is because shadow calls mapToOptional(), which we cannot revert. The dependencies are not optional. + addShadowVariantIntoJavaComponent = false +} - dependsOn 'build' +afterEvaluate { + // Skips publishing the slim jar as a component. This makes the POM inherit the shadowRuntimeElements dependencies. + (components.java as AdhocComponentWithVariants).withVariantsFromConfiguration(configurations.runtimeElements) { + skip() + } - if (project.hasProperty('forgeMavenPassword')) - { - repository(url: "https://files.minecraftforge.net/maven/manage/upload") { - authentication(userName: project.getProperty('forgeMavenUser'), password: project.getProperty('forgeMavenPassword')) - } - } - 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()) - } + // Adds the shadowRuntimeElements variant to the Java component. + (components.java as AdhocComponentWithVariants).addVariantsFromConfiguration(configurations.shadowRuntimeElements) {} +} + +publishing { + repositories { + maven gradleutils.publishingForgeMaven + } + publications.register('pluginMaven', MavenPublication) { + changelog.publish(it) + gradleutils.promote(it) - 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' - } + pom { pom -> + name = gradleutils.displayName + description = project.description - issueManagement { - system 'github' - url 'https://github.com/MinecraftForge/ForgeGradle/issues' - } + gradleutils.pom.addRemoteDetails(pom) - licenses { - license { - name 'Lesser GNU Public License, Version 2.1' - url 'https://www.gnu.org/licenses/lgpl-2.1.html' - distribution 'repo' - } - } + licenses { + license gradleutils.pom.licenses.LGPLv2_1 + } - developers { - developer { - id 'AbrarSyed' - name 'Abrar Syed' - roles { role 'developer' } - } - developer { - id 'LexManos' - name 'Lex Manos' - roles { role 'developer' } - } + developers { + developer { + id = 'AbrarSyed' + name = 'Abrar Syed' } + developer gradleutils.pom.developers.LexManos } } } } - -// write out version so its convenient for doc deployment -file('build').mkdirs() -file('build/version.txt').text = version; - -def getGitHash() { - def process = 'git rev-parse --short HEAD'.execute() - process.waitFor() - return '-' + (process.exitValue() ? 'unknown' : process.text.trim()) -} diff --git a/buildSrc/LICENSE-header.txt b/buildSrc/LICENSE-header.txt new file mode 100644 index 000000000..f8a3f65ed --- /dev/null +++ b/buildSrc/LICENSE-header.txt @@ -0,0 +1,2 @@ +Copyright (c) Forge Development LLC and contributors +SPDX-License-Identifier: LGPL-2.1-only diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle new file mode 100644 index 000000000..05cd9ff6e --- /dev/null +++ b/buildSrc/build.gradle @@ -0,0 +1,37 @@ +plugins { + id 'java-gradle-plugin' + id 'idea' + id 'eclipse' + alias libs.plugins.licenser +} + +java.toolchain.languageVersion = JavaLanguageVersion.of(17) + +dependencies { + compileOnly libs.gradle + compileOnly libs.nulls + + implementation libs.gradleutils.shared + + implementation libs.bundles.asm +} + +afterEvaluate { + configurations.api.withDependencies { + remove(dependencies.gradleApi()) + remove(dependencies.localGroovy()) + } +} + +license { + header = rootProject.file('LICENSE-header.txt') + newLine = false + exclude '**/*.properties' +} + +gradlePlugin { + plugins.register('jdt-transformer') { + id = 'local.build.jdt-transformer' + implementationClass = 'local.build.JDTTransformerPlugin' + } +} diff --git a/buildSrc/settings.gradle b/buildSrc/settings.gradle new file mode 100644 index 000000000..d38e61abb --- /dev/null +++ b/buildSrc/settings.gradle @@ -0,0 +1,35 @@ +plugins { + id 'org.gradle.toolchains.foojay-resolver-convention' + id 'net.minecraftforge.gradleutils' +} + +rootProject.name = 'buildSrc' + +dependencyResolutionManagement { + repositories { + mavenCentral() + maven gradleutils.forgeMaven + maven { url = 'https://maven.moddinglegacy.com/maven' } // Gradle API + //mavenLocal() + } + + //@formatter:off + versionCatalogs.register('libs') { + plugin 'licenser', 'net.minecraftforge.licenser' version '1.2.0' + + // Gradle API + version 'gradle', '9.0.0' + library 'gradle', 'name.remal.gradle-api', 'gradle-api' versionRef 'gradle' + + library 'nulls', 'org.jetbrains', 'annotations' version '26.0.2' + + // GradleUtils Shared Base + library 'gradleutils-shared', 'net.minecraftforge', 'gradleutils-shared' version '3.3.5' + + version 'asm', '6.2.1' + library 'asm', 'org.ow2.asm', 'asm' versionRef 'asm' + library 'asm-tree', 'org.ow2.asm', 'asm-tree' versionRef 'asm' + bundle 'asm', ['asm', 'asm-tree'] + } + //@formatter:on +} \ No newline at end of file diff --git a/buildSrc/src/main/java/local/build/JDTClassTransformer.java b/buildSrc/src/main/java/local/build/JDTClassTransformer.java new file mode 100644 index 000000000..b94da9eb3 --- /dev/null +++ b/buildSrc/src/main/java/local/build/JDTClassTransformer.java @@ -0,0 +1,191 @@ +/* + * Copyright (c) Forge Development LLC and contributors + * SPDX-License-Identifier: LGPL-2.1-only + */ +package local.build; + +import net.minecraftforge.gradleutils.shared.Closures; +import org.codehaus.groovy.runtime.DefaultGroovyMethods; +import org.gradle.api.Project; +import org.gradle.api.artifacts.transform.InputArtifact; +import org.gradle.api.artifacts.transform.TransformAction; +import org.gradle.api.artifacts.transform.TransformOutputs; +import org.gradle.api.artifacts.transform.TransformParameters; +import org.gradle.api.artifacts.type.ArtifactTypeDefinition; +import org.gradle.api.attributes.Attribute; +import org.gradle.api.attributes.Category; +import org.gradle.api.attributes.HasConfigurableAttributes; +import org.gradle.api.file.FileSystemLocation; +import org.gradle.api.logging.Logger; +import org.gradle.api.logging.Logging; +import org.gradle.api.provider.Provider; +import org.gradle.api.provider.SetProperty; +import org.gradle.api.tasks.Input; +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.tree.ClassNode; +import org.objectweb.asm.tree.InsnNode; +import org.objectweb.asm.tree.MethodInsnNode; +import org.objectweb.asm.tree.MethodNode; + +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; +import java.util.zip.ZipOutputStream; + +/** + * Dedicated transformer for Eclipse JDT to redirect a method call to Srg2Source's {@code RangeExtractor}. + * + * @see #register(Project) + * @see #transform(HasConfigurableAttributes) + */ +public abstract class JDTClassTransformer implements TransformAction { + private static final Logger LOGGER = Logging.getLogger(JDTClassTransformer.class); + + private static final Attribute ATTRIBUTE = Attribute.of("net.minecraftforge.gradle.build.jdt", Boolean.class); + + public static final String COMPILATION_UNIT_RESOLVER = "org/eclipse/jdt/core/dom/CompilationUnitResolver"; + public static final String RANGE_EXTRACTOR = "net/minecraftforge/srg2source/ast/RangeExtractor"; + private static final String RESOLVE_METHOD = "resolve([Ljava/lang/String;[Ljava/lang/String;[Ljava/lang/String;Lorg/eclipse/jdt/core/dom/FileASTRequestor;ILjava/util/Map;I)V"; + private static final String GET_CONTENTS = "org/eclipse/jdt/internal/compiler/util/Util.getFileCharContent(Ljava/io/File;Ljava/lang/String;)[C"; + private static final String HOOK_DESC_RESOLVE = "(Ljava/lang/String;Ljava/lang/String;)[C"; + + public interface Parameters extends TransformParameters { + @Input SetProperty getTargets(); + } + + /** + * Registers the JDT class transformer with the given project. + * + * @param project + */ + public static void register(Project project) { + var dependencies = project.getDependencies(); + dependencies.getAttributesSchema().attribute(ATTRIBUTE); + dependencies.getArtifactTypes().named(ArtifactTypeDefinition.JAR_TYPE, jar -> jar.getAttributes().attribute(ATTRIBUTE, false)); + + dependencies.registerTransform(JDTClassTransformer.class, spec -> { + spec.parameters(p -> p.getTargets().set(Set.of(JDTClassTransformer.COMPILATION_UNIT_RESOLVER, JDTClassTransformer.RANGE_EXTRACTOR))); + + spec.getFrom() + .attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, ArtifactTypeDefinition.JAR_TYPE) + .attribute(Category.CATEGORY_ATTRIBUTE, project.getObjects().named(Category.class, Category.LIBRARY)) + .attribute(ATTRIBUTE, false); + spec.getTo() + .attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, ArtifactTypeDefinition.JAR_TYPE) + .attribute(Category.CATEGORY_ATTRIBUTE, project.getObjects().named(Category.class, Category.LIBRARY)) + .attribute(ATTRIBUTE, true); + }); + } + + public static void transform(HasConfigurableAttributes dependency) { + dependency.attributes(a -> a.attribute(ATTRIBUTE, true)); + } + + protected abstract @InputArtifact Provider getInputArtifact(); + + @Override + public void transform(TransformOutputs outputs) { + var lib = this.getInputArtifact().get().getAsFile(); + var targets = getParameters().getTargets().get(); + var output = outputs.file(this.getInputArtifact().get().getAsFile().getName().replace(".jar", "-jdt-patched.jar")); + + var toProcess = new HashSet<>(targets); + var toRemove = new ArrayList(); + try (var zout = new ZipOutputStream(new FileOutputStream(output))) { + try (var zin = new ZipFile(lib)) { + for (var entry : Collections.list(zin.entries())) { + String target = null; + for (var t : toProcess) { + if (entry.getName().equals(t + ".class")) { + target = t; + break; + } + } + + if (target == null) { + var nentry = new ZipEntry(entry.getName()); + nentry.setTime(0L); + zout.putNextEntry(nentry); + zout.write(zin.getInputStream(entry).readAllBytes()); + zout.closeEntry(); + continue; + } + + var node = new ClassNode(); + var reader = new ClassReader(zin.getInputStream(entry)); + reader.accept(node, 0); + + //CompilationUnitResolver allows batch compiling, the problem is it is hardcoded to read the contents from a File. + //So we patch this call to redirect to us, so we can get the contents from our InputSupplier + if (COMPILATION_UNIT_RESOLVER.equals(target)) { + LOGGER.info("Transforming: {} From: {}", target, lib); + var resolve = DefaultGroovyMethods.find(node.methods, Closures.function( + m -> RESOLVE_METHOD.equals(m.name + m.desc) + )); + if (resolve == null) + throw new RuntimeException("Failed to patch %s: Could not find method %s".formatted(target, RESOLVE_METHOD)); + for (int x = 0; x < resolve.instructions.size(); x++) { + var it = resolve.instructions.get(x); + if (!(it instanceof MethodInsnNode insn)) continue; + if (!GET_CONTENTS.equals(insn.owner + "." + insn.name + insn.desc)) continue; + + if ( + resolve.instructions.get(x - 5).getOpcode() == Opcodes.NEW && + resolve.instructions.get(x - 4).getOpcode() == Opcodes.DUP && + resolve.instructions.get(x - 3).getOpcode() == Opcodes.ALOAD && + resolve.instructions.get(x - 2).getOpcode() == Opcodes.INVOKESPECIAL && + resolve.instructions.get(x - 1).getOpcode() == Opcodes.ALOAD + ) { + resolve.instructions.set(resolve.instructions.get(x - 5), new InsnNode(Opcodes.NOP)); // NEW File + resolve.instructions.set(resolve.instructions.get(x - 4), new InsnNode(Opcodes.NOP)); // DUP + resolve.instructions.set(resolve.instructions.get(x - 2), new InsnNode(Opcodes.NOP)); // INVOKESTATIC + insn.owner = RANGE_EXTRACTOR; + insn.desc = HOOK_DESC_RESOLVE; + LOGGER.info("Patched {}", node.name); + } else { + throw new IllegalStateException("Found Util#getFileCharContents call with unexpected context"); + } + } + } else if (RANGE_EXTRACTOR.equals(target)) { + LOGGER.info("Transforming: {} From: {}", target, lib); + var marker = DefaultGroovyMethods.find(node.methods, Closures.function( + m -> "hasBeenASMPatched()Z".equals(m.name + m.desc) + )); + if (marker == null) + throw new RuntimeException("Failed to patch " + target + ": Could not find method hasBeenASMPatched()Z"); + + marker.instructions.clear(); + marker.instructions.add(new InsnNode(Opcodes.ICONST_1)); + marker.instructions.add(new InsnNode(Opcodes.IRETURN)); + LOGGER.info("Patched: {}", node.name); + } + + var writer = new ClassWriter(0); + node.accept(writer); + + toRemove.add(target); + var nentry = new ZipEntry(entry.getName()); + nentry.setTime(0L); + zout.putNextEntry(nentry); + zout.write(writer.toByteArray()); + zout.closeEntry(); + } + + toRemove.forEach(toProcess::remove); + } + + if (toProcess.size() < targets.size()) { + LOGGER.lifecycle("JDTClassTransformer successfully patched library: {}", lib.getName()); + } + } catch (IOException e) { + throw new RuntimeException("JDTClassTransformer encountered an unrecoverable error trying to patch " + lib.getName(), e); + } + } +} diff --git a/buildSrc/src/main/java/local/build/JDTTransformerExtension.java b/buildSrc/src/main/java/local/build/JDTTransformerExtension.java new file mode 100644 index 000000000..10f4cb362 --- /dev/null +++ b/buildSrc/src/main/java/local/build/JDTTransformerExtension.java @@ -0,0 +1,13 @@ +/* + * Copyright (c) Forge Development LLC and contributors + * SPDX-License-Identifier: LGPL-2.1-only + */ +package local.build; + +import org.gradle.api.attributes.HasConfigurableAttributes; + +public interface JDTTransformerExtension { + default void transform(HasConfigurableAttributes dependency) { + JDTClassTransformer.transform(dependency); + } +} diff --git a/buildSrc/src/main/java/local/build/JDTTransformerPlugin.java b/buildSrc/src/main/java/local/build/JDTTransformerPlugin.java new file mode 100644 index 000000000..566f7fbbf --- /dev/null +++ b/buildSrc/src/main/java/local/build/JDTTransformerPlugin.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) Forge Development LLC and contributors + * SPDX-License-Identifier: LGPL-2.1-only + */ +package local.build; + +import org.gradle.api.Plugin; +import org.gradle.api.Project; + +import javax.inject.Inject; + +@SuppressWarnings("unused") +abstract class JDTTransformerPlugin implements Plugin { + @Inject + public JDTTransformerPlugin() { } + + @Override + public void apply(Project project) { + project.getExtensions().create("jdt", JDTTransformerExtension.class); + + project.getPluginManager().withPlugin("java", javaPlugin -> + JDTClassTransformer.register(project) + ); + } +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 000000000..0eb695b7e --- /dev/null +++ b/gradle.properties @@ -0,0 +1,12 @@ +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.gradleutils.ide.automatic.sources=true +net.minecraftforge.gradleutils.compilation.defaults=true + +net.minecraftforge.gitversion.log.version=true diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 2c6137b87..1b33c55ba 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9f1c8eabd..2a84e188b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ -#Sat Aug 20 15:56:50 PDT 2016 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-bin.zip diff --git a/gradlew b/gradlew index 9d82f7891..23d15a936 100755 --- a/gradlew +++ b/gradlew @@ -1,74 +1,129 @@ -#!/usr/bin/env bash +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +# Attempt to set APP_HOME -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum -warn ( ) { +warn () { echo "$*" -} +} >&2 -die ( ) { +die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null +CLASSPATH="\\\"\\\"" -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -77,84 +132,120 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac fi -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=$((i+1)) + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac fi -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 5f192121e..db3a6ac20 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,4 +1,22 @@ -@if "%DEBUG%" == "" @echo off +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -8,26 +26,30 @@ @rem Set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" setlocal -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -35,54 +57,36 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +set CLASSPATH= + @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 000000000..1a9e8ffaa --- /dev/null +++ b/settings.gradle @@ -0,0 +1,84 @@ +plugins { + id 'org.gradle.toolchains.foojay-resolver-convention' version '1.0.0' + id 'io.freefair.javadoc-links' version '8.14' apply false + id 'net.minecraftforge.gradleutils' version '3.3.5' +} + +rootProject.name = 'ForgeGradle' + +dependencyResolutionManagement { + repositories { + mavenCentral() + maven { url = 'https://oss.sonatype.org/content/repositories/snapshots/' } // because SS and its snapshot + maven gradleutils.forgeMaven + maven { url = 'https://repo.eclipse.org/content/groups/eclipse/' } // because Srg2Source needs an eclipse dependency. + maven { url = 'https://libraries.minecraft.net/' } // because of the GradleStart stuff + //mavenLocal() + } + + versionCatalogs.register('libs') { + plugin 'licenser', 'net.minecraftforge.licenser' version '1.2.0' + plugin 'gitversion', 'net.minecraftforge.gitversion' version '3.1.1' + plugin 'changelog', 'net.minecraftforge.changelog' version '3.1.2' + plugin 'plugin-publish', 'com.gradle.plugin-publish' version '2.0.0' + plugin 'shadow', 'com.gradleup.shadow' version '9.2.2' + + // Gradle API + // https://mvnrepository.com/artifact/dev.gradleplugins/gradle-api/2.14 + version 'gradle', '2.14' + library 'gradle', 'dev.gradleplugins', 'gradle-api' versionRef 'gradle' + library 'gradle-testkit', 'dev.gradleplugins', 'gradle-test-kit' versionRef 'gradle' + library 'groovy', 'org.codehaus.groovy', 'groovy-all' version '2.4.4' + + version 'asm', '6.0' + library 'asm', 'org.ow2.asm', 'asm' versionRef 'asm' + library 'asm-tree', 'org.ow2.asm', 'asm-tree' versionRef 'asm' + library 'asm-commons', 'org.ow2.asm', 'asm-commons' versionRef 'asm' + library 'asm-debug', 'org.ow2.asm', 'asm-debug-all' versionRef 'asm' + bundle 'asm', ['asm', 'asm-tree', 'asm-commons'] + + library 'guava', 'com.google.guava', 'guava' version '18.0' + + library 'opencsv', 'net.sf.opencsv', 'opencsv' version '2.3' // reading CSVs.. also used by SpecialSource + library 'diff4j', 'com.cloudbees', 'diff4j' version '1.1' // for diffing and patching + library 'jastyle', 'com.github.abrarsyed.jastyle', 'jAstyle' version '1.3' // formatting + library 'trove4j', 'net.sf.trove4j', 'trove4j' version '2.1.0' // because its awesome. + + library 'lzma', 'com.github.jponge', 'lzma-java' version '1.3' // replaces the LZMA binary + library 'xdelta', 'com.nothome', 'javaxdelta' version '2.0.1' // GDIFF implementation for BinPatches + library 'gson', 'com.google.code.gson', 'gson' version '2.2.4' // Used instead of Argo for buuilding changelog. + library 'named-regexp', 'com.github.tony19', 'named-regexp' version '0.2.3' // 1.7 Named regexp features + library 'forgeflower', 'net.minecraftforge', 'forgeflower' version '1.0.342-SNAPSHOT' // Fernflower Forge edition + + library 'specialsource', 'net.md-5', 'SpecialSource' version '1.8.2' // deobf and reobf + + // because curse + library 'httpclient', 'org.apache.httpcomponents', 'httpclient' version '4.3.3' + library 'httpmime', 'org.apache.httpcomponents', 'httpmime' version '4.3.3' + + // mcp stuff + library 'retroguard', 'de.oceanlabs.mcp', 'RetroGuard' version '3.6.6' + library 'mcinjector', 'de.oceanlabs.mcp', 'mcinjector' version '3.4-SNAPSHOT' + library 'srg2source', 'net.minecraftforge', 'Srg2Source' version '5.0.+' + + // Because Eclipse is dumb and decided to use dynamic versions with J8 incompatibility + library 'eclipse-core-resources', 'org.eclipse.platform', 'org.eclipse.core.resources' version '3.14.0' + library 'eclipse-core-runtime', 'org.eclipse.platform', 'org.eclipse.core.runtime' version '3.20.100' + library 'eclipse-text', 'org.eclipse.platform', 'org.eclipse.text' version '3.11.0' + library 'eclipse-core-filesystem', 'org.eclipse.platform', 'org.eclipse.core.filesystem' version '1.7.700' + library 'eclipse-equinox-common', 'org.eclipse.platform', 'org.eclipse.equinox.common' version '3.14.100' + library 'eclipse-core-contenttype', 'org.eclipse.platform', 'org.eclipse.core.contenttype' version '3.7.900' + library 'eclipse-core-jobs', 'org.eclipse.platform', 'org.eclipse.core.jobs' version '3.10.1100' + library 'eclipse-equinox-registry', 'org.eclipse.platform', 'org.eclipse.equinox.registry' version '3.10.100' + library 'eclipse-osgi', 'org.eclipse.platform', 'org.eclipse.osgi' version '3.16.200' + library 'eclipse-core-commands', 'org.eclipse.platform', 'org.eclipse.core.commands' version '3.9.800' + + //Stuff used in the GradleStart classes + library 'authlib', 'com.mojang', 'authlib' version '1.5.16' + library 'launchwrapper', 'net.minecraft', 'launchwrapper' version '1.11' + + library 'kotlin-gradle-plugin', 'org.jetbrains.kotlin', 'kotlin-gradle-plugin' version '1.1.3-2' + + version 'junit', '4.12' + } +} diff --git a/src/main/java/net/minecraftforge/gradle/common/BasePlugin.java b/src/main/java/net/minecraftforge/gradle/common/BasePlugin.java index fc08008bd..bfd8db2fd 100644 --- a/src/main/java/net/minecraftforge/gradle/common/BasePlugin.java +++ b/src/main/java/net/minecraftforge/gradle/common/BasePlugin.java @@ -215,8 +215,6 @@ public void execute(Project project) public abstract void applyPlugin(); - private static boolean displayBanner = true; - private void getRemoteJsons() { // MCP json @@ -242,7 +240,7 @@ protected void afterEvaluate() // ApplyFernFlowerTask ffTask = ((ApplyFernFlowerTask) project.getTasks().getByName("decompileJar")); // ffTask.setClasspath(javaConv.getSourceSets().getByName("main").getCompileClasspath()); - // https://files.minecraftforge.net/maven/de/oceanlabs/mcp/mcp/1.7.10/mcp-1.7.10-srg.zip + // https://maven.minecraftforge.net/de/oceanlabs/mcp/mcp/1.7.10/mcp-1.7.10-srg.zip project.getDependencies().add(CONFIG_MAPPINGS, ImmutableMap.of( "group", "de.oceanlabs.mcp", "name", delayedString("mcp_" + REPLACE_MCP_CHANNEL).call(), @@ -257,32 +255,6 @@ protected void afterEvaluate() "classifier", "srg", "ext", "zip" )); - - // Check FG Version, unless its disabled - List lines = Lists.newArrayListWithExpectedSize(5); - Object disableUpdateCheck = project.getProperties().get("net.minecraftforge.gradle.disableUpdateChecker"); - if (!"true".equals(disableUpdateCheck) && !"yes".equals(disableUpdateCheck) && !new Boolean(true).equals(disableUpdateCheck)) - { - doFGVersionCheck(lines); - } - - if (!displayBanner) - return; - - LOGGER.lifecycle("#################################################"); - LOGGER.lifecycle(" ForgeGradle {} ", this.getVersionString()); - LOGGER.lifecycle(" https://github.com/MinecraftForge/ForgeGradle "); - LOGGER.lifecycle("#################################################"); - LOGGER.lifecycle(" Powered by MCP "); - LOGGER.lifecycle(" http://modcoderpack.com "); - LOGGER.lifecycle(" by: Searge, ProfMobius, R4wk, ZeuX "); - LOGGER.lifecycle(" Fesh0r, IngisKahn, bspkrs, LexManos "); - LOGGER.lifecycle("#################################################"); - - for (String str : lines) - LOGGER.lifecycle(str); - - displayBanner = false; } private String getVersionString() diff --git a/src/main/java/net/minecraftforge/gradle/common/Constants.java b/src/main/java/net/minecraftforge/gradle/common/Constants.java index 81236f49e..fcabcaf01 100644 --- a/src/main/java/net/minecraftforge/gradle/common/Constants.java +++ b/src/main/java/net/minecraftforge/gradle/common/Constants.java @@ -116,11 +116,10 @@ public Boolean call(Object o) // urls public static final String URL_MC_MANIFEST = "https://launchermeta.mojang.com/mc/game/version_manifest.json"; - public static final String URL_FF = "https://files.minecraftforge.net/fernflower-fix-1.0.zip"; - public static final String URL_ASSETS = "http://resources.download.minecraft.net"; + public static final String URL_ASSETS = "https://resources.download.minecraft.net"; public static final String URL_LIBRARY = "https://libraries.minecraft.net/"; // Mojang's Cloudflare front end //public static final String URL_LIBRARY = "https://minecraft-libraries.s3.amazonaws.com/"; // Mojang's AWS server, as Cloudflare is having issues, TODO: Switch back to above when their servers are fixed. - public static final String URL_FORGE_MAVEN = "https://files.minecraftforge.net/maven"; + public static final String URL_FORGE_MAVEN = "https://maven.minecraftforge.net"; public static final List URLS_MCP_JSON = Arrays.asList( URL_FORGE_MAVEN + "/de/oceanlabs/mcp/versions.json", "http://export.mcpbot.bspk.rs/versions.json" diff --git a/src/main/java/net/minecraftforge/gradle/patcher/PatcherConstants.java b/src/main/java/net/minecraftforge/gradle/patcher/PatcherConstants.java index 1ac08445f..36f9722c9 100644 --- a/src/main/java/net/minecraftforge/gradle/patcher/PatcherConstants.java +++ b/src/main/java/net/minecraftforge/gradle/patcher/PatcherConstants.java @@ -29,7 +29,7 @@ private PatcherConstants() {} // installer stuff static final String REPLACE_INSTALLER = "{INSTALLER}"; - static final String INSTALLER_URL = "https://files.minecraftforge.net/maven/net/minecraftforge/installer/" + REPLACE_INSTALLER + "/installer-" + REPLACE_INSTALLER + "-shrunk.jar"; + static final String INSTALLER_URL = "https://maven.minecraftforge.net/net/minecraftforge/installer/" + REPLACE_INSTALLER + "/installer-" + REPLACE_INSTALLER + "-shrunk.jar"; // new project defaults static final String DEFAULT_PATCHES_DIR = "patches"; diff --git a/src/main/java/net/minecraftforge/gradle/user/liteloader/LiteloaderPlugin.java b/src/main/java/net/minecraftforge/gradle/user/liteloader/LiteloaderPlugin.java index afcb44670..de2cd612e 100644 --- a/src/main/java/net/minecraftforge/gradle/user/liteloader/LiteloaderPlugin.java +++ b/src/main/java/net/minecraftforge/gradle/user/liteloader/LiteloaderPlugin.java @@ -50,7 +50,7 @@ public class LiteloaderPlugin extends UserVanillaBasePlugin public static final String MODFILE_PREFIX = "mod-"; public static final String MODFILE_EXTENSION = "litemod"; - public static final String VERSION_JSON_URL = "http://dl.liteloader.com/versions/versions.json"; + public static final String VERSION_JSON_URL = "https://dl.liteloader.com/versions/versions.json"; public static final String VERSION_JSON_FILENAME = "versions.json"; public static final String VERSION_JSON_FILE = REPLACE_CACHE_DIR + "/com/mumfrey/liteloader/" + VERSION_JSON_FILENAME; diff --git a/src/main/java/net/minecraftforge/gradle/user/patcherUser/forge/ForgeExtension.java b/src/main/java/net/minecraftforge/gradle/user/patcherUser/forge/ForgeExtension.java index 28d2a238d..a3e748e62 100644 --- a/src/main/java/net/minecraftforge/gradle/user/patcherUser/forge/ForgeExtension.java +++ b/src/main/java/net/minecraftforge/gradle/user/patcherUser/forge/ForgeExtension.java @@ -130,7 +130,7 @@ private void checkAndSetVersion(String str) * Output: 1.8-11.14.4.1563 * Solution: * Again, Abrar downloaded a 2MB MASSIVE json file, when a slim json would do. - * https://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json + * https://maven.minecraftforge.net/net/minecraftforge/forge/promotions_slim.json * * * API-Wildcards: diff --git a/src/main/resources/META-INF/gradle-plugins/net.minecraftforge.gradle.forge.properties b/src/main/resources/META-INF/gradle-plugins/net.minecraftforge.gradle.forge.properties deleted file mode 100644 index e867709d0..000000000 --- a/src/main/resources/META-INF/gradle-plugins/net.minecraftforge.gradle.forge.properties +++ /dev/null @@ -1 +0,0 @@ -implementation-class=net.minecraftforge.gradle.user.patcherUser.forge.ForgePlugin \ No newline at end of file diff --git a/src/main/resources/META-INF/gradle-plugins/net.minecraftforge.gradle.launch4j.properties b/src/main/resources/META-INF/gradle-plugins/net.minecraftforge.gradle.launch4j.properties deleted file mode 100644 index 74e5964f1..000000000 --- a/src/main/resources/META-INF/gradle-plugins/net.minecraftforge.gradle.launch4j.properties +++ /dev/null @@ -1 +0,0 @@ -implementation-class=edu.sc.seis.launch4j.Launch4jPlugin \ No newline at end of file diff --git a/src/main/resources/META-INF/gradle-plugins/net.minecraftforge.gradle.liteloader.properties b/src/main/resources/META-INF/gradle-plugins/net.minecraftforge.gradle.liteloader.properties deleted file mode 100644 index 4449483ff..000000000 --- a/src/main/resources/META-INF/gradle-plugins/net.minecraftforge.gradle.liteloader.properties +++ /dev/null @@ -1 +0,0 @@ -implementation-class=net.minecraftforge.gradle.user.liteloader.LiteloaderPlugin \ No newline at end of file diff --git a/src/main/resources/META-INF/gradle-plugins/net.minecraftforge.gradle.patcher.properties b/src/main/resources/META-INF/gradle-plugins/net.minecraftforge.gradle.patcher.properties deleted file mode 100644 index b8950ec57..000000000 --- a/src/main/resources/META-INF/gradle-plugins/net.minecraftforge.gradle.patcher.properties +++ /dev/null @@ -1 +0,0 @@ -implementation-class=net.minecraftforge.gradle.patcher.PatcherPlugin \ No newline at end of file diff --git a/src/main/resources/META-INF/gradle-plugins/net.minecraftforge.gradle.tweaker-client.properties b/src/main/resources/META-INF/gradle-plugins/net.minecraftforge.gradle.tweaker-client.properties deleted file mode 100644 index ad0abc4b5..000000000 --- a/src/main/resources/META-INF/gradle-plugins/net.minecraftforge.gradle.tweaker-client.properties +++ /dev/null @@ -1 +0,0 @@ -implementation-class=net.minecraftforge.gradle.user.tweakers.ClientTweaker \ No newline at end of file diff --git a/src/main/resources/META-INF/gradle-plugins/net.minecraftforge.gradle.tweaker-server.properties b/src/main/resources/META-INF/gradle-plugins/net.minecraftforge.gradle.tweaker-server.properties deleted file mode 100644 index 5911296cd..000000000 --- a/src/main/resources/META-INF/gradle-plugins/net.minecraftforge.gradle.tweaker-server.properties +++ /dev/null @@ -1 +0,0 @@ -implementation-class=net.minecraftforge.gradle.user.tweakers.ServerTweaker \ No newline at end of file