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) {
extension.getUnmappedModCollection().from(jarTask);
remapJarTask.getAddNestedDependencies().set(true);
remapJarTask.getRemapAccessWidener().set(true);
remapJarTask.getAddNestedDependencies().convention(true);
remapJarTask.getRemapAccessWidener().convention(true);
project.getArtifacts().add("archives", remapJarTask);
}

View File

@ -91,15 +91,16 @@ public class RemapJarTask extends Jar {
public RemapJarTask() {
super();
LoomGradleExtension extension = LoomGradleExtension.get(getProject());
input = getProject().getObjects().fileProperty();
addNestedDependencies = getProject().getObjects().property(Boolean.class);
addDefaultNestedDependencies = getProject().getObjects().property(Boolean.class);
remapAccessWidener = 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
remapAccessWidener.set(false);
addDefaultNestedDependencies.set(true);
addNestedDependencies = getProject().getObjects().property(Boolean.class)
.convention(false);
addDefaultNestedDependencies = getProject().getObjects().property(Boolean.class)
.convention(true);
remapAccessWidener = getProject().getObjects().property(Boolean.class)
.convention(false);
if (!LoomGradleExtension.get(getProject()).getMixin().getUseLegacyMixinAp().get()) {
if (!extension.getMixin().getUseLegacyMixinAp().get()) {
remapOptions.add(b -> b.extension(new MixinExtension()));
}
}

View File

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