I know this might be a bit late, but for anyone who seeks an answer to this question in 2022, the official guide shows how to configure plugins via extensions. Also, just for the sake of completeness, the guide recommends not to enforce the usage of certain plugins but instead to reactively configure them when they are available.
So today, the solution to your problem might either look like this (sorry for using Java code, although the code should be mappable to Kotlin straightforwardly):
// enforcing the Java plugin
project.getPluginManager().apply(JavaPlugin.class);
JavaPluginExtension javaPluginExtension = project.getExtensions().getByType(JavaPluginExtension.class);
javaPluginExtension.setSourceCompatibility(JavaVersion.VERSION_1_10);
javaPluginExtension.setTargetCompatibility(JavaVersion.VERSION_1_10);
or like this:
// reactively configuring the Java plugin
project.getPlugins().withType(JavaPlugin.class, javaPlugin -> {
JavaPluginExtension javaPluginExtension = project.getExtensions().getByType(JavaPluginExtension.class);
javaPluginExtension.setSourceCompatibility(JavaVersion.VERSION_1_10);
javaPluginExtension.setTargetCompatibility(JavaVersion.VERSION_1_10);
});