What's the recommended way to create a binary plug...
# gradle
c
What's the recommended way to create a binary plugin written in Kotlin nowadays? I'm using
kotlin-dsl
and I'm getting errors of unsupported Kotlin version. It recommends using
kotlin("jvm")
for binary plugins, so I thought of combining it with
java-gradle-plugin
but the experience is very poor. There are no receivers anymore so all calls need an explicit parameter, eg:
Copy code
target.extensions.configure(JavaPluginExtension::class.java) { javaExt ->
	javaExt.withSourcesJar()

	javaExt.toolchain { toolchain ->
		toolchain.languageVersion.set(JavaLanguageVersion.of(javaCompatibility))
	}
}
Also, I'm getting a ton of overloading resolution errors anytime there is
Action
argument. I assume there's some simple setting that everyone is using? Or is everyone using
kotlin-dsl
?
You can configure the
sam-with-receiver
plugin on top of KGP if you really want to (example here)
kotlin-dsl
is a very bad default