and other plugins to use to customize how the plugin works. Plugins do this using extension objects.” “An extension object is simply an object with Java Bean properties that represent the configuration.” https://docs.gradle.org/current/userguide/custom_plugins.html#sec:getting_input_from_the_build
you're really doing is project.extensions.getByName("kotlin").apply { this as KotlinJvmProjectExtension explicitApi() } // Because Gradle generated an accessor: fun org.gradle.api.Project.`kotlin`(configure: Action<org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension>): Unit = (this as org.gradle.api.plugins.ExtensionAware).extensions.configure("kotlin", configure)
Or use 'the' the<KotlinJvmProjectExtension>().apply { explicitApi() } // Even in imperative style, without lambda the<KotlinJvmProjectExtension>().explicitApi() // It all works!
dependencies” “Configuration is an instance of a FileCollection that contains all dependencies but not artifacts” “configurations have at least 3 different roles: - to declare dependencies - as a consumer, to resolve a set of dependencies to files - as a producer, to expose artifacts and their dependencies” https://docs.gradle.org/current/dsl/org.gradle.api.artifacts.Configuration.html
come the task is in 'this' and not 'it' ?? kotlinOptions { apiVersion = "1.3" } } // configure takes an Action public interface Action<T> { void execute(T t); }