Through trial and error, I found a solution that seems to work for configuring desktop settings:
class DesktopApplicationConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
afterEvaluate {
extensions.configure<ComposeExtension> {
this.extensions.configure<DesktopExtension> {
application {
mainClass = "com.app.MainKt"
nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
packageName = "com.app"
packageVersion = "1.0.0"
}
}
}
}
}
}
}
}
What I've observed:
This solution works for my use case, but I haven't found any documentation explaining why this specific structure is necessary. Would appreciate insights from others who understand Gradle plugin development better.