bodo
11/02/2020, 9:57 AMclass MyPlugin : Plugin<Project> {
fun apply(project: Project) {
project.addImport("import com.foo.Foo") // i need the command for this
}
}
so when i use it build.gradle i can directly access it
import com.foo.Foo // i want to get rid of this import
plugins {
id("MyPlugin")
}
dependencies {
// use Foo here directly without the need to add the import on top of every build.gradle.kts file when adding the "MyPlugin" plugin
}
kenkyee
11/02/2020, 12:25 PMbodo
11/02/2020, 1:48 PMNico
11/03/2020, 9:10 AMNico
11/03/2020, 9:10 AMfun myPluginConfig(config: Action<in Foo>) {...}
// in pure Kotlin this is:
fun myPluginConfig(config: Foo.() -> Unit) {...}
Nico
11/03/2020, 9:11 AMFoo
at the top level, so it is not part of any package and does not need any importsbodo
11/03/2020, 2:43 PM