|
|
@ -1,4 +1,4 @@ |
|
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile |
|
|
|
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi |
|
|
|
|
|
|
|
|
|
|
|
plugins { |
|
|
|
plugins { |
|
|
|
kotlin("multiplatform") |
|
|
|
kotlin("multiplatform") |
|
|
@ -10,42 +10,68 @@ plugins { |
|
|
|
val composeVersion = extra["compose.version"] as String |
|
|
|
val composeVersion = extra["compose.version"] as String |
|
|
|
|
|
|
|
|
|
|
|
kotlin { |
|
|
|
kotlin { |
|
|
|
|
|
|
|
@OptIn(ExperimentalKotlinGradlePluginApi::class) |
|
|
|
|
|
|
|
targetHierarchy.default() |
|
|
|
jvm("desktop") |
|
|
|
jvm("desktop") |
|
|
|
android { |
|
|
|
androidTarget { |
|
|
|
publishLibraryVariants("release") |
|
|
|
publishLibraryVariants("release") |
|
|
|
|
|
|
|
compilations.all { |
|
|
|
|
|
|
|
kotlinOptions { |
|
|
|
|
|
|
|
jvmTarget = "11" |
|
|
|
} |
|
|
|
} |
|
|
|
ios() |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
iosX64() |
|
|
|
|
|
|
|
iosArm64() |
|
|
|
iosSimulatorArm64() |
|
|
|
iosSimulatorArm64() |
|
|
|
js(IR) { |
|
|
|
js { |
|
|
|
browser() |
|
|
|
browser { |
|
|
|
|
|
|
|
testTask(Action { |
|
|
|
|
|
|
|
enabled = false |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
macosX64() |
|
|
|
macosX64() |
|
|
|
macosArm64() |
|
|
|
macosArm64() |
|
|
|
|
|
|
|
|
|
|
|
sourceSets { |
|
|
|
sourceSets { |
|
|
|
|
|
|
|
all { |
|
|
|
|
|
|
|
languageSettings { |
|
|
|
|
|
|
|
optIn("kotlin.RequiresOptIn") |
|
|
|
|
|
|
|
optIn("kotlinx.cinterop.ExperimentalForeignApi") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
val commonMain by getting { |
|
|
|
val commonMain by getting { |
|
|
|
dependencies { |
|
|
|
dependencies { |
|
|
|
implementation("org.jetbrains.compose.runtime:runtime:$composeVersion") |
|
|
|
implementation("org.jetbrains.compose.runtime:runtime:$composeVersion") |
|
|
|
implementation("org.jetbrains.compose.foundation:foundation:$composeVersion") |
|
|
|
implementation("org.jetbrains.compose.foundation:foundation:$composeVersion") |
|
|
|
|
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3") |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
val commonTest by getting { |
|
|
|
val commonTest by getting { |
|
|
|
dependencies { |
|
|
|
dependencies { |
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4") |
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3") |
|
|
|
implementation(kotlin("test")) |
|
|
|
implementation(kotlin("test")) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
val commonButJSMain by creating { |
|
|
|
val commonButJSMain by creating { |
|
|
|
dependsOn(commonMain) |
|
|
|
dependsOn(commonMain) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
val commonButJSTest by creating { |
|
|
|
|
|
|
|
dependsOn(commonTest) |
|
|
|
|
|
|
|
} |
|
|
|
val skikoMain by creating { |
|
|
|
val skikoMain by creating { |
|
|
|
dependsOn(commonMain) |
|
|
|
dependsOn(commonMain) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
val skikoTest by creating { |
|
|
|
|
|
|
|
dependsOn(commonTest) |
|
|
|
|
|
|
|
} |
|
|
|
val jvmAndAndroidMain by creating { |
|
|
|
val jvmAndAndroidMain by creating { |
|
|
|
dependsOn(commonMain) |
|
|
|
dependsOn(commonMain) |
|
|
|
} |
|
|
|
} |
|
|
|
val nativeMain by creating { |
|
|
|
val jvmAndAndroidTest by creating { |
|
|
|
dependsOn(commonMain) |
|
|
|
dependsOn(commonTest) |
|
|
|
} |
|
|
|
} |
|
|
|
val desktopMain by getting { |
|
|
|
val desktopMain by getting { |
|
|
|
dependsOn(skikoMain) |
|
|
|
dependsOn(skikoMain) |
|
|
@ -53,60 +79,61 @@ kotlin { |
|
|
|
dependsOn(commonButJSMain) |
|
|
|
dependsOn(commonButJSMain) |
|
|
|
} |
|
|
|
} |
|
|
|
val desktopTest by getting { |
|
|
|
val desktopTest by getting { |
|
|
|
|
|
|
|
dependsOn(skikoTest) |
|
|
|
|
|
|
|
dependsOn(jvmAndAndroidTest) |
|
|
|
|
|
|
|
dependsOn(commonButJSTest) |
|
|
|
dependencies { |
|
|
|
dependencies { |
|
|
|
implementation(compose.desktop.currentOs) |
|
|
|
implementation(compose.desktop.currentOs) |
|
|
|
implementation("org.jetbrains.compose.ui:ui-test-junit4:$composeVersion") |
|
|
|
implementation("org.jetbrains.compose.ui:ui-test-junit4:$composeVersion") |
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-swing:1.6.4") |
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-swing:1.7.3") |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
val androidMain by getting { |
|
|
|
val androidMain by getting { |
|
|
|
dependsOn(jvmAndAndroidMain) |
|
|
|
dependsOn(jvmAndAndroidMain) |
|
|
|
dependsOn(commonButJSMain) |
|
|
|
dependsOn(commonButJSMain) |
|
|
|
} |
|
|
|
} |
|
|
|
val androidTest by getting { |
|
|
|
val androidInstrumentedTest by getting { |
|
|
|
dependencies { |
|
|
|
dependsOn(commonTest) |
|
|
|
|
|
|
|
dependsOn(jvmAndAndroidTest) |
|
|
|
} |
|
|
|
dependsOn(commonButJSTest) |
|
|
|
} |
|
|
|
} |
|
|
|
val iosMain by getting { |
|
|
|
val iosMain by getting { |
|
|
|
dependsOn(skikoMain) |
|
|
|
dependsOn(skikoMain) |
|
|
|
dependsOn(commonButJSMain) |
|
|
|
dependsOn(commonButJSMain) |
|
|
|
dependsOn(nativeMain) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
val iosTest by getting |
|
|
|
val iosTest by getting { |
|
|
|
val iosSimulatorArm64Main by getting |
|
|
|
dependsOn(skikoTest) |
|
|
|
iosSimulatorArm64Main.dependsOn(iosMain) |
|
|
|
dependsOn(commonButJSTest) |
|
|
|
val iosSimulatorArm64Test by getting |
|
|
|
} |
|
|
|
iosSimulatorArm64Test.dependsOn(iosTest) |
|
|
|
|
|
|
|
val jsMain by getting { |
|
|
|
val jsMain by getting { |
|
|
|
dependsOn(skikoMain) |
|
|
|
dependsOn(skikoMain) |
|
|
|
} |
|
|
|
} |
|
|
|
val macosMain by creating { |
|
|
|
val jsTest by getting { |
|
|
|
|
|
|
|
dependsOn(skikoTest) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
val macosMain by getting { |
|
|
|
dependsOn(skikoMain) |
|
|
|
dependsOn(skikoMain) |
|
|
|
dependsOn(commonButJSMain) |
|
|
|
dependsOn(commonButJSMain) |
|
|
|
dependsOn(nativeMain) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
val macosX64Main by getting { |
|
|
|
val macosTest by getting { |
|
|
|
dependsOn(macosMain) |
|
|
|
dependsOn(skikoTest) |
|
|
|
} |
|
|
|
dependsOn(commonButJSTest) |
|
|
|
val macosArm64Main by getting { |
|
|
|
|
|
|
|
dependsOn(macosMain) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
android { |
|
|
|
android { |
|
|
|
compileSdk = 33 |
|
|
|
compileSdk = 34 |
|
|
|
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") |
|
|
|
namespace = "org.jetbrains.compose.components.resources" |
|
|
|
defaultConfig { |
|
|
|
defaultConfig { |
|
|
|
minSdk = 21 |
|
|
|
minSdk = 21 |
|
|
|
targetSdk = 33 |
|
|
|
|
|
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" |
|
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" |
|
|
|
} |
|
|
|
} |
|
|
|
compileOptions { |
|
|
|
compileOptions { |
|
|
|
sourceCompatibility = JavaVersion.VERSION_1_8 |
|
|
|
sourceCompatibility = JavaVersion.VERSION_11 |
|
|
|
targetCompatibility = JavaVersion.VERSION_1_8 |
|
|
|
targetCompatibility = JavaVersion.VERSION_11 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Suppress("UnstableApiUsage") |
|
|
|
testOptions { |
|
|
|
testOptions { |
|
|
|
managedDevices { |
|
|
|
managedDevices { |
|
|
|
devices { |
|
|
|
devices { |
|
|
@ -118,20 +145,13 @@ android { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
dependencies { |
|
|
|
|
|
|
|
|
|
|
|
dependencies { |
|
|
|
|
|
|
|
//Android integration tests |
|
|
|
//Android integration tests |
|
|
|
testImplementation("androidx.test:core:1.5.0") |
|
|
|
testImplementation("androidx.test:core:1.5.0") |
|
|
|
androidTestImplementation("androidx.compose.ui:ui-test-manifest:1.3.1") |
|
|
|
androidTestImplementation("androidx.compose.ui:ui-test-manifest:1.5.3") |
|
|
|
androidTestImplementation("androidx.compose.ui:ui-test:1.3.1") |
|
|
|
androidTestImplementation("androidx.compose.ui:ui-test:1.5.3") |
|
|
|
androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.3.1") |
|
|
|
androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.5.3") |
|
|
|
androidTestImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO it seems that argument isn't applied to the common sourceSet. Figure out why |
|
|
|
|
|
|
|
tasks.withType<KotlinCompile>().configureEach { |
|
|
|
|
|
|
|
kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
configureMavenPublication( |
|
|
|
configureMavenPublication( |
|
|
|