Skip to content

Commit

Permalink
chore : update kotlin version to 2.0.0-RC1
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryOkafor committed Apr 13, 2024
1 parent 6dfb085 commit 5be280e
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 38 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ captures
**/xcshareddata/WorkspaceSettings.xcsettings

.env
.kotlin/metadata/*
59 changes: 36 additions & 23 deletions composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import org.jetbrains.compose.ExperimentalComposeLibrary
@file:Suppress("OPT_IN_USAGE")

import org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion

plugins {
alias(libs.plugins.kotlinMultiplatform)
Expand All @@ -8,6 +11,9 @@ plugins {
alias(libs.plugins.kotlinxSerialization)
}

compose {
kotlinCompilerPlugin.set(libs.versions.kotlinCompilerPlugin.get())
}
kotlin {
// @OptIn(ExperimentalWasmDsl::class)
// wasmJs {
Expand All @@ -19,12 +25,19 @@ kotlin {
// }
// binaries.executable()
// }
//

//K2 compiler is enabled by default for Kotlin 2.0.0-RC1.
//No support yet for KMP so we force kotlin 1.9
compilerOptions {
languageVersion.set(KotlinVersion.KOTLIN_1_9)
apiVersion.set(KotlinVersion.KOTLIN_1_9)

// freeCompilerArgs.add("")
}

androidTarget {
compilations.all {
kotlinOptions {
jvmTarget = "1.8"
}
compilerOptions {
jvmTarget = JvmTarget.JVM_11
}
}

Expand Down Expand Up @@ -71,10 +84,10 @@ kotlin {
implementation(libs.voyager.transitions)
implementation(libs.voyager.tabNavigator)

implementation("dev.whyoleg.cryptography:cryptography-random:0.2.0")
implementation("dev.whyoleg.cryptography:cryptography-core:0.2.0")
implementation(libs.dev.whyoleg.cryptography.random)
implementation(libs.dev.whyoleg.cryptography.core)

implementation("org.jetbrains.compose.annotation-internal:annotation:1.6.0")
implementation(libs.annotation.internal.annotation)

}

Expand All @@ -88,19 +101,19 @@ kotlin {
implementation(libs.ktor.client.android)

api(libs.kotlinx.coroutines.android)

implementation(libs.koin.android)
implementation("dev.whyoleg.cryptography:cryptography-provider-jdk:0.2.0")
implementation(libs.dev.whyoleg.cryptography.provider.jdk)
}


iosMain.dependencies {
implementation(libs.ktor.client.darwin)
implementation("co.touchlab:stately-common:2.0.6")
implementation("dev.whyoleg.cryptography:cryptography-provider-apple:0.2.0")
implementation(libs.stately.common)
implementation(libs.dev.whyoleg.cryptography.provider.apple)


implementation("org.jetbrains.compose.annotation-internal:annotation:1.6.0")
implementation(libs.annotation.internal.annotation)
}

iosTest.dependencies {
Expand All @@ -112,10 +125,10 @@ kotlin {
implementation(libs.commons.codec)

api(libs.kotlinx.coroutines.swingx)

implementation(libs.ktor.server.core)
implementation(libs.ktor.server.netty)
implementation("dev.whyoleg.cryptography:cryptography-provider-jdk:0.2.0")
implementation(libs.dev.whyoleg.cryptography.provider.jdk)
}
}
}
Expand Down Expand Up @@ -148,19 +161,19 @@ android {
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
dependencies {
debugImplementation(libs.compose.ui.tooling)
implementation(libs.androidx.ui.tooling.preview.android)
testImplementation("junit:junit:4.13.2")
testImplementation(libs.junit)

implementation("androidx.browser:browser:1.7.0")
implementation(libs.androidx.browser)

androidTestImplementation("androidx.test.ext:junit:1.1.3")
androidTestImplementation("androidx.test.ext:junit-ktx:1.1.3")
androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0")
androidTestImplementation(libs.androidx.test.junit)
androidTestImplementation(libs.androidx.junit.ktx)
androidTestImplementation(libs.androidx.espresso.core)
}
}

Expand Down
2 changes: 1 addition & 1 deletion composeApp/src/commonMain/kotlin/channel/ChannelConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import org.jetbrains.compose.resources.ExperimentalResourceApi
* Interface for channel configuration, represents various social media channels
*
*/
@OptIn(ExperimentalResourceApi::class)
interface ChannelConfig {
val name: String
val description: String

@OptIn(ExperimentalResourceApi::class)
val icon: DrawableResource

fun createLoginUrl(redirectUrl: String, challenge: String): String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import org.jetbrains.compose.resources.ExperimentalResourceApi
import smshare.composeapp.generated.resources.Res
import smshare.composeapp.generated.resources.ic_facebook

class FacebookChannelConfig @OptIn(ExperimentalResourceApi::class) constructor(
@OptIn(ExperimentalResourceApi::class)
class FacebookChannelConfig(
override val name: String = "Facebook",
override val description: String = "Page or Group",
override val icon: DrawableResource = Res.drawable.ic_facebook
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import smshare.composeapp.generated.resources.Res
import smshare.composeapp.generated.resources.ic_linkedin
import util.urlEncode

class LinkedInChannelConfig @OptIn(ExperimentalResourceApi::class) constructor(
@OptIn(ExperimentalResourceApi::class, ExperimentalSerializationApi::class)
class LinkedInChannelConfig(
override val name: String = "LinkedIn",
override val description: String = "Profile or Page",
override val icon: DrawableResource = Res.drawable.ic_linkedin
Expand All @@ -36,7 +37,6 @@ class LinkedInChannelConfig @OptIn(ExperimentalResourceApi::class) constructor(
"state=$challenge&" +
"scope=${urlEncode(scope.joinToString(" "))}"

@OptIn(ExperimentalSerializationApi::class)
override suspend fun getToken(code: String, redirectUrl: String): TokenResponse {
val client = HttpClient {
install(ContentNegotiation) {
Expand Down
3 changes: 2 additions & 1 deletion composeApp/src/commonMain/kotlin/channel/XChannelConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import org.jetbrains.compose.resources.ExperimentalResourceApi
import smshare.composeapp.generated.resources.Res
import smshare.composeapp.generated.resources.ic_twitter

class XChannelConfig @OptIn(ExperimentalResourceApi::class) constructor(
@OptIn(ExperimentalResourceApi::class)
class XChannelConfig(
override val name: String = "Twitter/X",
override val description: String = "Profile",
override val icon: DrawableResource = Res.drawable.ic_twitter
Expand Down
1 change: 1 addition & 0 deletions composeApp/src/commonMain/kotlin/injection/Injection.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ fun initKoin(appDeclaration: KoinAppDeclaration = {}): KoinApplication {
}


@Suppress("OPT_IN_USAGE_FUTURE_ERROR")
fun commonModule() = module {
single { Platform() }
single { Greeting(get()) }
Expand Down
38 changes: 28 additions & 10 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
[versions]
agp = "8.2.2"
annotationVersion = "1.6.0"
browser = "1.8.0"
cryptographyProviderJdkVersion = "0.2.0"
kotlin = "2.0.0-RC1"
#https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-compatibility-and-versioning.html#kotlin-compatibility

# Android Config
android-compileSdk = "34"
android-minSdk = "24"
android-targetSdk = "34"

compose = "1.6.10-dev1580"
#https://plugins.gradle.org/plugin/org.jetbrains.compose
kotlinCompilerPlugin = "1.5.11-kt-2.0.0-RC1"
statelyCommon = "2.0.6"
uiToolingPreviewAndroid = "1.7.0-alpha06"

agp = "8.2.2"
androidx-activityCompose = "1.8.2"
androidx-appcompat = "1.6.1"
androidx-constraintlayout = "2.1.4"
androidx-core-ktx = "1.12.0"
androidx-espresso-core = "3.5.1"
androidx-test-junit = "1.1.5"

compose = "1.6.3"
#https://plugins.gradle.org/plugin/org.jetbrains.compose
compose-plugin = "1.6.0"
junit = "4.13.2"
#https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-compatibility-and-versioning.html#kotlin-compatibility
kotlin = "1.9.22"

ktor = "2.3.8"
date-time = "0.5.0"
Expand All @@ -27,21 +36,24 @@ koin = "3.6.0-alpha3"
koinCompose = "3.6.0-alpha1"
dev-chrisbanes-windowSizeClass = "0.5.0"
voyager = "1.1.0-alpha03"
uiToolingPreviewAndroid = "1.6.3"

[libraries]
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }
junit = { group = "junit", name = "junit", version.ref = "junit" }

androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "androidx-core-ktx" }
androidx-test-junit = { group = "androidx.test.ext", name = "junit", version.ref = "androidx-test-junit" }
androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "androidx-espresso-core" }
androidx-browser = { module = "androidx.browser:browser", version.ref = "browser" }
androidx-junit-ktx = { module = "androidx.test.ext:junit-ktx", version.ref = "androidx-test-junit" }

# Compose
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activityCompose" }
compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" }
compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "compose" }
compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "uiToolingPreviewAndroid" }
compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "uiToolingPreviewAndroid" }
dev-chrisbanes-windowSizeClass = { module = "dev.chrisbanes.material3:material3-window-size-class-multiplatform", version.ref = "dev-chrisbanes-windowSizeClass" }
annotation-internal-annotation = { module = "org.jetbrains.compose.annotation-internal:annotation", version.ref = "annotationVersion" }

kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" }
Expand All @@ -68,6 +80,7 @@ koin-compose = { module = "io.insert-koin:koin-compose", version.ref = "koinComp
koin-androidx-viewmodel = { module = "io.insert-koin:koin-androidx-viewmodel", version.ref = "koin" }

# voyager
stately-common = { module = "co.touchlab:stately-common", version.ref = "statelyCommon" }
voyager-navigator = { module = "cafe.adriel.voyager:voyager-navigator", version.ref = "voyager" }
voyager-screenModel = { module = "cafe.adriel.voyager:voyager-screenmodel", version.ref = "voyager" }
voyager-bottomSheetNavigator = { module = "cafe.adriel.voyager:voyager-bottom-sheet-navigator", version.ref = "voyager" }
Expand All @@ -79,10 +92,15 @@ androidx-ui-tooling-preview-android = { group = "androidx.compose.ui", name = "u
#voyager-kodein = { module = "cafe.adriel.voyager:voyager-kodein", version.ref = "voyager" }
#voyager-rxjava = { module = "cafe.adriel.voyager:voyager-rxjava", version.ref = "voyager" }

dev-whyoleg-cryptography-core = { module = "dev.whyoleg.cryptography:cryptography-core", version.ref = "cryptographyProviderJdkVersion" }
dev-whyoleg-cryptography-provider-apple = { module = "dev.whyoleg.cryptography:cryptography-provider-apple", version.ref = "cryptographyProviderJdkVersion" }
dev-whyoleg-cryptography-random = { module = "dev.whyoleg.cryptography:cryptography-random", version.ref = "cryptographyProviderJdkVersion" }
dev-whyoleg-cryptography-provider-jdk = { module = "dev.whyoleg.cryptography:cryptography-provider-jdk", version.ref = "cryptographyProviderJdkVersion" }


[plugins]
androidApplication = { id = "com.android.application", version.ref = "agp" }
androidLibrary = { id = "com.android.library", version.ref = "agp" }
jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" }
jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose" }
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlinxSerialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }

0 comments on commit 5be280e

Please sign in to comment.