Hi. Strange question perhaps, but is Compose also...
# multiplatform
d
Hi. Strange question perhaps, but is Compose also suitable for non-multiplatform projects ? In particular, regular desktop jvm projects (in IntelliJ)?
d
Yes
d
That is good to know. Thank you . I guess this would be a good starting point ? https://github.com/JetBrains/compose-multiplatform-desktop-template
đŸ‘đŸŒ 1
j
Yes, and #C01D6HTPATV
☝ 1
👍 1
s
For desktop apps which really benefit from a UI, Compose is a great choice. But if you think you’re going to get by with a CLI-interface, check out Clikt: https://github.com/ajalt/clikt
d
That is good to know. Thank you .
I guess this would be a good starting point ? https://github.com/JetBrains/compose-multiplatform-desktop-template
I would create a desktop only project with https://kmp.jetbrains.com/ and use the template for further guidance
d
I was thinking about that, but it seemed like a bit of overkill for a small project. Also, a lot of the docs were geared to Android Studio, and I wanted to use it in Intellij, which apparently is possible it seems 👍 And I had hoped if I could avoid Gradle, but that doesn't seem to be the case
j
You can really just start with a
fun main
and one or two dependencies. You don't really need much.
If you don't want to use Gradle just grab the
-jvm
variant of each dependency
The dependency graph is kinda big, but not unmanageable. Use a dependency resolver regardless of your build system
s
Out of curiosity but why wouldn’t you want to use Gradle though? Especially given you’re not very familiar with the framework it feels like shooting yourself in the foot ahead of the race.
d
The build framework should not be of influence with regards on how well I do or do not know the library. But Compose requires Gradle, so I use Gradle. I actually wanted to avoid the KMP setup until I got familiarized with Compose and another technology I am trying out. I don't want to try too many new things at the same time in a single project. Especially with this impact. The reason why I like to avoid Gradle? Because I believe it is atrocious. But this is not the place to vent about that.
@jw I figured that since they have a specific Gradle Compose plugin I was more or less condemned to Gradle .... I will check it out, thank you
d
Arguably, CMP is currently more suitable for a single platform, given how broken the
@Preview
feature is in true Multiplatform configurations, with no sign of improving for over a year, and no information about when it might...
đŸ€” 1
➕ 1
j
You can put the Compose compiler plugin into the kotlinc pluginpath manually. It works just like a regular classpath
m
I am wondering why nobody mentions Amper and the related IntelliJ plugin in this context.
d
Its still experimental
m
Trying to get around Gradle for any serious Compose work is more than “experimental” anyway.
d
Don't get me started @Michael Paus! Having a very jaded day today wrt CMP Preview... It strikes me this very important feature could have been working in IntelliJ months ago if it weren't for JB pouring all efforts into Fleet. Users are left in a 'dead zone' right now where things don't work and there's very little info. Fleet is sucking the life out of the ecosystem - it had better be worth it 😞
👍 1
d
@Michael Paus Am I understanding correctly that Amper is another build tool ?
(and, I am not trying to force having to use it without Gradle, but if it is possible it is nice. It seems however that Compose is not playing nice without gradle for me . So gradle it will be... unless Amper is a viable alternative.? )
d
Its another build tool
d
Ok, I'm interested 😛 How does it compare to Maven/Gradle ?