CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/maven-org-jetbrains-compose-desktop--desktop-jvm

Compose Multiplatform Desktop JVM support library for building cross-platform desktop applications with declarative UI framework based on Jetpack Compose

Pending
Overview
Eval results
Files

gradle-plugin.mddocs/

Gradle Plugin Configuration

The Compose Multiplatform Gradle plugin provides the core functionality for configuring Compose projects and managing dependencies.

Plugin Application

abstract class ComposePlugin : Plugin<Project> {
    override fun apply(project: Project)
}

Apply the plugin in your build.gradle.kts:

plugins {
    id("org.jetbrains.compose") version "1.8.2"
}

Compose Extension

abstract class ComposeExtension @Inject constructor(
    objects: ObjectFactory,
    project: Project
) : ExtensionAware {
    @Deprecated("Since Kotlin 2.2.0 Compose Compiler configuration is moved to the \"org.jetbrains.kotlin.plugin.compose\" plugin")
    val kotlinCompilerPlugin: Property<String?>
    
    @Deprecated("Since Kotlin 2.2.0 Compose Compiler configuration is moved to the \"org.jetbrains.kotlin.plugin.compose\" plugin")
    val kotlinCompilerPluginArgs: ListProperty<String>
    
    @Deprecated("Since Kotlin 2.2.0 Compose Compiler configuration is moved to the \"org.jetbrains.kotlin.plugin.compose\" plugin")
    val platformTypes: SetProperty<KotlinPlatformType>
    
    val dependencies: ComposePlugin.Dependencies
}

The extension is available as compose in your build script:

compose {
    // Configuration options
}

Dependencies API

class Dependencies(project: Project) {
    val desktop: DesktopDependencies
    val animation: String
    val animationGraphics: String
    val foundation: String
    val material: String
    val material3: String
    val material3AdaptiveNavigationSuite: String
    val runtime: String
    val runtimeSaveable: String
    val ui: String
    val uiTooling: String
    val uiUtil: String
    val preview: String
    val materialIconsExtended: String
    val components: CommonComponentsDependencies
    val html: HtmlDependencies
    
    @Deprecated("Use desktop.uiTestJUnit4")
    @ExperimentalComposeLibrary
    val uiTestJUnit4: String
    
    @ExperimentalComposeLibrary
    val uiTest: String
    
    @Deprecated("Use compose.html")
    val web: WebDependencies
    
    fun BOM(version: String = ""): String
}

Desktop Dependencies

object DesktopDependencies {
    val components: DesktopComponentsDependencies
    val common: String
    val linux_x64: String
    val linux_arm64: String
    val windows_x64: String
    val windows_arm64: String
    val macos_x64: String
    val macos_arm64: String
    val uiTestJUnit4: String
    val currentOs: String
}

Common Components Dependencies

object CommonComponentsDependencies {
    val resources: String
    val uiToolingPreview: String
}

Desktop Components Dependencies

object DesktopComponentsDependencies {
    @ExperimentalComposeLibrary
    val splitPane: String
    
    @ExperimentalComposeLibrary
    val animatedImage: String
}

HTML Dependencies

object HtmlDependencies {
    val core: String
    val svg: String
    val testUtils: String
}

Web Dependencies (Deprecated)

@Deprecated("Use compose.html")
object WebDependencies {
    val core: String
    val svg: String  
    val testUtils: String
}

Usage Examples

Basic Dependency Configuration

dependencies {
    implementation(compose.desktop.currentOs)
    implementation(compose.material3)
    implementation(compose.ui)
    implementation(compose.uiTooling)
    
    // Desktop-specific components
    implementation(compose.desktop.components.splitPane)
    implementation(compose.desktop.components.animatedImage)
    
    // Testing
    testImplementation(compose.desktop.uiTestJUnit4)
}

Platform-Specific Dependencies

dependencies {
    // Target specific platforms
    implementation(compose.desktop.linux_x64)
    implementation(compose.desktop.windows_x64)
    implementation(compose.desktop.macos_arm64)
    
    // Or use current OS
    implementation(compose.desktop.currentOs)
}

Repository Configuration

fun RepositoryHandler.jetbrainsCompose(): MavenArtifactRepository

Add the JetBrains Compose repository:

repositories {
    jetbrainsCompose()
    mavenCentral()
}

Helper Functions

fun KotlinDependencyHandler.compose(groupWithArtifact: String): String
fun DependencyHandler.compose(groupWithArtifact: String): String

These functions create dependency strings with the current Compose version:

dependencies {
    implementation(compose("org.jetbrains.compose.material3:material3"))
}

Install with Tessl CLI

npx tessl i tessl/maven-org-jetbrains-compose-desktop--desktop-jvm

docs

desktop-application.md

desktop-components.md

gradle-plugin.md

index.md

resource-management.md

ui-tooling.md

tile.json