Use conventions in RemapConfiguration to avoid need for afterEvaluate. (#514)

This commit is contained in:
NinjaPhenix 2021-10-04 21:37:48 +01:00 committed by GitHub
parent ce0a3308ff
commit e55763aca2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -107,9 +107,9 @@ public class RemapConfiguration {
assert remapJarTask != null;
if (!remapJarTask.getInput().isPresent() && isDefaultRemap) {
jarTask.setClassifier("dev");
remapJarTask.setClassifier("");
remapJarTask.getInput().set(jarTask.getArchivePath());
jarTask.getArchiveClassifier().convention("dev");
remapJarTask.getArchiveClassifier().convention("");
remapJarTask.getInput().convention(jarTask.getArchiveFile());
}
if (isDefaultRemap) {
@ -177,8 +177,8 @@ public class RemapConfiguration {
RemapSourcesJarTask remapSourcesJarTask = (RemapSourcesJarTask) project.getTasks().findByName(remapSourcesJarTaskName);
Preconditions.checkNotNull(remapSourcesJarTask, "Could not find " + remapSourcesJarTaskName + " in " + project.getName());
remapSourcesJarTask.getInput().set(sourcesTask.getArchiveFile());
remapSourcesJarTask.getOutput().set(sourcesTask.getArchiveFile());
remapSourcesJarTask.getInput().convention(sourcesTask.getArchiveFile());
remapSourcesJarTask.getOutput().convention(sourcesTask.getArchiveFile());
remapSourcesJarTask.dependsOn(project.getTasks().getByName(sourcesJarTaskName));
if (isDefaultRemap) {