From db99c88865b34e36272546d3ad90703c4cacdf17 Mon Sep 17 00:00:00 2001
From: modmuss <modmuss50@gmail.com>
Date: Sun, 13 Aug 2023 16:01:17 +0100
Subject: [PATCH] Make deprecated modules opt-out instead of opt-in (#3246)

* Make deprecated modules opt-out instead of opt-in

* Add comment

* Update build.gradle

Co-authored-by: Juuz <6596629+Juuxel@users.noreply.github.com>

---------

Co-authored-by: Juuz <6596629+Juuxel@users.noreply.github.com>
---
 build.gradle | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/build.gradle b/build.gradle
index af11a7483..726e500cd 100644
--- a/build.gradle
+++ b/build.gradle
@@ -652,7 +652,7 @@ publishing {
 			pom.withXml {
 				def depsNode = asNode().appendNode("dependencies")
 				subprojects.each {
-					// Dont depend on the deprecated modules in the main artifact.
+					// The maven BOM containing all of the deprecated modules is added manually below.
 					if (it.path.startsWith(":deprecated")) {
 						return
 					}
@@ -663,6 +663,13 @@ publishing {
 					depNode.appendNode("version", it.version)
 					depNode.appendNode("scope", "compile")
 				}
+
+				// Depend on the deprecated BOM to allow opting out of deprecated modules.
+				def depNode = depsNode.appendNode("dependency")
+				depNode.appendNode("groupId", group)
+				depNode.appendNode("artifactId", "fabric-api-deprecated")
+				depNode.appendNode("version", version)
+				depNode.appendNode("scope", "compile")
 			}
 		}
 	}