- Download a new project from https://kmp.jetbrains.com/ and be sure to select a desktop application
- In your app level build.gradle add
id("dev.hydraulic.conveyor") version "1.12"
You may want to include it in your root build.gradle with apply false
if you get any issues in the future as per: https://programminghard.dev/gradle-plugins-best-practices/
- In app level build.gradle.kts add (this does not go into any block. just goes at the top level of this file)
version = "1.0"
This is needed even though a version is already declared in the nativeDistributions
block.
- In app build.gradle.kts under
jvm("desktop")
add
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(21))
vendor.set(JvmVendorSpec.JETBRAINS)
}
- In app build.gradle.kts at the top level add a
dependencies
block (it most likely wont be there unless you're building an android app). You will already have 2 otherdependencies
blocks most likely, but those are nested inside of thekotlin
andsourceSets
blocks. This one is needed at the top level.
dependencies {
debugImplementation(compose.uiTooling) <=== This will only be here if you are building an android app
// Use the configurations created by the Conveyor plugin to tell Gradle/Conveyor where to find the artifacts for each platform.
linuxAmd64(compose.desktop.linux_x64)
macAmd64(compose.desktop.macos_x64)
macAarch64(compose.desktop.macos_arm64)
windowsAmd64(compose.desktop.windows_x64)
}
- In app level build.gradle.kts you will find
nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
packageName = "org.example.project"
packageVersion = "1.0.0"
}
}
}
but for some reason conveyor doesn't work with package names that are reverse dns. Replace that with packageName = "example-project"
- In app level build.gradle.kts at the top level you can add
// Work around temporary Compose bugs.
configurations.all {
attributes {
// https://github.com/JetBrains/compose-jb/issues/1404#issuecomment-1146894731
attribute(Attribute.of("ui", String::class.java), "awt")
}
}
- In settings.gradle.kts you can add
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version("0.8.0")
}
This has to be declared after your plugin dependency block.
- Add a minimal conveyor.conf file
include "#!./gradlew -q printConveyorConfig"
app {
display-name = My Amazing Project
site.base-url = localhost/some/path
}
conveyor.compatibility-level = 17
See: https://conveyor.hydraulic.dev/17.0/configs/ for more configuration
- Run
./gradlew desktopJar
(Conveyor doesn't trigger your build for you yet so you still need to run this) - Run
conveyor make site
- When you make an update to your desktop app, update the version number we declared earlier, run
./gradlew desktopJar
, and thenconveyor make site --overwrite
ππππππππππππππππππππππππππππππππππππ
Note: You may want to call ./gradlew proguardReleaseJars
instead of desktopJar
, but you need to setup proguard. I have not done this yet, but I will link it here if I figure out how to do that.
Top comments (0)