https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
r

Richard Glen

11/08/2023, 11:52 PM
Quick question: how can you configure jvmRun gradle task and specify the main class?
r

Richard Glen

11/09/2023, 12:02 AM
Thanks for your fast reply, but I meant to set the mainclass of jvmRun task, not the compose.desktop. Because a counterpart of what you provided is: 1. applying the application plugin 2. configuring application and set the main class there.
like this. this works.
But I didn’t want to add application plugin. I want to configure the mainclass of jvmRun.
e

ephemient

11/09/2023, 12:06 AM
that isn't using the application plugin, that's using the jvm application extension of the compose multiplatform plugin
it isn't super well documented but that's how it works
p

Pablichjenkov

11/09/2023, 12:08 AM
Interesting, yes isn't too popular, I haven't seen that application dsl before.
r

Richard Glen

11/09/2023, 12:53 AM
Oh. Thanks @ephemient for the additional info. But both solution prompts to add an additional plugin. But not having any of plugin (application or compose), just the multiplatform plugin already adds the jvmRun which tells me the main class is not found/set. Is there a way to configure that?
e

ephemient

11/09/2023, 1:06 AM
ah yes there is
should be called entry point or something like that I think?
r

Richard Glen

11/09/2023, 1:08 AM
Yep. Exactly. I need to set an entrypoint (set main class) thats specific for multiplatform jvm
I didn’t get a clear howto here. but here’s how I did this:
Thanks so much for the response anyway! <3
p

Pablichjenkov

11/09/2023, 5:43 AM
mainRun
did the trick 😳 , interesting 👍🏻
r

Richard Glen

11/09/2023, 5:44 AM
Yeah. Its showing up a warning tho. Its an experimental api. But this works for now. Thanks!
🎉 1
10 Views