The getMainClass() method was introduced in Gradle 6.4. As we now require Gradle 6.8, we no longer need the fallback for when the method's missing.