From dad738357c5c0f87f0734ecf052fcaadb6ebb62d Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 8 Mar 2022 10:00:19 +0600 Subject: [PATCH 1/7] start 0.9.11 --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 70dce9a6f40..265c98f9563 100644 --- a/gradle.properties +++ b/gradle.properties @@ -45,5 +45,5 @@ dokka_version=1.6.10 # Project data group=dev.inmo -version=0.9.10 -android_code_version=100 +version=0.9.11 +android_code_version=101 From 1e51f9d77beec83d55cbbf224b4afa7d600dfbfe Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 8 Mar 2022 10:01:02 +0600 Subject: [PATCH 2/7] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3fa7da9067..6e3e9b7f5b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +## 0.9.11 + ## 0.9.10 * `Versions`: From 43e88e00da7fd0a08bebacc93b7e59743e0d9134 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 8 Mar 2022 10:01:53 +0600 Subject: [PATCH 3/7] Update klock --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 265c98f9563..9da7f1dba37 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,7 +14,7 @@ kotlin_exposed_version=0.37.3 ktor_version=1.6.7 -klockVersion=2.6.1 +klockVersion=2.6.2 github_release_plugin_version=2.2.12 From eb35903de902a814ad0440c153cd369aad07708d Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 10 Mar 2022 15:20:42 +0600 Subject: [PATCH 4/7] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e3e9b7f5b6..20f35b015b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## 0.9.11 +* `Versions`: + * `Klock`: `2.6.1` -> `2.6.2` + ## 0.9.10 * `Versions`: From 97339c9b1dc99409fca46bcc35bd7c8d48699765 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 10 Mar 2022 15:55:45 +0600 Subject: [PATCH 5/7] update wrapper version --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 41dfb87909a..00e33edef69 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From cf2be8ed43e591afaca29c3bfbc6f1164ee2f3d3 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 10 Mar 2022 17:04:05 +0600 Subject: [PATCH 6/7] migration onto toml --- android/alerts/common/build.gradle | 2 +- android/recyclerview/build.gradle | 4 +- build.gradle | 12 ++--- coroutines/build.gradle | 4 +- defaultAndroidSettings.gradle | 8 +-- gradle.properties | 31 ----------- gradle/libs.versions.toml | 78 +++++++++++++++++++++++++++ ktor/client/build.gradle | 2 +- ktor/common/build.gradle | 4 +- ktor/server/build.gradle | 8 +-- language_codes/generator/build.gradle | 12 ++--- mppProjectWithSerialization.gradle | 6 +-- pagination/exposed/build.gradle | 2 +- pagination/ktor/server/build.gradle | 4 +- repos/common/build.gradle | 6 +-- selector/common/build.gradle | 4 +- settings.gradle | 6 ++- 17 files changed, 121 insertions(+), 72 deletions(-) create mode 100644 gradle/libs.versions.toml diff --git a/android/alerts/common/build.gradle b/android/alerts/common/build.gradle index b60575bd26f..2c4a222700d 100644 --- a/android/alerts/common/build.gradle +++ b/android/alerts/common/build.gradle @@ -10,7 +10,7 @@ kotlin { sourceSets { androidMain { dependencies { - api "androidx.appcompat:appcompat-resources:$appcompat_version" + api libs.android.appCompat.resources } } } diff --git a/android/recyclerview/build.gradle b/android/recyclerview/build.gradle index 1357ac98f51..ff5a2ee19ce 100644 --- a/android/recyclerview/build.gradle +++ b/android/recyclerview/build.gradle @@ -10,13 +10,13 @@ kotlin { sourceSets { commonMain { dependencies { - api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version" + api libs.kt.coroutines api project(":micro_utils.common") } } androidMain { dependencies { - api "androidx.recyclerview:recyclerview:$androidx_recycler_version" + api libs.android.recyclerView } } } diff --git a/build.gradle b/build.gradle index 3ac12d3ecec..38310db4281 100644 --- a/build.gradle +++ b/build.gradle @@ -7,12 +7,12 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.0.4' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - classpath "com.getkeepsafe.dexcount:dexcount-gradle-plugin:$dexcount_version" - classpath "com.github.breadmoirai:github-release:$github_release_plugin_version" - classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version" + classpath libs.buildscript.kt.gradle + classpath libs.buildscript.kt.serialization + classpath libs.buildscript.jb.dokka + classpath libs.buildscript.gh.release + classpath libs.buildscript.android.gradle + classpath libs.buildscript.android.dexcount } } diff --git a/coroutines/build.gradle b/coroutines/build.gradle index 840c8f52822..c614db7e76c 100644 --- a/coroutines/build.gradle +++ b/coroutines/build.gradle @@ -10,12 +10,12 @@ kotlin { sourceSets { commonMain { dependencies { - api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version" + api libs.kt.coroutines } } androidMain { dependencies { - api "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlin_coroutines_version" + api libs.kt.coroutines.android } } } diff --git a/defaultAndroidSettings.gradle b/defaultAndroidSettings.gradle index 276131ff612..6f0376b46af 100644 --- a/defaultAndroidSettings.gradle +++ b/defaultAndroidSettings.gradle @@ -26,12 +26,12 @@ ext { } android { - compileSdkVersion "$android_compileSdkVersion".toInteger() - buildToolsVersion "$android_buildToolsVersion" + compileSdkVersion libs.versions.android.props.compileSdk.get().toInteger() + buildToolsVersion libs.versions.android.props.buildTools.get() defaultConfig { - minSdkVersion "$android_minSdkVersion".toInteger() - targetSdkVersion "$android_compileSdkVersion".toInteger() + minSdkVersion libs.versions.android.props.minSdk.get().toInteger() + targetSdkVersion libs.versions.android.props.compileSdk.get().toInteger() versionCode "${android_code_version}".toInteger() versionName "$version" } diff --git a/gradle.properties b/gradle.properties index 9da7f1dba37..bf5149f9b48 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,41 +7,10 @@ android.useAndroidX=true android.enableJetifier=true org.gradle.jvmargs=-Xmx2g -kotlin_version=1.6.10 -kotlin_coroutines_version=1.6.0 -kotlin_serialisation_core_version=1.3.2 -kotlin_exposed_version=0.37.3 - -ktor_version=1.6.7 - -klockVersion=2.6.2 - -github_release_plugin_version=2.2.12 - -uuidVersion=0.4.0 - -# ANDROID - -core_ktx_version=1.7.0 -androidx_recycler_version=1.2.1 -appcompat_version=1.4.1 - -android_minSdkVersion=19 -android_compileSdkVersion=32 -android_buildToolsVersion=32.0.0 -dexcount_version=3.0.1 -junit_version=4.12 -test_ext_junit_version=1.1.2 -espresso_core=3.3.0 - # JS NPM crypto_js_version=4.1.1 -# Dokka - -dokka_version=1.6.10 - # Project data group=dev.inmo diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 00000000000..5219d007752 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,78 @@ +[versions] + +kt = "1.6.10" +kt-serialization = "1.3.2" +kt-coroutines = "1.6.0" + +jb-compose = "1.1.0" +jb-exposed = "0.37.3" +jb-dokka = "1.6.10" + +klock = "2.6.2" +uuid = "0.4.0" + +ktor = "1.6.7" + +gh-release = "2.2.12" + +android-gradle = "7.0.4" +dexcount = "3.0.1" + +android-coreKtx = "1.7.0" +android-recyclerView = "1.2.1" +android-appCompat = "1.4.1" +android-espresso = "3.3.0" +android-test = "1.1.2" + +android-props-minSdk = "19" +android-props-compileSdk = "32" +android-props-buildTools = "32.0.0" + +[libraries] + +kt-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kt" } + +kt-serialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kt-serialization" } +kt-serialization-cbor = { module = "org.jetbrains.kotlinx:kotlinx-serialization-cbor", version.ref = "kt-serialization" } + +kt-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kt-coroutines" } +kt-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kt-coroutines" } + + +ktor-client = { module = "io.ktor:ktor-client-core", version.ref = "ktor" } +ktor-client-java = { module = "io.ktor:ktor-client-java", version.ref = "ktor" } +ktor-server = { module = "io.ktor:ktor-server", version.ref = "ktor" } +ktor-server-cio = { module = "io.ktor:ktor-server-cio", version.ref = "ktor" } +ktor-server-host-common = { module = "io.ktor:ktor-server-host-common", version.ref = "ktor" } +ktor-websockets = { module = "io.ktor:ktor-websockets", version.ref = "ktor" } + + +klock = { module = "com.soywiz.korlibs.klock:klock", version.ref = "klock" } +uuid = { module = "com.benasher44:uuid", version.ref = "uuid" } + + +jb-exposed = { module = "org.jetbrains.exposed:exposed-core", version.ref = "jb-exposed" } + + +android-coreKtx = { module = "androidx.core:core-ktx", version.ref = "android-coreKtx" } +android-recyclerView = { module = "androidx.recyclerview:recyclerview", version.ref = "android-recyclerView" } +android-appCompat-resources = { module = "androidx.appcompat:appcompat-resources", version.ref = "android-appCompat" } +android-espresso = { module = "androidx.test.espresso:espresso-core", version.ref = "android-espresso" } +android-test-junit = { module = "androidx.test.ext:junit", version.ref = "android-test" } + + +kt-test-js = { module = "org.jetbrains.kotlin:kotlin-test-js", version.ref = "kt" } +kt-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kt" } + + +buildscript-kt-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kt" } +buildscript-kt-serialization = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kt" } +buildscript-jb-dokka = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "jb-dokka" } +buildscript-gh-release = { module = "com.github.breadmoirai:github-release", version.ref = "gh-release" } +buildscript-android-gradle = { module = "com.android.tools.build:gradle", version.ref = "android-gradle" } +buildscript-android-dexcount = { module = "com.getkeepsafe.dexcount:dexcount-gradle-plugin", version.ref = "dexcount" } + +[plugins] + +kt-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kt" } +jb-compose = { id = "org.jetbrains.compose", version.ref = "jb-compose" } diff --git a/ktor/client/build.gradle b/ktor/client/build.gradle index 7b24b0efa3f..19c17926dfe 100644 --- a/ktor/client/build.gradle +++ b/ktor/client/build.gradle @@ -12,7 +12,7 @@ kotlin { dependencies { api internalProject("micro_utils.ktor.common") api internalProject("micro_utils.coroutines") - api "io.ktor:ktor-client-core:$ktor_version" + api libs.ktor.client } } } diff --git a/ktor/common/build.gradle b/ktor/common/build.gradle index b07a884bf17..ad2dd123f61 100644 --- a/ktor/common/build.gradle +++ b/ktor/common/build.gradle @@ -11,8 +11,8 @@ kotlin { commonMain { dependencies { api internalProject("micro_utils.common") - api "org.jetbrains.kotlinx:kotlinx-serialization-cbor:$kotlin_serialisation_core_version" - api "com.soywiz.korlibs.klock:klock:$klockVersion" + api libs.kt.serialization.cbor + api libs.klock } } } diff --git a/ktor/server/build.gradle b/ktor/server/build.gradle index 7e17189e74b..ecf783c0bb2 100644 --- a/ktor/server/build.gradle +++ b/ktor/server/build.gradle @@ -16,10 +16,10 @@ kotlin { jvmMain { dependencies { - api "io.ktor:ktor-server:$ktor_version" - api "io.ktor:ktor-server-cio:$ktor_version" - api "io.ktor:ktor-server-host-common:$ktor_version" - api "io.ktor:ktor-websockets:$ktor_version" + api libs.ktor.server + api libs.ktor.server.cio + api libs.ktor.server.host.common + api libs.ktor.websockets } } } diff --git a/language_codes/generator/build.gradle b/language_codes/generator/build.gradle index 385e6f1c4e0..4b3027381f8 100644 --- a/language_codes/generator/build.gradle +++ b/language_codes/generator/build.gradle @@ -4,8 +4,8 @@ buildscript { } dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" + classpath libs.buildscript.kt.gradle + classpath libs.buildscript.kt.serialization } } @@ -16,11 +16,11 @@ plugins { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlin_serialisation_core_version" + implementation libs.kt.stdlib + implementation libs.kt.serialization - implementation "io.ktor:ktor-client-core:$ktor_version" - implementation "io.ktor:ktor-client-java:$ktor_version" + implementation libs.ktor.client + implementation libs.ktor.client.java } mainClassName="MainKt" diff --git a/mppProjectWithSerialization.gradle b/mppProjectWithSerialization.gradle index 073b502c5b1..615ec80d132 100644 --- a/mppProjectWithSerialization.gradle +++ b/mppProjectWithSerialization.gradle @@ -23,7 +23,7 @@ kotlin { commonMain { dependencies { implementation kotlin('stdlib') - api "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlin_serialisation_core_version" + implementation libs.kt.serialization } } commonTest { @@ -46,8 +46,8 @@ kotlin { androidTest { dependencies { implementation kotlin('test-junit') - implementation "androidx.test.ext:junit:$test_ext_junit_version" - implementation "androidx.test.espresso:espresso-core:$espresso_core" + implementation libs.android.test.junit + implementation libs.android.espresso } } } diff --git a/pagination/exposed/build.gradle b/pagination/exposed/build.gradle index e89fe5afe6d..cb7043ff2c5 100644 --- a/pagination/exposed/build.gradle +++ b/pagination/exposed/build.gradle @@ -14,7 +14,7 @@ kotlin { } jvmMain { dependencies { - api "org.jetbrains.exposed:exposed-core:$kotlin_exposed_version" + api libs.jb.exposed } } } diff --git a/pagination/ktor/server/build.gradle b/pagination/ktor/server/build.gradle index 5812c31b6df..265848cb1ea 100644 --- a/pagination/ktor/server/build.gradle +++ b/pagination/ktor/server/build.gradle @@ -15,8 +15,8 @@ kotlin { jvmMain { dependencies { - api "io.ktor:ktor-server:$ktor_version" - api "io.ktor:ktor-server-host-common:$ktor_version" + api libs.ktor.server + api libs.ktor.server.host.common } } } diff --git a/repos/common/build.gradle b/repos/common/build.gradle index acc9dcb0875..7a315ab290a 100644 --- a/repos/common/build.gradle +++ b/repos/common/build.gradle @@ -10,10 +10,10 @@ kotlin { sourceSets { commonMain { dependencies { - api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version" + api libs.kt.coroutines api internalProject("micro_utils.pagination.common") - api "com.benasher44:uuid:$uuidVersion" + api libs.uuid } } @@ -24,7 +24,7 @@ kotlin { } androidMain { dependencies { - api "androidx.core:core-ktx:$core_ktx_version" + api libs.android.coreKtx api internalProject("micro_utils.common") api internalProject("micro_utils.coroutines") } diff --git a/selector/common/build.gradle b/selector/common/build.gradle index 74d1ba46f61..988d2067495 100644 --- a/selector/common/build.gradle +++ b/selector/common/build.gradle @@ -10,8 +10,8 @@ kotlin { sourceSets { commonMain { dependencies { - api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version" + api libs.kt.coroutines } } } -} \ No newline at end of file +} diff --git a/settings.gradle b/settings.gradle index 323f588ee48..0c7df486ea5 100644 --- a/settings.gradle +++ b/settings.gradle @@ -38,11 +38,13 @@ String[] includes = [ includes.each { originalName -> - String projectDirectory = "${rootProject.projectDir.getAbsolutePath()}${originalName.replaceAll(":", File.separator)}" - String projectName = "${rootProject.name}${originalName.replaceAll(":", ".")}" + String projectDirectory = "${rootProject.projectDir.getAbsolutePath()}${originalName.replace(":", File.separator)}" + String projectName = "${rootProject.name}${originalName.replace(":", ".")}" String projectIdentifier = ":${projectName}" include projectIdentifier ProjectDescriptor project = project(projectIdentifier) project.name = projectName project.projectDir = new File(projectDirectory) } + +enableFeaturePreview("VERSION_CATALOGS") From d9c15db9dee3010e2b7841eb495bc7356b849074 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 10 Mar 2022 17:47:37 +0600 Subject: [PATCH 7/7] add compose submodule and add several functions in top of composition --- CHANGELOG.md | 7 ++ coroutines/compose/build.gradle | 18 +++++ .../compose/LinkCompositionToJob.kt | 14 ++++ .../RenderComposableWithLinkToContext.kt | 16 +++++ .../compose/src/main/AndroidManifest.xml | 1 + extensions.gradle | 1 + gradle/libs.versions.toml | 1 - mppProjectWithSerializationAndCompose.gradle | 72 +++++++++++++++++++ settings.gradle | 1 + 9 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 coroutines/compose/build.gradle create mode 100644 coroutines/compose/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/compose/LinkCompositionToJob.kt create mode 100644 coroutines/compose/src/jsMain/kotlin/dev/inmo/micro_utils/coroutines/compose/RenderComposableWithLinkToContext.kt create mode 100644 coroutines/compose/src/main/AndroidManifest.xml create mode 100644 mppProjectWithSerializationAndCompose.gradle diff --git a/CHANGELOG.md b/CHANGELOG.md index 20f35b015b3..25e40580650 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ * `Versions`: * `Klock`: `2.6.1` -> `2.6.2` +* `Coroutines`: + * `Compose`: + * Created :) + * New extensions and function: + * `Composition#linkWithJob` + * `Composition#linkWithContext` + * `renderComposableAndLinkToContext` ## 0.9.10 diff --git a/coroutines/compose/build.gradle b/coroutines/compose/build.gradle new file mode 100644 index 00000000000..ca8aa5b5fce --- /dev/null +++ b/coroutines/compose/build.gradle @@ -0,0 +1,18 @@ +plugins { + id "org.jetbrains.kotlin.multiplatform" + id "org.jetbrains.kotlin.plugin.serialization" + id "com.android.library" + alias(libs.plugins.jb.compose) +} + +apply from: "$mppProjectWithSerializationAndComposePresetPath" + +kotlin { + sourceSets { + commonMain { + dependencies { + api libs.kt.coroutines + } + } + } +} diff --git a/coroutines/compose/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/compose/LinkCompositionToJob.kt b/coroutines/compose/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/compose/LinkCompositionToJob.kt new file mode 100644 index 00000000000..5107a97b5bf --- /dev/null +++ b/coroutines/compose/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/compose/LinkCompositionToJob.kt @@ -0,0 +1,14 @@ +package dev.inmo.micro_utils.coroutines.compose + +import androidx.compose.runtime.* +import kotlinx.coroutines.Job +import kotlinx.coroutines.job +import kotlin.coroutines.CoroutineContext + +fun Composition.linkWithJob(job: Job) { + job.invokeOnCompletion { + this@linkWithJob.dispose() + } +} + +fun Composition.linkWithContext(coroutineContext: CoroutineContext) = linkWithJob(coroutineContext.job) diff --git a/coroutines/compose/src/jsMain/kotlin/dev/inmo/micro_utils/coroutines/compose/RenderComposableWithLinkToContext.kt b/coroutines/compose/src/jsMain/kotlin/dev/inmo/micro_utils/coroutines/compose/RenderComposableWithLinkToContext.kt new file mode 100644 index 00000000000..85d78e4011b --- /dev/null +++ b/coroutines/compose/src/jsMain/kotlin/dev/inmo/micro_utils/coroutines/compose/RenderComposableWithLinkToContext.kt @@ -0,0 +1,16 @@ +package dev.inmo.micro_utils.coroutines.compose + +import androidx.compose.runtime.* +import kotlinx.coroutines.* +import org.jetbrains.compose.web.dom.DOMScope +import org.w3c.dom.Element + +suspend fun renderComposableAndLinkToContext( + root: TElement, + monotonicFrameClock: MonotonicFrameClock = DefaultMonotonicFrameClock, + content: @Composable DOMScope.() -> Unit +): Composition = org.jetbrains.compose.web.renderComposable(root, monotonicFrameClock, content).apply { + linkWithContext( + currentCoroutineContext() + ) +} diff --git a/coroutines/compose/src/main/AndroidManifest.xml b/coroutines/compose/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..3287860bd4c --- /dev/null +++ b/coroutines/compose/src/main/AndroidManifest.xml @@ -0,0 +1 @@ + diff --git a/extensions.gradle b/extensions.gradle index df5aa0c04e1..751d061e0d8 100644 --- a/extensions.gradle +++ b/extensions.gradle @@ -21,6 +21,7 @@ allprojects { releaseMode = (project.hasProperty('RELEASE_MODE') && project.property('RELEASE_MODE') == "true") || System.getenv('RELEASE_MODE') == "true" mppProjectWithSerializationPresetPath = "${rootProject.projectDir.absolutePath}/mppProjectWithSerialization.gradle" + mppProjectWithSerializationAndComposePresetPath = "${rootProject.projectDir.absolutePath}/mppProjectWithSerializationAndCompose.gradle" mppJavaProjectPresetPath = "${rootProject.projectDir.absolutePath}/mppJavaProject.gradle" mppAndroidProjectPresetPath = "${rootProject.projectDir.absolutePath}/mppAndroidProject.gradle" diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5219d007752..bc669187942 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -74,5 +74,4 @@ buildscript-android-dexcount = { module = "com.getkeepsafe.dexcount:dexcount-gra [plugins] -kt-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kt" } jb-compose = { id = "org.jetbrains.compose", version.ref = "jb-compose" } diff --git a/mppProjectWithSerializationAndCompose.gradle b/mppProjectWithSerializationAndCompose.gradle new file mode 100644 index 00000000000..eff5f7fe0c0 --- /dev/null +++ b/mppProjectWithSerializationAndCompose.gradle @@ -0,0 +1,72 @@ +project.version = "$version" +project.group = "$group" + +apply from: "$publishGradlePath" + +kotlin { + jvm { + compilations.main { + kotlinOptions { + jvmTarget = "1.8" + } + } + } + js (IR) { + browser() + nodejs() + } + android { + publishAllLibraryVariants() + } + + sourceSets { + commonMain { + dependencies { + implementation kotlin('stdlib') + implementation libs.kt.serialization + implementation compose.runtime + } + } + commonTest { + dependencies { + implementation kotlin('test-common') + implementation kotlin('test-annotations-common') + } + } + jvmMain { + dependencies { + implementation compose.desktop.currentOs + } + } + jvmTest { + dependencies { + implementation kotlin('test-junit') + } + } + jsMain { + dependencies { + implementation compose.web.core + } + } + jsTest { + dependencies { + implementation kotlin('test-js') + implementation kotlin('test-junit') + } + } + androidTest { + dependencies { + implementation kotlin('test-junit') + implementation libs.android.test.junit + implementation libs.android.espresso + } + } + } +} + +apply from: "$defaultAndroidSettingsPresetPath" + +java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} diff --git a/settings.gradle b/settings.gradle index 0c7df486ea5..d22455ff9dd 100644 --- a/settings.gradle +++ b/settings.gradle @@ -23,6 +23,7 @@ String[] includes = [ ":ktor:common", ":ktor:client", ":coroutines", + ":coroutines:compose", ":android:recyclerview", ":android:alerts:common", ":android:alerts:recyclerview",