From 18ca0eb41de6b0818dea94dd088969e79feef1cd Mon Sep 17 00:00:00 2001 From: bigguy345 Date: Sun, 15 Mar 2026 13:17:21 +0200 Subject: [PATCH] NECESSARY GRADLE CHANGES FOR MULTI GTNH GRADLE SUBMODULE FUNCTIONALITY --- build.gradle | 38 +++++++++----------------------------- settings.gradle | 31 +++++++++++++++++++++---------- 2 files changed, 30 insertions(+), 39 deletions(-) diff --git a/build.gradle b/build.gradle index 55b4afafd..b3597ec13 100644 --- a/build.gradle +++ b/build.gradle @@ -1,33 +1,13 @@ -// ============================================================================ -// CustomNPC-Plus — Root Project (Multi-Version Coordinator) -// ============================================================================ -// -// This root project is a lightweight coordinator for the multi-version build. -// It does NOT apply the GTNH convention plugin or RetroFuturaGradle directly. -// The GTNH settings convention plugin (applied in settings.gradle) requires -// buildscript repositories to be available for plugin resolution. -// -// Subprojects: -// :platform-api — MC-free interfaces (plain Java 8 library) -// :core — MC-free game logic (plain Java 8 library, depends on platform-api) -// :mc1710 — Minecraft 1.7.10 Forge mod (GTNH convention + RFG, depends on core) -// -// Build commands: -// ./gradlew build — Build all modules -// ./gradlew :mc1710:build — Build only the MC 1.7.10 module -// ./gradlew :mc1710:runClient — Run the MC 1.7.10 client -// ./gradlew :mc1710:runServer — Run the MC 1.7.10 server -// ============================================================================ +// CustomNPC-Plus — Root Project (Multi-Version Aggregator) +// Plain Gradle project that aggregates submodules. +// Each submodule (mc1710, mc1122, etc.) handles its own configuration. -buildscript { - repositories { - maven { - name "GTNH Maven" - url "https://nexus.gtnewhorizons.com/repository/public/" - } - gradlePluginPortal() - mavenCentral() - } +// IntelliJ IDEA triggers 'processIdeaSettings' on the root project during Gradle sync. +// The GTNH convention plugin only registers this task on subprojects that apply it, +// so we register a no-op task here to prevent "task not found" errors. +tasks.register('processIdeaSettings') { + group = 'ide' + description = 'No-op task for IntelliJ IDEA Gradle sync compatibility' } // IDEA plugin at root level is required for GTNH convention's IdeIntegrationModule diff --git a/settings.gradle b/settings.gradle index b273334e1..984c6153f 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,12 +1,11 @@ pluginManagement { -// resolutionStrategy { -// eachPlugin { -// if(requested.id.toString() == "dts.typescript-generator") { -// useModule("com.github.bigguy345:dts-gradle-plugin:95b8ab4") -// } -// } -// } -// + // Default plugin versions so submodules can use 'id' without specifying version. + // The gtnhconvention plugin (and its bundled RetroFuturaGradle) is resolved here once + // so all submodules share the same classloader — required by Gradle build services. + plugins { + id 'com.gtnewhorizons.gtnhconvention' version '1.0.27' + } + repositories { maven { url "https://jitpack.io"} maven { @@ -24,8 +23,20 @@ pluginManagement { } } -plugins { - id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.27' +// Load the GTNH convention plugin into the settings classloader so all submodules +// share the same RetroFuturaGradle classes (required for Gradle build services). +buildscript { + repositories { + maven { + name "GTNH Maven" + url "https://nexus.gtnewhorizons.com/repository/public/" + } + gradlePluginPortal() + mavenCentral() + } + dependencies { + classpath 'com.gtnewhorizons:gtnhgradle:1.0.27' + } } // Include the local gradle-plugins composite build so plugin is resolved locally