fix: Support Gradle isolated projects
This commit is contained in:
1 file changed
+5
-5
+5
-5
@@ -17,7 +17,7 @@ abstract class SmcmtkSettingsPlugin : Plugin<Settings> {
|
||||
@get:Inject
|
||||
protected abstract val objectFactory: ObjectFactory
|
||||
|
||||
private val logger = lazy { Logging.getLogger(javaClass) }
|
||||
private val logger by lazy { Logging.getLogger(javaClass) }
|
||||
|
||||
override fun apply(settings: Settings) {
|
||||
val gradleProperties = loadProperties(settings.rootDir.resolve("gradle.properties"))
|
||||
@@ -39,7 +39,7 @@ abstract class SmcmtkSettingsPlugin : Plugin<Settings> {
|
||||
}
|
||||
|
||||
if (fabricLoomModule != null) {
|
||||
logger.value.info("Choosing Fabric Loom $fabricLoomModule")
|
||||
logger.info("Choosing Fabric Loom $fabricLoomModule")
|
||||
}
|
||||
|
||||
settings.pluginManagement.plugins {
|
||||
@@ -58,13 +58,13 @@ abstract class SmcmtkSettingsPlugin : Plugin<Settings> {
|
||||
}
|
||||
}
|
||||
if (fabricLoom == "plain") {
|
||||
settings.gradle.allprojects { project ->
|
||||
settings.gradle.lifecycle.beforeProject { project ->
|
||||
project.extensions.findByType(ExtraPropertiesExtension::class.java)?.apply {
|
||||
// Loom uses the same jar for both plugin variants (plain and remap) and tries to determine
|
||||
// which one is in use by checking the plugin manager.
|
||||
// This doesn't seem to work when using convention plugins, so we're forcing the remapping off here.
|
||||
project.extensions.extraProperties.set("fabric.loom.disableObfuscation", "true")
|
||||
project.extensions.extraProperties.set("fabric.loom.dontRemap", "true")
|
||||
set("fabric.loom.disableObfuscation", "true")
|
||||
set("fabric.loom.dontRemap", "true")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user