TheBoegl / gradle-launch4j

A gradle-plugin to create windows executables with launch4j
Apache License 2.0
308 stars 42 forks source link

Help needed to convert old way of handling generic conf for launch4J with 3.0.X #175

Open serge-xav opened 1 month ago

serge-xav commented 1 month ago

Hi, I'm trying to upgrade the plugin from 2.5 to 3.0 in our gradle/kotlin project, but I have issues with the way the shared conf is handled in our project.

Previously we add it configured this way : a val with the conf, common to all .exe we have in our different subprojects :

val confL4J = { l4jItem: Launch4jPluginExtension, fromProject: Project ->
    l4jItem.dontWrapJar = true
    l4jItem.headerType = "gui"
    l4jItem.errTitle = ""
 //.........................
    l4jItem.outputDir = rootProject.property("launch4jBuildDir").toString()

    l4jItem.outfile = fromProject.property("distributionName").toString().replace("-Client", "") + ".exe"
    l4jItem.jar = fromProject.property("archiveBaseName").toString() + ".jar"
    l4jItem.mainClassName = fromProject.property("main-class").toString()
}

and then the task definition :

launch4j {
    confL4J(this, project)
}

This is not working anymore from plugin version 3.0.0, I get multiple errors similar to : The boolean literal does not conform to the expected type Property<Boolean!>! As I'm not a gradle/kotlin/groovy specialist, I need help how the same could be achieved Thanks in advance for your help

TheBoegl commented 1 month ago

With version 3 we are using properties: so you should try to set them and avoid the toString on the ones shown and map them instead.