Nikolay Igotti
3 years ago
5 changed files with 86 additions and 1 deletions
@ -0,0 +1,29 @@
|
||||
import org.jetbrains.compose.compose |
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile |
||||
|
||||
plugins { |
||||
kotlin("multiplatform") |
||||
id("org.jetbrains.compose") |
||||
} |
||||
|
||||
kotlin { |
||||
jvm {} |
||||
sourceSets { |
||||
named("jvmMain") { |
||||
dependencies { |
||||
implementation(compose.desktop.currentOs) |
||||
implementation(project(":App:library")) |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
compose.desktop { |
||||
application { |
||||
mainClass = "org.jetbrains.compose.app.demo.MainKt" |
||||
} |
||||
} |
||||
|
||||
tasks.withType<KotlinCompile>().configureEach { |
||||
kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" |
||||
} |
@ -0,0 +1,10 @@
|
||||
package org.jetbrains.compose.app.demo |
||||
|
||||
import androidx.compose.material.Text |
||||
import org.jetbrains.compose.app.application |
||||
|
||||
fun main() = application( |
||||
title = "App demo" |
||||
) { |
||||
Text("Hi") |
||||
} |
@ -0,0 +1,33 @@
|
||||
import org.jetbrains.compose.compose |
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile |
||||
|
||||
plugins { |
||||
kotlin("multiplatform") |
||||
id("org.jetbrains.compose") |
||||
id("maven-publish") |
||||
} |
||||
|
||||
kotlin { |
||||
jvm("desktop") |
||||
|
||||
sourceSets { |
||||
named("commonMain") { |
||||
dependencies { |
||||
api(compose.runtime) |
||||
api(compose.foundation) |
||||
api(compose.material) |
||||
} |
||||
} |
||||
named("desktopMain") {} |
||||
} |
||||
} |
||||
|
||||
tasks.withType<KotlinCompile>().configureEach { |
||||
kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" |
||||
} |
||||
|
||||
configureMavenPublication( |
||||
groupId = "org.jetbrains.compose.components", |
||||
artifactId = "components-app", |
||||
name = "App API for Compose Multiplatform" |
||||
) |
@ -0,0 +1,10 @@
|
||||
package org.jetbrains.compose.app |
||||
|
||||
import androidx.compose.runtime.Composable |
||||
import androidx.compose.ui.window.singleWindowApplication |
||||
|
||||
fun application(name: String = "application", title: String = "Compose Application", body: @Composable () -> Unit) { |
||||
singleWindowApplication { |
||||
body() |
||||
} |
||||
} |
Loading…
Reference in new issue