diff options
author | modmuss50 <modmuss50@gmail.com> | 2021-09-07 11:55:05 +0100 |
---|---|---|
committer | modmuss50 <modmuss50@gmail.com> | 2021-09-07 11:55:05 +0100 |
commit | 8da2da8aed75f05caac19c8b9747041bfd249807 (patch) | |
tree | 726226e2f8b3c71b2879b4c212349a18eb7bdcb4 /src/main/java/net/fabricmc/loom/configuration/CompileConfiguration.java | |
parent | 5837f95ff891d085090fc7fc3354c6592c2c16da (diff) | |
download | architectury-loom-8da2da8aed75f05caac19c8b9747041bfd249807.tar.gz architectury-loom-8da2da8aed75f05caac19c8b9747041bfd249807.tar.bz2 architectury-loom-8da2da8aed75f05caac19c8b9747041bfd249807.zip |
Update checkstyle to prevent using var expect for new instance creation.
Diffstat (limited to 'src/main/java/net/fabricmc/loom/configuration/CompileConfiguration.java')
-rw-r--r-- | src/main/java/net/fabricmc/loom/configuration/CompileConfiguration.java | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/src/main/java/net/fabricmc/loom/configuration/CompileConfiguration.java b/src/main/java/net/fabricmc/loom/configuration/CompileConfiguration.java index 81f8bf4c..6fc64390 100644 --- a/src/main/java/net/fabricmc/loom/configuration/CompileConfiguration.java +++ b/src/main/java/net/fabricmc/loom/configuration/CompileConfiguration.java @@ -139,35 +139,37 @@ public final class CompileConfiguration { MixinExtension mixin = LoomGradleExtension.get(project).getMixin(); - if (!mixin.getUseLegacyMixinAp().get()) { - return; + if (mixin.getUseLegacyMixinAp().get()) { + setupMixinAp(project, mixin); } + }); - mixin.init(); + if (p.getPluginManager().hasPlugin("org.jetbrains.kotlin.kapt")) { + // If loom is applied after kapt, then kapt will use the AP arguments too early for loom to pass the arguments we need for mixin. + throw new IllegalArgumentException("fabric-loom must be applied BEFORE kapt in the plugins { } block."); + } + } - // Disable some things used by log4j via the mixin AP that prevent it from being garbage collected - System.setProperty("log4j2.disable.jmx", "true"); - System.setProperty("log4j.shutdownHookEnabled", "false"); - System.setProperty("log4j.skipJansi", "true"); + private static void setupMixinAp(Project project, MixinExtension mixin) { + mixin.init(); - project.getLogger().info("Configuring compiler arguments for Java"); + // Disable some things used by log4j via the mixin AP that prevent it from being garbage collected + System.setProperty("log4j2.disable.jmx", "true"); + System.setProperty("log4j.shutdownHookEnabled", "false"); + System.setProperty("log4j.skipJansi", "true"); - new JavaApInvoker(project).configureMixin(); + project.getLogger().info("Configuring compiler arguments for Java"); - if (project.getPluginManager().hasPlugin("scala")) { - project.getLogger().info("Configuring compiler arguments for Scala"); - new ScalaApInvoker(project).configureMixin(); - } + new JavaApInvoker(project).configureMixin(); - if (project.getPluginManager().hasPlugin("org.jetbrains.kotlin.kapt")) { - project.getLogger().info("Configuring compiler arguments for Kapt plugin"); - new KaptApInvoker(project).configureMixin(); - } - }); + if (project.getPluginManager().hasPlugin("scala")) { + project.getLogger().info("Configuring compiler arguments for Scala"); + new ScalaApInvoker(project).configureMixin(); + } - if (p.getPluginManager().hasPlugin("org.jetbrains.kotlin.kapt")) { - // If loom is applied after kapt, then kapt will use the AP arguments too early for loom to pass the arguments we need for mixin. - throw new IllegalArgumentException("fabric-loom must be applied BEFORE kapt in the plugins { } block."); + if (project.getPluginManager().hasPlugin("org.jetbrains.kotlin.kapt")) { + project.getLogger().info("Configuring compiler arguments for Kapt plugin"); + new KaptApInvoker(project).configureMixin(); } } |