parcl
parcl copied to clipboard
Usage with Kotlin DSL
How can I configure this plugin using the Kotlin DSL? using configure<Exe>
does not work.
You can use it much in the same way as the Groovy configurations by using the declarative plugins block:
build.gradle.kts
plugins {
id("java")
id("application")
id("org.mini2Dx.parcl") version "1.7.1"
}
parcl {
exe {
exeName = "myapplication"
}
app {
appName = "My Application"
icon = "relative/path/to/icon.icns"
applicationCategory = "public.app-category.adventure-games"
displayName = "My Application"
identifier = "com.example.my.apple.identifier"
copyright = "Copyright 2015 Your Name Here"
}
linux {
binName = "myapplication"
}
}
However, some extra setup is required since otherwise gradle infers the name as org.mini2Dx.parcl.gradle.plugin
. This can be done by adding a resolution strategy in settings.gradle.kts
, such as below:
settings.gradle.kts
pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
}
resolutionStrategy {
eachPlugin {
if (requested.id.namespace == "org.mini2Dx") {
useModule("org.mini2Dx:parcl:" + requested.version)
}
}
}
}