Use better gradle conventions, and fix #311 (#503)

* Use better gradle conventions, and fix #311

* Fix checkstyle

* Revert some changes

* Use convention

* Remove set classpath
dev/0.11
shedaniel 2021-09-23 04:59:51 +08:00 committed by GitHub
parent 06e60e5c29
commit be17a02e90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 9 deletions

View File

@ -114,8 +114,8 @@ public class RemapConfiguration {
if (isDefaultRemap) { if (isDefaultRemap) {
extension.getUnmappedModCollection().from(jarTask); extension.getUnmappedModCollection().from(jarTask);
remapJarTask.getAddNestedDependencies().set(true); remapJarTask.getAddNestedDependencies().convention(true);
remapJarTask.getRemapAccessWidener().set(true); remapJarTask.getRemapAccessWidener().convention(true);
project.getArtifacts().add("archives", remapJarTask); project.getArtifacts().add("archives", remapJarTask);
} }

View File

@ -91,15 +91,16 @@ public class RemapJarTask extends Jar {
public RemapJarTask() { public RemapJarTask() {
super(); super();
LoomGradleExtension extension = LoomGradleExtension.get(getProject());
input = getProject().getObjects().fileProperty(); input = getProject().getObjects().fileProperty();
addNestedDependencies = getProject().getObjects().property(Boolean.class); addNestedDependencies = getProject().getObjects().property(Boolean.class)
addDefaultNestedDependencies = getProject().getObjects().property(Boolean.class); .convention(false);
remapAccessWidener = getProject().getObjects().property(Boolean.class); addDefaultNestedDependencies = getProject().getObjects().property(Boolean.class)
// false by default, I have no idea why I have to do it for this property and not the other one .convention(true);
remapAccessWidener.set(false); remapAccessWidener = getProject().getObjects().property(Boolean.class)
addDefaultNestedDependencies.set(true); .convention(false);
if (!LoomGradleExtension.get(getProject()).getMixin().getUseLegacyMixinAp().get()) { if (!extension.getMixin().getUseLegacyMixinAp().get()) {
remapOptions.add(b -> b.extension(new MixinExtension())); remapOptions.add(b -> b.extension(new MixinExtension()));
} }
} }

View File

@ -34,5 +34,6 @@ public class RunClientTask extends AbstractRunTask {
LoomGradleExtension extension = LoomGradleExtension.get(project); LoomGradleExtension extension = LoomGradleExtension.get(project);
return RunConfig.runConfig(project, extension.getRunConfigs().getByName("client")); return RunConfig.runConfig(project, extension.getRunConfigs().getByName("client"));
}); });
LoomGradleExtension.get(getProject()).getDeprecationHelper().replaceWithInLoom0_11("RunClientTask", "RunGameTask");
} }
} }

View File

@ -34,5 +34,6 @@ public class RunServerTask extends AbstractRunTask {
LoomGradleExtension extension = LoomGradleExtension.get(project); LoomGradleExtension extension = LoomGradleExtension.get(project);
return RunConfig.runConfig(project, extension.getRunConfigs().getByName("client")); return RunConfig.runConfig(project, extension.getRunConfigs().getByName("client"));
}); });
LoomGradleExtension.get(getProject()).getDeprecationHelper().replaceWithInLoom0_11("RunServerTask", "RunGameTask");
} }
} }