Alexey Tsvetkov
1 year ago
committed by
GitHub
8 changed files with 87 additions and 5 deletions
@ -0,0 +1,34 @@
|
||||
import org.jetbrains.compose.desktop.application.dsl.TargetFormat |
||||
|
||||
plugins { |
||||
id "org.jetbrains.kotlin.multiplatform" |
||||
id "com.android.kotlin.multiplatform.library" |
||||
id "org.jetbrains.compose" |
||||
} |
||||
|
||||
repositories { |
||||
jetbrainsCompose() |
||||
google() |
||||
} |
||||
|
||||
kotlin { |
||||
targetHierarchy.default() |
||||
|
||||
androidLibrary { |
||||
namespace = "com.google.samples.apps.diceroller.shared" |
||||
compileSdk = 34 |
||||
} |
||||
|
||||
jvm() |
||||
|
||||
sourceSets { |
||||
getByName("commonMain") { |
||||
dependencies { |
||||
implementation(compose.ui) |
||||
implementation(compose.runtime) |
||||
implementation(compose.foundation) |
||||
implementation(compose.material3) |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1 @@
|
||||
android.useAndroidX = true |
@ -0,0 +1,13 @@
|
||||
pluginManagement { |
||||
plugins { |
||||
id 'org.jetbrains.kotlin.multiplatform' version 'KOTLIN_VERSION_PLACEHOLDER' |
||||
id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER' |
||||
id 'com.android.kotlin.multiplatform.library' version '8.2.0-alpha13' |
||||
} |
||||
repositories { |
||||
mavenLocal() |
||||
gradlePluginPortal() |
||||
google() |
||||
} |
||||
} |
||||
rootProject.name = "mpp" |
@ -0,0 +1,17 @@
|
||||
import androidx.compose.material.Text |
||||
import androidx.compose.material.Button |
||||
import androidx.compose.material.MaterialTheme |
||||
import androidx.compose.runtime.* |
||||
|
||||
@Composable |
||||
fun AppView() { |
||||
var text by remember { mutableStateOf("Hello, World!") } |
||||
|
||||
MaterialTheme { |
||||
Button(onClick = { |
||||
text = "Hello, Multiplatform!" |
||||
}) { |
||||
Text(text) |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue