What's the easiest way to use jewel in a standalon...
# jewel
c
What's the easiest way to use jewel in a standalone desktop app? Two things I tried: 1. I downloaded a new desktop sample from kmp.jetbrains.com, and tried to painstakenly follow the docs and samples to add jewel but I seem to not be able to get the right gradle magic to bring in jewel into the standalone app. 2. i tried the route of cloning the jewel repo from github and running the sample standalone app works great... but now I want to use this as my "base" for my project but now I have to rip out a bunch of other stuff (like 8 modules and a buildsrc) in order to just have a plain ol' desktop app without having a bunch of extra stuff. there has to be a better way. no? (maybe im missing something obvious) really wish there was just like a repo that was kmp.jetbrains.com desktop app w/jewel. 馃檹
c
It should be pretty straightforward. Just did it last week with a new project from kmp.jetbrains.com
u
in your
settings.graddle.kts
Copy code
dependencyResolutionManagement {
    repositories {
       ...
       //I don't remember which one exactly, one of the three
        maven("<https://packages.jetbrains.team/maven/p/kpm/public/>")
        maven("<https://www.jetbrains.com/intellij-repository/releases>")
        maven("<https://www.jetbrains.com/intellij-repository/snapshots>")
    }
}
in your
libs.versions.toml
Copy code
[versions]
jewel = "0.27.0"
jewel-icons = "<tel:243.24978.46|243.24978.46>"

[libraries]
jewel = { group = "org.jetbrains.jewel", name = "jewel-int-ui-standalone-242", version.ref = "jewel" }
jewel-decorated = { group = "org.jetbrains.jewel", name = "jewel-int-ui-decorated-window-242", version.ref = "jewel" }
jewel-markdown-core = { group = "org.jetbrains.jewel", name = "jewel-markdown-core-242", version.ref = "jewel" }
jewel-markdown-intUiStandaloneStyling = { group = "org.jetbrains.jewel", name = "jewel-markdown-int-ui-standalone-styling-242", version.ref = "jewel" }
jewel-markdown-extension-autolink = { group =  "org.jetbrains.jewel", name ="jewel-markdown-extension-autolink-242", version.ref = "jewel"}
jewel-markdown-extension-gfmalerts = { group =  "org.jetbrains.jewel", name ="jewel-markdown-extension-gfm-alerts-242", version.ref = "jewel"}
jewel-foundation = { group =  "org.jetbrains.jewel", name ="jewel-foundation-242", version.ref = "jewel"}
jewel-icons = { module = "com.jetbrains.intellij.platform:icons", version.ref = "jewel-icons" }
in your
build.gradle.kts
Copy code
val desktopMain by getting {
            dependsOn(commonMain.get())
            dependencies {
                implementation(compose.desktop.currentOs) {
                    exclude(group = "org.jetbrains.compose.material")
                }
   

                //Jewel
                implementation(libs.jewel)
                implementation(libs.jewel.decorated)
                implementation(libs.jewel.foundation)
               //Add what your needs here (markdown, ...)
            }
        }
c
It should be pretty straightforward. Just did it last week with a new project from kmp.jetbrains.com
then i am apparently an idiot. lol. wasted like 3 hours trying to get it to run. no dice. @讗诇讬讛讜 讛讚住 let me try that. if it works... that'd be incredible
dependsOn
advice on dependOn not being available?
u
Ok it's nice, it was on my gradle config
c
okay. ill remove it
c
In case it helps, I鈥檓 using Jewel standalone in this small tool I just built, so you can see how Gradle is configured there: https://github.com/c5inco/Mesh/blob/main/composeApp/build.gradle.kts and https://github.com/c5inco/Mesh/blob/main/settings.gradle.kts