diff --git a/build.gradle b/build.gradle index ee7cefb..44c8021 100644 --- a/build.gradle +++ b/build.gradle @@ -1,90 +1,69 @@ +//file:noinspection DependencyNotationArgument +// TODO remove when fixed in RFG ^ + import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.api.tasks.testing.logging.TestLogEvent - -buildscript { - repositories { - mavenCentral() - mavenLocal() - } - dependencies { - classpath "org.spongepowered:mixingradle:${mixingradle_version}" - } -} +import org.jetbrains.gradle.ext.Gradle plugins { - id 'net.minecraftforge.gradle' version "${forge_gradle_version}" - id 'wtf.gofancy.fancygradle' version "${fancy_gradle_version}" + id 'java' + id 'java-library' + id 'maven-publish' + id 'eclipse' + id 'org.jetbrains.gradle.plugin.idea-ext' version "$idea_ext_version" + id 'com.gtnewhorizons.retrofuturagradle' version "$rfg_version" + id 'net.darkhax.curseforgegradle' version "$curseforge_gradle_version" apply false + id 'com.modrinth.minotaur' version "$minotaur_version" apply false } -apply plugin: 'org.spongepowered.mixin' - -version = mod_version +version = project.mod_version group = project.maven_group -archivesBaseName = "${project.archives_base_name}-${project.minecraft_version}" - -java.toolchain.languageVersion = JavaLanguageVersion.of(8) - -if (project.use_intellij_idea.toBoolean()) { - apply { - plugin 'java' - plugin 'idea' +archivesBaseName = project.archives_base_name + +// Set the toolchain version to decouple the Java we run Gradle with from the Java used to compile and run the mod +java { + toolchain { + // Azul covers the most platforms for Java 8 toolchains, crucially including MacOS arm64 + vendor.set(JvmVendorSpec.AZUL) + languageVersion.set(JavaLanguageVersion.of(project.java_version)) } - idea { - module { - downloadJavadoc = true - downloadSources = true - } - } + // Generate sources when building and publishing + withSourcesJar() + // javadoc jar throws errors on incomplete docs + // docs are also contained in the sources jar, so omit the javadoc-only jar } -if (project.use_eclipse.toBoolean()) { - apply { - plugin 'java' - plugin 'eclipse' - } +tasks.withType(JavaCompile).configureEach { + options.encoding 'UTF-8' +} - eclipse { - module { - downloadJavadoc = true - downloadSources = true - } - } +configurations { + embed + implementation.extendsFrom(embed) } minecraft { - mappings channel: "${mcp_mappings_channel}", version: "${mcp_mappings_version}" - - accessTransformer = file('src/main/resources/META-INF/gregification_at.cfg') - - runs { - client { - //noinspection GroovyAssignabilityCheck - workingDirectory project.file('run') - jvmArg '-Dfml.coreMods.load=' + coremod_plugin_class_name - jvmArg '-Dmixin.hotSwap=true' - jvmArg '-Dmixin.checks.interfaces=true' - jvmArg '-Dmixin.debug=true' - property 'forge.logging.markers', 'REGISTRIES' - property 'forge.logging.console.level', 'debug' - environment 'MC_VERSION', minecraft_version.toString() - } + mcVersion = project.mc_version + def args = [ + "-ea:${project.group}", + "-Dfml.coreMods.load=${coremod_plugin_class_name}" + ] + extraRunJvmArguments.addAll(args) - server { - //noinspection GroovyAssignabilityCheck - workingDirectory project.file('run') - jvmArg '-Dfml.coreMods.load=' + coremod_plugin_class_name - jvmArg '-Dmixin.hotSwap=true' - jvmArg '-Dmixin.checks.interfaces=true' - property 'forge.logging.markers', 'REGISTRIES' - property 'forge.logging.console.level', 'debug' - environment 'MC_VERSION', minecraft_version.toString() - } - } + useDependencyAccessTransformers = true + + injectedTags.put('VERSION', project.version) +} + +// Generate the InternalTags class with the version number as a field +tasks.injectTags.configure { + outputClassName.set("${project.group}.GFInternalTags") } repositories { maven { + // MixinBooter name 'Cleanroom Maven' url 'https://maven.cleanroommc.com' } @@ -99,6 +78,7 @@ repositories { url 'https://maven.blamejared.com' } maven { + // TOP, CTM, GRS, AE2 name 'Curse Maven' url 'https://www.cursemaven.com' content { @@ -106,107 +86,176 @@ repositories { } } maven { + // Mixin name 'Sponge Maven' url 'https://repo.spongepowered.org/maven' } + mavenLocal() // Must be last for caching to work } dependencies { - minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" - - // Hard-Deps - implementation fg.deobf("curse.maven:gregtech-ce-unofficial-${project.gt_id}:${project.gt_version}") - implementation fg.deobf("curse.maven:codechicken-lib-1-8-242818:2779848") - implementation fg.deobf("curse.maven:mixin-booter-419286:4090558") - // Useful stuff - implementation "mezz.jei:jei_1.12.2:4.16.1.302" - implementation "CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-${project.ct_version}" + // Hard Dependencies + // the CCL deobf jar uses very old MCP mappings, making it error at runtime in runClient/runServer + // therefore we manually deobf the regular jar + implementation rfg.deobf("curse.maven:codechicken-lib-1-8-${ccl_pid}:${ccl_fid}") + // manually deobf the jar to prevent extra configuration for handling obf/deobf separation + implementation rfg.deobf("curse.maven:gregtech-ce-unofficial-${gt_pid}:${gt_fid}-sources-${gt_sources_fid}") + implementation "zone.rong:mixinbooter:${mixinbooter_version}" + + // Soft Dependencies + implementation "mezz.jei:jei_1.12.2:${project.jei_version}" + implementation "CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-${project.crt_version}" + implementation rfg.deobf("curse.maven:top-${top_pid}:${top_fid}") + implementation rfg.deobf("curse.maven:ctm-${ctm_pid}:${ctm_fid}") implementation files("libs/groovyscript-0.4.0.jar") - implementation fg.deobf("curse.maven:the-one-probe-245211:2667280") - - // Direct compat mods - // Must be present in-dev as their code is referenced in this mod - implementation fg.deobf("curse.maven:ctm-267602:2915363") - implementation fg.deobf("curse.maven:forestry-59751:2918418") - implementation fg.deobf("curse.maven:tinkers-construct-74072:2902483") - implementation fg.deobf("curse.maven:mantle-74924:2713386") - implementation fg.deobf("curse.maven:shadowfacts-forgelin-248453:2785465") - implementation fg.deobf("curse.maven:ex-nihilo-creatio-274456:2817545") - implementation fg.deobf("curse.maven:opencomputers-223008:2828357") - implementation fg.deobf("curse.maven:tfcraft-302973:3268988") - implementation fg.deobf("curse.maven:ae2-extended-life-570458:4323863") - implementation fg.deobf("curse.maven:gregtech-food-option-${project.gtfo_id}:${project.gtfo_version}") + + // Compat Mods + implementation rfg.deobf("curse.maven:forestry-59751:2918418") + implementation rfg.deobf("curse.maven:tinkers-construct-74072:2902483") + implementation rfg.deobf("curse.maven:mantle-74924:2713386") + implementation rfg.deobf("curse.maven:shadowfacts-forgelin-248453:2785465") + implementation rfg.deobf("curse.maven:ex-nihilo-creatio-274456:2817545") + implementation rfg.deobf("curse.maven:opencomputers-223008:2828357") + implementation rfg.deobf("curse.maven:tfcraft-302973:3268988") + implementation rfg.deobf("curse.maven:ae2-extended-life-${project.ae2_pid}:${project.ae2_fid}") + implementation rfg.deobf("curse.maven:gregtech-food-option-${project.gtfo_id}:${project.gtfo_version}") // May get some form of compatibility in the future - //implementation fg.deobf("curse.maven:mcjtylib-233105:2745846") - //implementation fg.deobf("curse.maven:xnet-260912:2745852") + //implementation rfg.deobf("curse.maven:mcjtylib-233105:2745846") + //implementation rfg.deobf("curse.maven:xnet-260912:2745852") // Addons and other mods // Enable for testing as needed - //implementation fg.deobf("curse.maven:binnies-mods-223525:2916129") - //implementation fg.deobf("curse.maven:magic-bees-65764:2566282") - //implementation fg.deobf("curse.maven:gendustry-70492:2516215") - //implementation fg.deobf("curse.maven:bdlib-70496:2518031") - //implementation fg.deobf("curse.maven:career-bees-281791:2534481") - //implementation fg.deobf("curse.maven:retrobees-300139:2934369") - //implementation fg.deobf("curse.maven:the-twilight-forest-227639:3051450") - //implementation fg.deobf("curse.maven:thaumcraft-223628:2629023") - //implementation fg.deobf("curse.maven:baubles-227083:2518667") - //implementation fg.deobf("curse.maven:biomes-o-plenty-220318:2715506") - //implementation fg.deobf("curse.maven:extra-utilities-225561:2678374") - - // Mixin related things - compileOnly "zone.rong:mixinbooter:${project.mixinbooter_version}" - runtimeOnly "zone.rong:mixinbooter:${project.mixinbooter_version}" - annotationProcessor "org.spongepowered:mixin:${project.mixin_annotations_version}:processor" + //implementation rfg.deobf("curse.maven:binnies-mods-223525:2916129") + //implementation rfg.deobf("curse.maven:magic-bees-65764:2566282") + //implementation rfg.deobf("curse.maven:gendustry-70492:2516215") + //implementation rfg.deobf("curse.maven:bdlib-70496:2518031") + //implementation rfg.deobf("curse.maven:career-bees-281791:2534481") + //implementation rfg.deobf("curse.maven:retrobees-300139:2934369") + //implementation rfg.deobf("curse.maven:the-twilight-forest-227639:3051450") + //implementation rfg.deobf("curse.maven:thaumcraft-223628:2629023") + //implementation rfg.deobf("curse.maven:baubles-227083:2518667") + //implementation rfg.deobf("curse.maven:biomes-o-plenty-220318:2715506") + //implementation rfg.deobf("curse.maven:extra-utilities-225561:2678374") + + // Mixin dependencies + api("org.spongepowered:mixin:${mixin_version}") { + transitive = false + } + annotationProcessor("org.spongepowered:mixin:${mixin_version}") { + transitive = false + } + + annotationProcessor "org.ow2.asm:asm-debug-all:${asm_debug_version}" + annotationProcessor "com.google.guava:guava:${guava_version}-jre" + annotationProcessor "com.google.code.gson:gson:${gson_version}" } -fancyGradle { - patches { - resources - coremods - asm - codeChickenLib +//noinspection ConfigurationAvoidance +for (File at : sourceSets.getByName('main').resources.files) { + if (at.name.toLowerCase().endsWith('_at.cfg')) { + tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from at + tasks.srgifyBinpatchedJar.accessTransformerFiles.from at } } -processJarTask jar +processResources { + // this will ensure that this task is redone when the versions change. + inputs.property 'version', project.version + inputs.property 'mcversion', project.minecraft.version + // replace stuff in mcmod.info, nothing else + filesMatching(['mcmod.info', 'pack.mcmeta']) { fcd -> + // replace version and mcversion + fcd.expand( + 'version': project.version, + 'mcversion': project.minecraft.version + ) + } -def final is_ci_env = providers.environmentVariable('CI').getOrElse('false').toBoolean() + rename '(.+_at.cfg)', 'META-INF/$1' // Access Transformers +} -if (is_ci_env || project.build_deobfJar.toBoolean()) { - // Create deobf dev jars - tasks.register('deobfJar', Jar) { - archiveClassifier.set 'deobf' - from sourceSets.main.output +jar { + manifest { + def attribute_map = [:] + attribute_map['FMLCorePlugin'] = coremod_plugin_class_name + attribute_map['FMLCorePluginContainsFMLMod'] = true + attribute_map['ForceLoadAsMod'] = project.gradle.startParameter.taskNames[0] == 'build' + attribute_map['TweakClass'] = 'org.spongepowered.asm.launch.MixinTweaker' + attribute_map['FMLAT'] = archives_base_name + '_at.cfg' + attributes(attribute_map) } - processJarTask deobfJar -} -if (is_ci_env || project.build_apiJar.toBoolean()) { - // Create API library jar - tasks.register('apiJar', Jar) { - archiveClassifier.set 'api' - from(sourceSets.main.java) { - include 'gregification/api/**' + // Add all embedded dependencies into the jar + from provider { + configurations.embed.collect { + it.isDirectory() ? it : zipTree(it) } + } +} - from(sourceSets.main.output) { - include 'gregification/api/**' +test { + testLogging { + events TestLogEvent.STARTED, TestLogEvent.PASSED, TestLogEvent.FAILED + exceptionFormat TestExceptionFormat.FULL + showExceptions true + showStackTraces true + showCauses true + showStandardStreams true + } + + useJUnitPlatform() +} + +idea { + module { + inheritOutputDirs true + downloadJavadoc true + downloadSources true + } + project { + settings { + runConfigurations { + '1. Run Client'(Gradle) { + taskNames = ['runClient'] + } + '2. Run Server'(Gradle) { + taskNames = ['runServer'] + } + '3. Run Obfuscated Client'(Gradle) { + taskNames = ['runObfClient'] + } + '4. Run Obfuscated Server'(Gradle) { + taskNames = ['runObfServer'] + } + } + compiler.javac { + afterEvaluate { + javacAdditionalOptions = '-encoding utf8' + moduleJavacAdditionalOptions = [ + (project.name + '.main'): tasks.compileJava.options.compilerArgs.collect { + '"' + it + '"' + }.join(' ') + ] + } + } } } } -if (is_ci_env || project.build_sourceJar.toBoolean()) { - // Create source jar - tasks.register('sourcesJar', Jar) { - archiveClassifier.set 'sources' - from sourceSets.main.allJava +// Create API library jar +tasks.register('apiJar', Jar) { + archiveClassifier.set 'api' + from(sourceSets.main.java) { + include 'gregicality.multiblocks/api/**' + } + + from(sourceSets.main.output) { + include 'gregicality.multiblocks/api/**' } } -// Loading resources, works even on IDE client runs sourceSets { main { ext.refMap = 'mixins.' + archives_base_name + '.refmap.json' @@ -214,97 +263,86 @@ sourceSets { java { srcDirs = ['src/main/java', 'src/api/java'] } - - resources { - srcDirs = ['src/main/resources'] - } } - test { java { - srcDirs = ['src/test/java'] - } - resources { - srcDirs = ['src/test/resources'] + compileClasspath += patchedMc.output + mcLauncher.output + runtimeClasspath += patchedMc.output + mcLauncher.output } } - - // at compile time, put resources in same directories as classes - main.output.setResourcesDir(main.java.classesDirectory) } -artifacts { - if (is_ci_env || project.build_deobfJar.toBoolean()) { - archives deobfJar - } - if (is_ci_env || project.build_apiJar.toBoolean()) { - archives apiJar - } - if (is_ci_env || project.build_sourceJar.toBoolean()) { - archives sourcesJar - } +tasks.named('processIdeaSettings').configure { + dependsOn('injectTags') } -// It is important to NOT re-obfuscate jars for the deobfuscated environment. -// Therefore, we do not finalize the 'jar' task with the 'reobfJar' task. -// The Forge FG5 example buildscript states otherwise, however it creates broken builds in deobfuscated environments. - -processResources { - // required to allow file expansion later - duplicatesStrategy = DuplicatesStrategy.INCLUDE - - // this will ensure that this task is redone when the versions change. - inputs.property 'version', version - inputs.property 'mcversion', minecraft_version - - // replace stuff in mcmod.info, nothing else - from(sourceSets.main.resources.srcDirs) { - include 'mcmod.info' +// Deployment, for when this is ready for release - // replace version and mcversion - expand(['version': version, 'mcversion': minecraft_version]) - } +/*final boolean is_ci_env = providers.environmentVariable('CI').getOrElse('false').toBoolean() +final boolean deployment_debug = providers.environmentVariable('DEPLOYMENT_DEBUG').getOrElse("$deployment_debug").toBoolean() - // copy everything else except mcmod.info - from(sourceSets.main.resources.srcDirs) { - exclude 'mcmod.info' +if (is_ci_env || deployment_debug) { + artifacts { + archives jar + archives apiJar + archives sourcesJar } } -test { - testLogging { - events TestLogEvent.STARTED, TestLogEvent.PASSED, TestLogEvent.FAILED - exceptionFormat TestExceptionFormat.FULL - showExceptions true - showStackTraces true - showCauses true - showStandardStreams true +def final cf_api_key = providers.environmentVariable('CURSEFORGE_API_KEY') +if (cf_api_key.isPresent() || deployment_debug) { + apply plugin: 'net.darkhax.curseforgegradle' + //noinspection UnnecessaryQualifiedReference + tasks.register('curseforge', net.darkhax.curseforgegradle.TaskPublishCurseForge) { + apiToken = cf_api_key.get() + def final projectId = providers.environmentVariable('CURSEFORGE_PROJECT_ID').get() + + def mainFile = upload(projectId, reobfJar) + mainFile.releaseType = providers.environmentVariable('RELEASE_TYPE').get() + mainFile.changelog = providers.environmentVariable('CHANGELOG_LOCATION').get() + mainFile.changelogType = 'markdown' + mainFile.addRequirement 'codechicken-lib-1-8' + mainFile.addRequirement 'gregtech-ce-unofficial' + mainFile.addIncompatibility 'gregtechce' + mainFile.addModLoader 'Forge' + mainFile.addJavaVersion "Java ${java_version}" + mainFile.addGameVersion "$mc_version" + + def sourcesFile = mainFile.withAdditionalFile(sourcesJar) + sourcesFile.changelog = providers.environmentVariable('CHANGELOG_LOCATION').get() + + def devFile = mainFile.withAdditionalFile(jar) + devFile.changelog = providers.environmentVariable('CHANGELOG_LOCATION').get() + + disableVersionDetection() } - useJUnitPlatform() + tasks.curseforge.dependsOn(build) } -/** - * Applies required processing to jar tasks - * @param task the task to process - */ -private void processJarTask(task) { - task.configure { - manifest { - // noinspection GroovyAssignabilityCheck - def attribute_map = [:] - attribute_map['FMLCorePlugin'] = project.coremod_plugin_class_name - attribute_map['FMLCorePluginContainsFMLMod'] = true - attribute_map['ForceLoadAsMod'] = project.gradle.startParameter.taskNames[0] == 'build' - attribute_map['TweakClass'] = 'org.spongepowered.asm.launch.MixinTweaker' - attribute_map['FMLAT'] = 'gregification_at.cfg' - attributes(attribute_map) +def final modrinth_api_key = providers.environmentVariable('MODRINTH_API_KEY') +if (modrinth_api_key.isPresent() || deployment_debug) { + apply plugin: 'com.modrinth.minotaur' + + modrinth { + token = modrinth_api_key.get() + projectId = providers.environmentVariable("MODRINTH_PROJECT_ID").get() + changelog = providers.environmentVariable("CHANGELOG_LOCATION").get() + versionType = providers.environmentVariable("RELEASE_TYPE").get() + + versionNumber = "$version".split('-')[0] // strip out the EXTRA field, if present + gameVersions = ["$mc_version"] + loaders = ["forge"] + + def main_artifact = "${archivesBaseName}-${version}.jar" + uploadFile = file("build/libs/${main_artifact}") + file('build/libs/').eachFile { file -> + if (file.name.endsWith('.jar') && file.name != main_artifact) { + additionalFiles.add file + } } - // exclude all files in src/api from being shipped in the jar - // this prevents crashes in obfuscated environments - file('src/api/').eachDirRecurse { dir -> - exclude dir.name - } + debugMode = deployment_debug } -} + tasks.modrinth.dependsOn(build) +} */ diff --git a/gradle.properties b/gradle.properties index 274b8c3..141a02a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,54 +1,64 @@ -# Sets default memory used for gradle commands. Can be overridden by user or command line properties. -# This is required to provide enough memory for the Minecraft decompilation process. -org.gradle.jvmargs = -Xmx3G -org.gradle.daemon = false - # Mod Information +archives_base_name = Gregification +mc_version = 1.12.2 mod_version = 0.0.1 -minecraft_version = 1.12.2 maven_group = gregification -archives_base_name = Gregification - -# This will download sources and Javadoc for the dependencies (for example mixins), set which ide you use -# You can look up dependencies and their available sources and Javadoc in intellij by going to File ProjectStructure Libraries -use_intellij_idea = true -use_eclipse = false - -# Optional Jar compiling -build_deobfJar = false -build_apiJar = false -build_sourceJar = false - -# If any properties change below this line, refresh gradle again to ensure everything is working correctly. # Coremod Arguments coremod_plugin_class_name = gregification.core.GregificationLoadingPlugin -# Gradle Plugins -forge_gradle_version = 5.1.+ -fancy_gradle_version = 1.1.+ +## Hard Dependencies +ccl_pid = 242818 +ccl_fid = 2779848 +gt_pid = 557242 +gt_fid = 4527757 +gt_sources_fid = 4527758 -# Minecraft-Specific -forge_version = 14.23.5.2860 -mcp_mappings_channel = stable -mcp_mappings_version = 39-1.12 +## Soft Dependencies +jei_version = 4.16.1.302 +crt_version = 4.1.20.684 +### TOP 1.4.28 +top_pid = 245211 +top_fid = 2667280 +### CTM 1.0.2.31 +ctm_pid = 267602 +ctm_fid = 2915363 -## Frequently updated dependencies -# GTCEu 2.6.1 -gt_id = 557242 -gt_version = 4483462 +### AE2 0.55.6 +ae2_pid = 570458 +ae2_fid = 4402048 # GregTech Food Option 1.8.6 gtfo_id = 477021 gtfo_version = 4480325 -# CraftTweaker -ct_version = 4.1.20.684 - -# Mixin Dependencies -mixingradle_version = 0.7-SNAPSHOT +## Mixin Dependencies mixinbooter_version = 7.0 -mixin_annotations_version = 0.8.5 +mixin_version = 0.8.3 +asm_debug_version = 5.2 +### should use 24.1.1 but 30.0+ has a vulnerability fix +guava_version = 30.0 +### should use 2.8.6 but 2.8.9+ has a vulnerability fix +gson_version = 2.8.9 + + +## Gradle Dependencies +foojay_version = 0.4.0 +idea_ext_version = 1.1.7 +rfg_version = 1.3.12 +java_version = 8 + +# Deployment +deployment_debug = false + +## Dependencies +curseforge_gradle_version = 1.0.+ +minotaur_version = 2.7.+ # Gradle Settings (do not rename values) -org.gradle.welcome = never \ No newline at end of file +org.gradle.welcome = never +org.gradle.logging.stacktrace = all +## Sets default memory used for gradle commands. Can be overridden by user or command line properties. +## This is required to provide enough memory for the Minecraft decompilation process. +org.gradle.jvmargs = -Xmx3G +org.gradle.daemon = false diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 249e583..c1962a7 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 070cb70..37aef8d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip +networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 index a69d9cb..aeb74cb --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,13 +80,10 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# 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"' +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -143,12 +140,16 @@ 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=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=SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -193,6 +194,10 @@ if "$cygwin" || "$msys" ; then done fi + +# 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 $GRADLE_OPTS can contain fragments of # shell script including quotes and variable substitutions, so put them in diff --git a/gradlew.bat b/gradlew.bat index 53a6b23..6689b85 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% diff --git a/settings.gradle b/settings.gradle index 2fc763e..561ac48 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,17 +1,26 @@ pluginManagement { repositories { - gradlePluginPortal() - maven { - name 'FancyGradle Maven' - url 'https://gitlab.com/api/v4/projects/26758973/packages/maven' - } maven { - name 'ForgeGradle Maven' - url 'https://maven.minecraftforge.net' - } - maven { - name 'MixinGradle Maven' - url 'https://repo.spongepowered.org/repository/maven-public' + // RetroFuturaGradle + name 'GTNH Maven' + //noinspection HttpUrlsUsage + url 'http://jenkins.usrv.eu:8081/nexus/content/groups/public/' + allowInsecureProtocol = true + //noinspection GroovyAssignabilityCheck + mavenContent { + includeGroup 'com.gtnewhorizons' + includeGroup 'com.gtnewhorizons.retrofuturagradle' + } } + gradlePluginPortal() + mavenCentral() + mavenLocal() } } + +plugins { + // Automatic toolchain provisioning + id 'org.gradle.toolchains.foojay-resolver-convention' version "${foojay_version}" +} + +rootProject.name = archives_base_name diff --git a/src/main/java/gregification/Gregification.java b/src/main/java/gregification/Gregification.java index f605b0e..65887a1 100644 --- a/src/main/java/gregification/Gregification.java +++ b/src/main/java/gregification/Gregification.java @@ -49,7 +49,7 @@ public class Gregification { public static final String MODID = "gregification"; public static final String MOD_NAME = "Gregification"; - public static final String VERSION = "@VERSION@"; + public static final String VERSION = GFInternalTags.VERSION; // Root logger public static final Logger logger = LogManager.getLogger("Gregification");