diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 0ac6742d5..45900d669 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -56,17 +56,32 @@ jobs: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || '' }} - - name: Set up JDK 8 + - name: Set up JDK 25 uses: actions/setup-java@v6 with: distribution: temurin - java-version: '8' + java-version: '25' - name: Set up Gradle uses: gradle/actions/setup-gradle@v6 with: validate-wrappers: true + - name: Remove incompatible legacy ForgeGradle mappings cache + shell: bash + run: | + minecraft_version="$(sed -n 's/^minecraft_version=//p' gradle.properties | tr -d '\r' | tail -n 1)" + mappings="$(sed -n 's/^mappings_version=//p' gradle.properties | tr -d '\r' | tail -n 1)" + if [[ "$minecraft_version" == '1.12.2' && "$mappings" =~ ^(stable|snapshot)_([0-9]+)$ ]]; then + channel="${BASH_REMATCH[1]}" + mapping_version="${BASH_REMATCH[2]}" + cache_dir="${GRADLE_USER_HOME:-$HOME/.gradle}/caches/minecraft/de/oceanlabs/mcp/mcp_${channel}/${mapping_version}" + if [[ -d "$cache_dir" && ! -f "$cache_dir/joined.srg" ]]; then + echo "Removing incompatible legacy mappings cache: $cache_dir" + rm -rf -- "$cache_dir" + fi + fi + - name: Grant execute permission for Gradle run: chmod +x gradlew diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index ef6777edd..be1c59bd6 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -34,17 +34,32 @@ jobs: fetch-depth: 0 ref: ${{ github.event.release.tag_name }} - - name: Set up JDK 8 + - name: Set up JDK 25 uses: actions/setup-java@v6 with: distribution: temurin - java-version: '8' + java-version: '25' - name: Set up Gradle uses: gradle/actions/setup-gradle@v6 with: validate-wrappers: true + - name: Remove incompatible legacy ForgeGradle mappings cache + shell: bash + run: | + minecraft_version="$(sed -n 's/^minecraft_version=//p' gradle.properties | tr -d '\r' | tail -n 1)" + mappings="$(sed -n 's/^mappings_version=//p' gradle.properties | tr -d '\r' | tail -n 1)" + if [[ "$minecraft_version" == '1.12.2' && "$mappings" =~ ^(stable|snapshot)_([0-9]+)$ ]]; then + channel="${BASH_REMATCH[1]}" + mapping_version="${BASH_REMATCH[2]}" + cache_dir="${GRADLE_USER_HOME:-$HOME/.gradle}/caches/minecraft/de/oceanlabs/mcp/mcp_${channel}/${mapping_version}" + if [[ -d "$cache_dir" && ! -f "$cache_dir/joined.srg" ]]; then + echo "Removing incompatible legacy mappings cache: $cache_dir" + rm -rf -- "$cache_dir" + fi + fi + - name: Grant execute permission for Gradle run: chmod +x gradlew diff --git a/README.md b/README.md index 5599e4a0c..f59bf0717 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ Originally made for Terralization Modpack with fixes from several different fork ### Building Mekanism 1.12.2 Community Edition +Use JDK 25 to run Gradle. RetroFuturaGradle automatically provisions a Java 8 toolchain for Minecraft-compatible bytecode. + ```bash ./gradlew fullBuild ``` diff --git a/build.gradle b/build.gradle index 162bffa70..c8241ab53 100644 --- a/build.gradle +++ b/build.gradle @@ -1,284 +1,308 @@ -buildscript { - repositories { - maven { - name = "central" - url = "https://maven.thorfusion.com/artifactory/central/" - } - } - dependencies { - classpath("com.anatawa12.forge:ForgeGradle:2.3-1.0.+") { - changing = true - } - classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.33.1" - } -} - +import com.gtnewhorizons.retrofuturagradle.mcp.ReobfuscatedJar plugins { - id 'org.ajoberstar.grgit' version '3.1.1' - id "com.matthewprenger.cursegradle" version "1.4.0" - id 'java' + id 'java-library' id 'idea' id 'maven-publish' + id 'com.gtnewhorizons.retrofuturagradle' version '2.0.4' } defaultTasks 'fullBuild' +def baseModVersion = mod_version +def buildVersion = System.getenv('BUILD_VER') +if (buildVersion) { + mod_version = "${baseModVersion}-${buildVersion}" +} + +group = 'mekanism' +version = "${minecraft_version}-${mod_version}" + +base { + archivesName = 'Mekanism-Community-Edition' +} + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(8) + } +} + idea { module { - // For some reason this is necessary for IDEA 2014 workspaces to recognize assets inheritOutputDirs = true } } -apply plugin: 'net.minecraftforge.gradle.forge' -apply plugin: "com.jfrog.artifactory" -//apply plugin: 'net.minecraftforge.gradle' - - repositories { + mavenCentral() + maven { - name = "central" - url = "https://maven.thorfusion.com/artifactory/central/" + name = 'GTNH Maven' + url = uri('https://nexus.gtnewhorizons.com/repository/public/') + content { + includeGroup 'com.gtnewhorizons' + includeGroupByRegex 'com\\.gtnewhorizons\\..+' + } } -} + maven { + name = 'Amadornes Maven' + url = uri('https://maven.amadornes.com/') + content { includeGroup 'MCMultiPart2' } + } + maven { + name = 'JEI Maven' + url = uri('https://dvs1.progwml6.com/files/maven/') + content { includeGroup 'mezz.jei' } + } + maven { + name = 'BlameJared Maven' + url = uri('https://maven.blamejared.com/') + content { + includeGroup 'CraftTweaker2' + includeGroup 'net.darkhax.tesla' + } + } + maven { + name = 'CIL Maven' + url = uri('https://maven.cil.li/') + content { + includeGroup 'li.cil.oc' + includeGroup 'mcp.mobius.waila' + } + metadataSources { + mavenPom() + artifact() + } + } + maven { + name = 'BuildCraft Maven' + url = uri('https://mod-buildcraft.com/maven/') + content { includeGroup 'com.mod-buildcraft' } + } + maven { + name = 'tterrag Maven' + url = uri('https://maven.tterrag.com/') + content { includeGroup 'team.chisel.ctm' } + } + maven { + name = 'IC2 Maven' + url = uri('https://maven.ic2.player.to/') + content { includeGroup 'net.industrial-craft' } + metadataSources { + mavenPom() + artifact() + } + } + maven { + name = 'Thiakil Maven' + url = uri('https://maven.thiakil.com/') + content { includeGroup 'dan200.computercraft' } + } + maven { + name = 'ModMaven' + url = uri('https://modmaven.dev/') + content { includeGroup 'mcjty.theoneprobe' } + } -if (System.getenv("BUILD_VER") == null){ - mod_version = mod_version -} else { - mod_version = mod_version + "-" + System.getenv("BUILD_VER") -} -version = minecraft_version + "-" + mod_version -group = "mekanism" -archivesBaseName = "Mekanism-Community-Edition" -libsDirName = "../output" -distsDirName = "../output" -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 + // Narrow legacy fallback for artifacts that disappeared with their + // original repository. This is deliberately not a general Maven proxy. + maven { + name = 'Thorfusion Legacy Fallback' + url = uri('https://maven.thorfusion.com/artifactory/central/') + content { includeGroup 'net.darkhax.tesla' } + } -/* -minecraft { - mappings channel: 'official', version: "1.12.2" -} -*/ - -minecraft { - version = "${minecraft_version}-${forge_version}" - mappings = "${mappings_version}" - runDir = "run" - useDepAts = true - - replace '${version}', mod_version - replaceIn "Mekanism.java" - replaceIn "MekanismGenerators.java" - replaceIn "MekanismTools.java" - replaceIn "MekanismUltimate.java" + // Keep the hosted project repositories available for Mekanism artifacts, + // without using them as general dependency proxies. + maven { + name = 'Thorfusion Releases' + url = uri('https://maven.thorfusion.com/artifactory/thorfusion/') + content { includeGroup 'mekanism' } + } + maven { + name = 'Thorfusion Development' + url = uri('https://maven.thorfusion.com/artifactory/dev/') + content { includeGroup 'mekanism' } + } } dependencies { compileOnly "org.jetbrains:annotations:${jb_annotations}" - // compileOnly fg.deobf("MCMultiPart2:MCMultiPart:${mcmp_version}") - deobfCompile "MCMultiPart2:MCMultiPart:${mcmp_version}" + implementation rfg.deobf("MCMultiPart2:MCMultiPart:${mcmp_version}") compileOnly "mezz.jei:jei_${minecraft_version}:${jei_version}:api" - // runtime "mezz.jei:jei_${minecraft_version}:${jei_version}" compileOnly "net.darkhax.tesla:Tesla-${minecraft_version}:${tesla_version}" - // compileOnly "inventory-tweaks:InventoryTweaks:${invtweak_version}:api" compileOnly "li.cil.oc:OpenComputers:MC${minecraft_version}-${opencomputers_version}:api" - // Not updated yet compileOnly "mcp.mobius.waila:Hwyla:${hwyla_version}:api" - // deobfCompile "cofh:RedstoneFlux:1.12-${redstoneflux_version}:universal" compileOnly "com.mod-buildcraft:buildcraft-api:${buildcraft_version}" compileOnly "team.chisel.ctm:CTM:MC${minecraft_version}-${ctm_version}:api" - // runtime "team.chisel.ctm:CTM:MC${minecraft_version}-${ctm_version}" compileOnly "net.industrial-craft:industrialcraft-2:${ic2_version}:api" compileOnly("CraftTweaker2:CraftTweaker2-API:${crafttweaker_version}") { - exclude module: "asm-debug-all" + exclude module: 'asm-debug-all' } - /* - compileOnly fg.deobf("CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-${crafttweaker_version}") { - exclude module: "asm-debug-all" - } - */ - deobfCompile("CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-${crafttweaker_version}") { - exclude module: "asm-debug-all" + implementation(rfg.deobf("CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-${crafttweaker_version}")) { + exclude module: 'asm-debug-all' } compileOnly "dan200.computercraft:ComputerCraft:${computercraft_version}:api" compileOnly "mcjty.theoneprobe:TheOneProbe-1.12:${top_version}:api" - /* - compileOnly("appeng:appliedenergistics2:${ae2_version}:api") { - exclude module: "jei_1.12.2" - } - */ + + // Optional integrations whose API jars are deliberately checked into libs/. + compileOnly fileTree(dir: 'libs', include: ['*.jar']) } -processResources { - duplicatesStrategy = 'include' - inputs.property "version", mod_version - inputs.property "mc_version", minecraft_version +minecraft { + mcVersion.set(minecraft_version) + mcpMappingChannel.set(mappings_version.split('_')[0]) + mcpMappingVersion.set(mappings_version.split('_')[1]) + useDependencyAccessTransformers.set(true) - from(sourceSets.main.resources.srcDirs) { - include "mcmod.info" + injectedTags.put('${version}', mod_version) + tagReplacementFiles.add('Mekanism.java') +} - // replace version and mcversion - expand "version": mod_version, "mc_version": minecraft_version - } - - // copy everything else, thats not the mcmod.info - from(sourceSets.main.resources.srcDirs) { - exclude 'mcmod.info' - exclude '**/*.blend*' +tasks.named('deobfuscateMergedJarToSrg') { + accessTransformerFiles.from('src/main/resources/mekanism_at.cfg') +} + +tasks.named('srgifyBinpatchedJar') { + accessTransformerFiles.from('src/main/resources/mekanism_at.cfg') +} + +tasks.named('processResources') { + inputs.property 'version', mod_version + inputs.property 'mc_version', minecraft_version + filesMatching('mcmod.info') { + expand 'version': mod_version, 'mc_version': minecraft_version } + exclude '**/*.blend*' rename '(.+_at.cfg)', 'META-INF/$1' } -def setMainManifestProps = { Manifest manifest-> - manifest.attributes ( +def setMainManifestProps = { Manifest manifest -> + manifest.attributes( 'FMLAT': 'mekanism_at.cfg', 'FMLCorePluginContainsFMLMod': 'true', - 'FMLCorePlugin': 'mekanism.coremod.MekanismCoremod' - ) + 'FMLCorePlugin': 'mekanism.coremod.MekanismCoremod') } -jar { +tasks.named('jar') { manifest(setMainManifestProps) } -task coreJar(type: Jar) { - dependsOn 'reobfJar' - classifier "Core" +def artifactOutputDir = layout.projectDirectory.dir('output') +def reobfuscatedJar = tasks.named('reobfJar', ReobfuscatedJar) +def reobfuscatedContents = { + zipTree(reobfuscatedJar.get().archiveFile.get().asFile) +} +tasks.register('coreJar', Jar) { + dependsOn reobfuscatedJar + archiveClassifier.set('Core') + destinationDirectory.set(artifactOutputDir) from('etc/core') { include '*.info' - expand 'version':mod_version,'mc_version':minecraft_version,'mcmp_version':mcmp_version + expand 'version': mod_version, 'mc_version': minecraft_version, 'mcmp_version': mcmp_version } - - from zipTree(jar.outputs.getFiles().getSingleFile()).matching { + from(reobfuscatedContents) { exclude 'mekanism/tools/**', 'mekanism/generators/**', 'mekanism/ultimate/**', - 'assets/mekanismtools/**', 'assets/mekanismgenerators/**', 'assets/mekanismultimate/**', 'mcmod.info' + 'assets/mekanismtools/**', 'assets/mekanismgenerators/**', + 'assets/mekanismultimate/**', 'mcmod.info' } - manifest(setMainManifestProps) } -task alltJar(type: Jar) { - dependsOn 'reobfJar' - classifier "ALL" - +tasks.register('alltJar', Jar) { + dependsOn reobfuscatedJar + archiveClassifier.set('ALL') + destinationDirectory.set(artifactOutputDir) from('etc/all') { include '*.info' - expand 'version':mod_version,'mc_version':minecraft_version,'mcmp_version':mcmp_version + expand 'version': mod_version, 'mc_version': minecraft_version, 'mcmp_version': mcmp_version } - - from zipTree(jar.outputs.getFiles().getSingleFile()).matching { + from(reobfuscatedContents) { exclude 'mcmod.info' } - manifest(setMainManifestProps) } -task toolsJar(type: Jar) { - dependsOn 'reobfJar' - classifier "Tools" - +tasks.register('toolsJar', Jar) { + dependsOn reobfuscatedJar + archiveClassifier.set('Tools') + destinationDirectory.set(artifactOutputDir) from('etc/tools') { include '*.info' - expand 'version':mod_version,'mc_version':minecraft_version,'mcmp_version':mcmp_version + expand 'version': mod_version, 'mc_version': minecraft_version, 'mcmp_version': mcmp_version } - - from zipTree(jar.outputs.getFiles().getSingleFile()).matching { + from(reobfuscatedContents) { include 'mekanism/tools/**', 'assets/mekanismtools/**' } } -task generatorsJar(type: Jar) { - dependsOn 'reobfJar' - classifier "Generators" - +tasks.register('generatorsJar', Jar) { + dependsOn reobfuscatedJar + archiveClassifier.set('Generators') + destinationDirectory.set(artifactOutputDir) from('etc/generators') { include '*.info' - expand 'version':mod_version,'mc_version':minecraft_version,'mcmp_version':mcmp_version + expand 'version': mod_version, 'mc_version': minecraft_version, 'mcmp_version': mcmp_version } - - from zipTree(jar.outputs.getFiles().getSingleFile()).matching { + from(reobfuscatedContents) { include 'mekanism/generators/**', 'assets/mekanismgenerators/**' } } -task ultimateJar(type: Jar) { - dependsOn 'reobfJar' - classifier "Ultimate" - +tasks.register('ultimateJar', Jar) { + dependsOn reobfuscatedJar + archiveClassifier.set('Ultimate') + destinationDirectory.set(artifactOutputDir) from('etc/ultimate') { include '*.info' - expand 'version':mod_version,'mc_version':minecraft_version,'mcmp_version':mcmp_version + expand 'version': mod_version, 'mc_version': minecraft_version, 'mcmp_version': mcmp_version } - - from zipTree(jar.outputs.getFiles().getSingleFile()).matching { + from(reobfuscatedContents) { include 'mekanism/ultimate/**', 'assets/mekanismultimate/**' } } - -task apiJar(type: Jar) { - classifier "API" - dependsOn "sourceMainJava" - include 'mekanism/api/**' +tasks.register('apiJar', Jar) { + dependsOn tasks.named('classes') + archiveClassifier.set('API') + destinationDirectory.set(artifactOutputDir) from sourceSets.main.java.srcDirs from sourceSets.main.output + include 'mekanism/api/**' } -artifacts { - archives apiJar - archives coreJar - archives toolsJar - archives generatorsJar - archives alltJar - archives ultimateJar +def distributionArtifacts = [ + tasks.named('toolsJar'), + tasks.named('coreJar'), + tasks.named('generatorsJar'), + tasks.named('alltJar'), + tasks.named('apiJar'), + tasks.named('ultimateJar') +] + +tasks.register('fullBuild') { + group = 'build' + description = 'Builds every distribution artifact.' + dependsOn distributionArtifacts } -task fullBuild(type: Delete) { - delete jar - dependsOn "build" -} - -artifactory { - contextUrl = System.getenv("MAVEN_URL") - publish { - repository { - repoKey = System.getenv("MAVEN_REPO") - username = System.getenv("MAVEN_USERNAME") - password = System.getenv("MAVEN_PASSWORD") - maven = true - } - defaults { - publications('mavenJava') - } - publishBuildInfo = false - publishArtifacts = true - publishPom = true - } - resolve { - repository { - repoKey = System.getenv("MAVEN_REPO") - username = System.getenv("MAVEN_USERNAME") - password = System.getenv("MAVEN_PASSWORD") - maven = true - - } - } -} +def publishBaseUrl = providers.environmentVariable('MAVEN_URL') + .orElse('https://maven.thorfusion.com/artifactory') +def publishRepository = providers.environmentVariable('MAVEN_REPO').orElse('dev') publishing { publications { mavenJava(MavenPublication) { - artifactId = project.archivesBaseName + artifactId = 'Mekanism-Community-Edition' groupId = project.group version = project.version - artifacts = [toolsJar, coreJar, generatorsJar, alltJar, apiJar, ultimateJar] + distributionArtifacts.each { artifact it } pom { - name.set("Mekanism Community Edition") + name.set('Mekanism Community Edition') description.set('Mekanism is a Minecraft add-on featuring high-tech machinery that can be used to create powerful tools, armor, and weapons.') url.set('https://github.com/Thorfusion/Mekanism-Community-Edition') issueManagement { @@ -294,4 +318,20 @@ publishing { } } } + repositories { + maven { + name = 'thorfusion' + url = uri("${publishBaseUrl.get().replaceAll('/+$', '')}/${publishRepository.get()}") + credentials { + username = providers.environmentVariable('MAVEN_USERNAME').orElse('').get() + password = providers.environmentVariable('MAVEN_PASSWORD').orElse('').get() + } + } + } +} + +tasks.register('artifactoryPublish') { + group = 'publishing' + description = 'Publishes the complete artifact set to the configured Maven repository.' + dependsOn tasks.named('publishMavenJavaPublicationToThorfusionRepository') } diff --git a/gradle.properties b/gradle.properties index 66c6678e9..b09ac3f94 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,16 +4,16 @@ forge_version=14.23.5.2847 mod_version=9.12.15 mcmp_version=2.5.3 -jei_version=4.15.0.289 +jei_version=4.16.1.302 tesla_version=1.0.63 invtweak_version=1.64+dev.151 -opencomputers_version=1.7.4.153 +opencomputers_version=1.7.5.221 hwyla_version=1.8.26-B41_1.12.2 redstoneflux_version=2.1.1.1 -buildcraft_version=7.99.24.1 +buildcraft_version=7.99.24.8 ctm_version=0.3.3.22 -ic2_version=2.8.170-ex112 -crafttweaker_version=4.1.19.548 +ic2_version=2.8.222-ex112 +crafttweaker_version=4.1.20.716 computercraft_version=1.80pr1 top_version=1.12-1.4.28-17 ae2_version=rv6-stable-7 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 943f0cbfa..61285a659 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 508322917..37f78a6af 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 65dcd68d6..adff685a0 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015 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. @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# 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/. @@ -83,10 +85,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -# 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"' +# 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 @@ -114,7 +114,6 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. @@ -133,10 +132,13 @@ 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. + 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. @@ -144,7 +146,7 @@ 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=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +154,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -169,7 +171,6 @@ fi # 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" ) @@ -197,16 +198,19 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# 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" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/gradlew.bat b/gradlew.bat index 93e3f59f1..c4bdd3ab8 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @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 ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 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 @@ -57,22 +59,21 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe 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 :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 000000000..6a08f01b0 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,20 @@ +pluginManagement { + repositories { + maven { + name = 'GTNH Maven' + url = uri('https://nexus.gtnewhorizons.com/repository/public/') + mavenContent { + includeGroup 'com.gtnewhorizons' + includeGroupByRegex 'com\\.gtnewhorizons\\..+' + } + } + gradlePluginPortal() + mavenCentral() + } +} + +plugins { + id 'org.gradle.toolchains.foojay-resolver-convention' version '1.0.0' +} + +rootProject.name = 'Mekanism-Community-Edition-1.12.2'