Repository navigation
Defining JVM cli launcher exe name based on a variable #208
|
In my JVM project I already have conveyor create a GUI launcher with the default exe name. I now want to add a CLI launcher as well. I would like it that the exe name for the new CLI launcher is based on a variable, for example ${app.fsname}-clie. I am struggling to find out a way of doing this. Reading the documentation it seems like the only option for defining the command name is to set app.jvm.cli to an object with the keys being the launcher name. When I do this and try and use ${app.fsname}-cli in a key value I get an error in conveyor logs and the exe is literally ${app.fsname}-cli (IE. no processing of the variable). I also tried setting exe-name within the object for this named launcher but that does not work and the key from the app.jvm.cli object is used instead. Can you suggest a way of achieving this goal? |
Replies: 4 comments 1 reply
|
You can't in Conveyor 22.3 I'm afraid - the key has to be the literal name. HOCON never substitutes inside a key, and in the object form Conveyor sets each launcher's So it's just: app.jvm.cli {
my-app-cli {
main-class = com.example.MyCli
}
}Launchers are covered here: https://conveyor.hydraulic.dev/22.3.1/configs/jvm/#launchers |
|
Thanks your answer was what I had got from reading the documentation and my own experiments. May be this could be considered as an enhancement in a future version, may be to allow a list of objects for app.jvm.cli so that a launcher can use a variable in a exe-name. |
|
HOCON is simple but does have limits. There is an escape hatch in the form of hashbang includes, so if you wanted you could use a small script to generate config with the right key names and include it automatically. I've looked at Apple's Pkl as a possible enhancement in future. WDYT? |
|
OK, as the application in question is a JVM app and prepared with maven, may be I could get maven to produce a conf snippet for the launcher which could be included by the main config. |
You can't in Conveyor 22.3 I'm afraid - the key has to be the literal name. HOCON never substitutes inside a key, and in the object form Conveyor sets each launcher's
exe-namefrom its key, so one you put in the body gets overwritten. The list form won't take objects either (only class name strings), and it names each exe after its class, socom.example.MyAppClicomes out asmy-app-cli.So it's just:
Launchers are covered here: https://conveyor.hydraulic.dev/22.3.1/configs/jvm/#launchers