GTNHGradle
This plugin is the container for most of our shared buildscript logic for all GTNH mods and some other 1.7.10 mods. The original buildscript grew to hundreds of lines of Groovy code, using this plugin we can use regular Java classes to compartmentalize that logic and make it easier to extend and update
Install / Use
/learn @GTNewHorizons/GTNHGradleREADME
GTNH Gradle plugin
This plugin is the container for most of our shared buildscript logic for all GTNH mods and some other 1.7.10 mods. The original buildscript grew to hundreds of lines of Groovy code, using this plugin we can use regular Java classes to compartmentalize that logic and make it easier to extend and update.
See the javadoc - the entrypoint is the plugin extension class.
Navigating the source code
The entrypoint for the plugin is in the GTNHGradlePlugin class.
The main plugin class applies the plugin dependencies of GTNHGradle, including RFG, Maven publishing and the Download task,
and then registers the gtnhGradle extension object which can be used to activate individual modules of this plugin.
test tests make sure that applying the plugin works correctly in a simple Gradle setup.
Bulk of the testing is done in functionalTest which uses Gradle TestKit to test entire workflows in sandboxed Gradle environments.
Updating from the previous buildscript
- Make sure you're on the latest
mastercommit and you pulled the recent repository changes ;-) - Copy over the
gradle/directory andbuild.gradle,gradlewandgradlew.batfiles from ExampleMod1.7.10 to the mod folder. - Update
settings.gradlepluginManagement{}andplugins{}block to the following: (keep the old blowdryerSetup as-is)pluginManagement { repositories { maven { // RetroFuturaGradle name "GTNH Maven" url "https://nexus.gtnewhorizons.com/repository/public/" mavenContent { includeGroup("com.gtnewhorizons") includeGroupByRegex("com\\.gtnewhorizons\\..+") } } gradlePluginPortal() mavenCentral() mavenLocal() } } plugins { id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.7' } - Run the automated migration while temporarily ignoring the new blowdryer setup with
./gradlew updateBuildscript -Pgtnh.settings.blowdryerTag=MIGRATION-MAGIC - Check the updated files for any obvious mistakes
- Commit
Disabling modules
GTNHGradle uses some hidden properties to disable full modules of the plugin. Not every combination of toggles is supported, but here are a couple useful ones for non-GTNH projects:
# Disable git-based version detection, make sure to set project.version to a sensible value yourself
gtnh.modules.gitVersion = false
# Disable all GTNH code style checks (like Spotless autoformatting, CheckStyle rules, and any future additions)
gtnh.modules.codeStyle = false
# Disables lwjgl3ify-based utilities for working with and running with modern Java versions
gtnh.modules.modernJava = false
Run ./gradlew propertiesHelp to list all the available properties along with their descriptions.
Related Skills
node-connect
349.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
