Update checkstyle to prevent using var expect for new instance creation.

This commit is contained in:
modmuss50
2021-09-07 11:55:05 +01:00
parent 5837f95ff8
commit 8da2da8aed
8 changed files with 40 additions and 30 deletions

View File

@@ -139,29 +139,8 @@ public final class CompileConfiguration {
MixinExtension mixin = LoomGradleExtension.get(project).getMixin();
if (!mixin.getUseLegacyMixinAp().get()) {
return;
}
mixin.init();
// 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");
project.getLogger().info("Configuring compiler arguments for Java");
new JavaApInvoker(project).configureMixin();
if (project.getPluginManager().hasPlugin("scala")) {
project.getLogger().info("Configuring compiler arguments for Scala");
new ScalaApInvoker(project).configureMixin();
}
if (project.getPluginManager().hasPlugin("org.jetbrains.kotlin.kapt")) {
project.getLogger().info("Configuring compiler arguments for Kapt plugin");
new KaptApInvoker(project).configureMixin();
if (mixin.getUseLegacyMixinAp().get()) {
setupMixinAp(project, mixin);
}
});
@@ -171,6 +150,29 @@ public final class CompileConfiguration {
}
}
private static void setupMixinAp(Project project, MixinExtension mixin) {
mixin.init();
// 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");
project.getLogger().info("Configuring compiler arguments for Java");
new JavaApInvoker(project).configureMixin();
if (project.getPluginManager().hasPlugin("scala")) {
project.getLogger().info("Configuring compiler arguments for Scala");
new ScalaApInvoker(project).configureMixin();
}
if (project.getPluginManager().hasPlugin("org.jetbrains.kotlin.kapt")) {
project.getLogger().info("Configuring compiler arguments for Kapt plugin");
new KaptApInvoker(project).configureMixin();
}
}
private static void extendsFrom(String a, String b, Project project) {
project.getConfigurations().getByName(a, configuration -> configuration.extendsFrom(project.getConfigurations().getByName(b)));
}