Alexey Tsvetkov
2 years ago
6 changed files with 37 additions and 88 deletions
@ -1,34 +0,0 @@ |
|||||||
import org.jetbrains.compose.desktop.application.dsl.TargetFormat |
|
||||||
|
|
||||||
plugins { |
|
||||||
id "org.jetbrains.kotlin.jvm" |
|
||||||
id "org.jetbrains.compose" |
|
||||||
} |
|
||||||
|
|
||||||
repositories { |
|
||||||
jetbrainsCompose() |
|
||||||
} |
|
||||||
|
|
||||||
dependencies { |
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib" |
|
||||||
implementation compose.desktop.currentOs |
|
||||||
} |
|
||||||
|
|
||||||
compose.desktop { |
|
||||||
application { |
|
||||||
mainClass = "MainKt" |
|
||||||
nativeDistributions { |
|
||||||
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb) |
|
||||||
|
|
||||||
packageVersion = "1.0.0" |
|
||||||
packageName = "TestPackage" |
|
||||||
description = "Test description" |
|
||||||
copyright = "Test Copyright Holder" |
|
||||||
vendor = "Test Vendor" |
|
||||||
|
|
||||||
javaHome = javaToolchains.launcherFor { |
|
||||||
languageVersion.set(JavaLanguageVersion.of(CUSTOM_JAVA_TOOLCHAIN_VERSION_PLACEHOLDER)) |
|
||||||
}.get().metadata.installationPath.asFile.absolutePath |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
@ -1,11 +0,0 @@ |
|||||||
pluginManagement { |
|
||||||
plugins { |
|
||||||
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER' |
|
||||||
id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER' |
|
||||||
} |
|
||||||
repositories { |
|
||||||
mavenLocal() |
|
||||||
gradlePluginPortal() |
|
||||||
} |
|
||||||
} |
|
||||||
rootProject.name = "simple" |
|
@ -1,18 +0,0 @@ |
|||||||
import androidx.compose.material.Text |
|
||||||
import androidx.compose.material.Button |
|
||||||
import androidx.compose.material.MaterialTheme |
|
||||||
import androidx.compose.ui.window.singleWindowApplication |
|
||||||
import androidx.compose.runtime.* |
|
||||||
|
|
||||||
fun main() = singleWindowApplication { |
|
||||||
val scope = rememberCoroutineScope() |
|
||||||
var text by remember { mutableStateOf("Hello, World!") } |
|
||||||
|
|
||||||
MaterialTheme { |
|
||||||
Button(onClick = { |
|
||||||
text = "Hello, Desktop!" |
|
||||||
}) { |
|
||||||
Text(text) |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
Loading…
Reference in new issue