Remove main class configuration fallback

Remove fallback code since we now require Gradle 6.8 and can depend
on the `getMainClass` method being present.

Closes gh-26794
pull/26861/head
Phillip Webb 3 years ago
parent b7ac1e6cd7
commit 703eaa71f4

@ -151,14 +151,7 @@ final class JavaPluginAction implements PluginApplicationAction {
}
return Collections.emptyList();
});
try {
run.getMainClass().convention(resolveProvider.flatMap(ResolveMainClassName::readMainClassName));
}
catch (NoSuchMethodError ex) {
run.getInputs().file(resolveProvider.map((task) -> task.getOutputFile()));
run.conventionMapping("main",
() -> resolveProvider.flatMap(ResolveMainClassName::readMainClassName).get());
}
configureToolchainConvention(project, run);
});
}

Loading…
Cancel
Save